Studies - E. Volchkov. Improvement routines address calculation system on display file.

ZX Review #3-4
(C) Evgeniy Volchkov (Hacker
Rowdy), Chita, 1996.


   In those days, when I was still with
an effort understand Assembler I
fortunate enough to buy the first
that series of books on the chart.
Very useful program, which was published in the book, was 
calculated address in the file system on display at

coordinates specified in the familiarity. In the original, as 
you know, of course, it looks like this: 140.


     LD DE, (COORDS)

     LD A, E

     AND # 18

     OR # 40

     LD H, A

     LD A, E

     AND # 07

     OR A

     RRA

     RRA

     RRA

     RRA

     ADD A, D

     LD L, A
2

   After I had, not without the help of your literature, 
increased their knowledge of Assembler, I stumbled once again 
on this program and command near OR A with surprised to read 
your comment Reset flag CARRY ". But

before OR A stands AND # 07, which, following the book "ZX 
Spectrum ' TR-DOS ", always, regardless of the result,

Resets flag CARRY, ie this
small sub can be used with equal success,
but simply removing OR A. In addition, the length of the 
routines can be reduced if the supply 3 bits, indicates the 
number of series, on its place with the command

RRCA. Thus, 5 teams:
140.

     OR A

     RRA

     RRA

     RRA

     RRA

replaced by 3:


     RRCA

     RRCA

     RRCA
2

   We win in two
areas - subtract two bytes of a routine that even without
that is small, and reduces
during her performance (although not much, but for dynamic games
it may be useful).

********************************