
130 Servicing Personal Computers
An example of embedding a machine language routine within a BASIC program is shown in
Listing 3.4. This program uses an array into which the machine code is loaded from a DATA
statement. The machine code uses the versatile Z80 LDIR instruction, which permits a block
transfer of memory. In this particular case, 512 bytes of memory, starting at an address
specified by the user, are transferred into the last 512 bytes of screen memory. This results in
the lower half of the screen being filled with ASCII and graphics characters which represent
the contents of the memory block in question. Typical screen dumps generate ...