Public Spirit #01
17 мая 1997 |
|
Coder - transfer of the screen for the interruption, Packers.
Music: author: (C) Dave (a) DEX ' (C) SEM In the ZX-POWER # 1 went debate about what is possible-if throw a screen from RAM to video less than one interrupt. Let's look better and make some calculations: So we know that the most the best way to transfer data is the so-called 'Stack' way. Its essence is to following: The stack is installed on the last byte of the field to to bandy information. Then, in the HL loaded a couple of bytes to transfer is done PUSH HL.Takim way for 11 cycles (PUSH HL) and burn at once 2 bytes. This is the same operation holds for the remaining information. Unconditional advantage of this method in the rate of transfer, but the main drawback ways are hard requirements to Total free memory (Briefly, eats lots of memory). Now, from theory to practice: Method using cycle immediately dismisses as not fastest. It only remains turn in all memory filling its many blocks of type: LD HL, # NNNN; of thrown ; Bytes (1) PUSH HL; actually ; Transfer Number of blocks determined by the length spreads block codes divided by two (since spreads on two bytes for times). Now let's return to the topic: we need to throw a screen (6912 bytes). Hence it is necessary raskrunchitsya at 13,827 bytes (6912 / 2 is the number of structures type (1) = 3,456 and multiplied by 4 (Number of bytes occupied construction). = 13,824 and plus 3 bytes on the command LD SP, # 5B00). We now calculate number of cycles occupied the entire procedure. (10 +11) * 3456 = 72576 cycles. 10-number of cycles LD HL, NNNN 1911 - ------//-------- PUSH HL 3456 is the number of repetitions. Concludes: For branded machines are unable, TK There we have 70,000 Bar. But you can spill over into MACHINES WITH MORE THAN 72,650 Bar. TK We still REMEMBER, install and RESTORE THE STACK AND MOST MAIN CAUSE OF PROCEDURE AND BACK FROM HER. Here we thought, felt and Now think, do we need this transfer? Practical benefits from this is no. After all, we barely enough cycles to the deployment, and who need to throw static image 50 times per second? But we need it yet change, and this is the second interrupt (if not third). For sim to draw final conclusions: Throw POSSIBLE, BUT NOT NECESSARY! Question please consider closed. Thank you for your attention, DSEEMX. I mean SEM and DEX. or DEX and SEM. (C) CODERS 'ACADEMY 4:44:35 AM 21/04/97. AD
Other articles:
Similar articles:
В этот день... 23 November