ZX Power #01
11 октября 1996

Likbez - Transfer Memory - Memory: Myths and Realities: Is it possible to transfer the screen in less than one interrupt?

<b>Likbez</b> - Transfer Memory - Memory: Myths and Realities: Is it possible to transfer the screen in less than one interrupt?
 Shipment memory - memory:

     Myths and Realities.


              (C) Dr.SQUIZER
________________________________


     Among novice programmers SPECCY always rumors that someone 
managed to transfer the screen faster than

per interrupt. We will understand:
is it possible?

   To forward to 6144 bytes
6144 times to perform write cycle in
memory, otherwise it will not be
called the shipment. And how many
Read cycles to execute?
If the image is symmetric or
periodic, then, of course,
less. Leave there room for
creative imagination, and themselves, consider the case of 
irregular images. 

  Remove from the manual in with the e
Team Z80, which include
write operation to RAM:


    LD (HL), r LD (ii), r

    LD (DE), A LD (nn), A

    PUSH qq PUSH ii

    LDI LDIR

    LD (HL), n LD (ii), n

    LD (nn), HL LD (nn), dd

    EX (SP), HL EX (SP), ii

    LDD LDDR

    LD (BC), A LD (nn), ii


   For obvious reasons, the list
Not logged command:
 INC (HL); DEC (HL); SET b, (HL);
RES b, (HL); same for ii; rotation and shifts (HL) and (ii).
 Memory write operations with the help of CALL, RST and 
confirmation interrupt leave to cool

jokes.

  We now rewrite only those commands that are faster LDIR
(Otherwise, why, and head to fool).
In parentheses indicate the number of CPU cycles to record one
byte in memory with this
Team:


      LDIR, LDDR (10.5)

      EX (SP), HL (9.5)

      LD (HL), r (7)

      PUSH qq (5.5)

      LD (nn), dd (10)

      LD (nn), HL (8)

      LD (BC), A (7)

      LD (nn), ii (10)

      PUSH ii (7.5)

      LD (DE), A (7)


  Commands such as LD (HL), r is required after a minimum 
4-stroke to modify the address. Hence, the actual performance 
11 clock cycles per byte. For the same because of rule and EX 
(SP), HL. Speed ​​commands LD (nn), dd

and LD (nn), ii so close to LDIR
that the appropriateness of their use for our purposes is 
questionable. 

   But the team LD (nn), HL deserves attention.

   The team itself PUSH decrements the address, but sooner or 
later require a minimum of LD SP, nn

therefore, its best performance in a loop:


           LD SP, nn

           PUSH AF

           PUSH BC

           PUSH DE

           PUSH HL

           EXX

           PUSH BC

           PUSH DE

           PUSH HL

equal to 6.5 cycles per byte, which
a record for the Z80.

  We will not bore readers
similar calculations for the commands to read from memory. We 
give the final result:



     LDIR (10.5)

     LD HL, (nn) (8.0)

     POP qq (5.0; 6.0)


   This implies that the soft
RAM area can be sent for
is the number of cycles:

LDIR: 6144 * 21 = 129 024
LD HL, (mm)
LD (ss), HL: 6144 * 16 = 98304
POP HL
LD (ss), HL: 6144 * 13 = 79872
POP / PUSH: 6144 * 12.5 = 76 800


   As you can see, even at a period
repetition INT in 71,680 cycles
meet in one interrupt is impossible.

   Programistskaya same legend was born, apparently of an 
incorrect calculation: 


            POP / PUSH:
6144 * (5.0 + 5.5) = 70 656 (!).
________________________________



    Shipment memory Memory:

       Myths and Realities.

(C) DJNZ
-------------------------------






Other articles:

Iron - PC -> ZX: Connecting to the Spectrum multicards.

Iron - Communication port for the Speccy.

Iron - On connecting AY MOUSE.

Interview - Interview with editors of the magazine taken from Cobra.

Likbez - Transfer Memory - Memory: Myths and Realities: Is it possible to transfer the screen in less than one interrupt?

Review - Apple: a look at past and present.

Review - O computer "Silicon Graphics".

Review - On the specialized LSIs, that create uniqueness Amiga.

From the authors - Short description of the features of the shell.

From the authors - On the history of the magazine. On ovtorah.

a rest - A. Snizhko "great scientist".

a rest - Jokes ...

a rest - Small Encyclopedia of Computer beings.

a rest - Tips pervokurssniku or note-taking options are boring lectures: outline of a tough student; glosary.

Perspective - "Hellraizer" (based on the book A. Norton, "Queen of the Sun").

Perspective - The script of the new game - Theseus (THESEUS) Part 1: "In the steel maze.

Desktop - O capabilities of the new commander "Win Commander 0.02".

Desktop - Short description: A macro-assembler debugger "ALASM 2.8".

Desktop - The program of digitization of sound "Digital Factory v1.0" (COVOX).

Miscellaneous - Viruses on the Spectrum and their detection.

Miscellaneous - Results Enlight'96.

Advertising - Advertising and announcements.

Fantasy - G. Garison (Part 1-3)

Fantasy - D. Galeev "Vostan in Mohlyandii or plush revolution."

Fantasy - Frederik Pohl "Hunters".


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Enlight'97 - Indicative timetable. General rules for all contests on all platforms.
Iron - Hemnogo about GMX (end).
On asshole - Overfile Must Die!!!

В этот день...   21 November