ZX Review #3-4
22 июля 1997 |
|
Forum - M. Bekarev. The calculation of the address display area of familiarity, and vice versa.
(C) Bekarev Michael Krasnoyarsk. I am a longtime fan of the ZX (and computer magazine). In general, try their hand at programming. Initially, in BASIC, as well as everything, and now transferred to the machine code and is very sorry that has not been able to overcome the so-called psychological barrier the transition from BASIC in ASSEMBLER. The striking difference! Not only in speed, but also in availability. In the codes communicate with a processor with a good friend, about all you can talk to. Starting to learn assembler I ran into a problem calculating the address display area for familiarity and vice versa. And I decided this problem came with the tablet. Use it is not easy and very easy! For example, we need to calculate the address of familiarity with coordinates y = 11, x = 18. H L 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 4 2 1 Number of rows 0 .. 7 Aug. 16 4 2 1 Y 0 .. 23 Aug. 16 4 2 1 X 0 .. 31 February 1 Segment number 0 .. 2 1 Address Screen Watch and type in the table on the line Y number 11 and note it in the bottom row of Address screen. Number 11 is typed on 8 High Byte and 2,1 junior. 1 1 1 1 Now we collect the X number of 18, is 16 and 2 low byte 1 1 1 1 1 1 You can even find out what the address will have 3 line in this familiarity, adding the line table "line number" number 3 High byte: 1 1 1 1 1 1 1 1 Now we see this as a bit-byte layout register (eg, HL). 1 1 1 1 1 1 1 1 128 64 32 16 8 4 2 1 128 64 32 16 8 4 2 1 Consequently, the high byte H = (64 +8 +2 +1) * 256 = 19200, and the youngest 64 L = 32 16 +2 = 114, and hence address is 19200 114 = 19314. You can even see that the address is in the first segment of the screen, as enabled bit over 1 in line "segment number". Inverse telecine is even easier. Expanding the address of the screen in bits it is easy to find the coordinates, considering even the fingers. Unit in the high register (Bit 6) is required because it beginning of the address screen (64 * 256 = 16384). ********************************
Other articles:
Similar articles:
В этот день... 21 November