Micro­power

  

Volume 1 · Number 1 · August 1981

Page 30 of 33
FE 1BCP £1B; Is it an ‘escape’ ?
20 EFJR NZ CPLOOP; If not, look for next difference
DF 6ASCAL CRLF; End of routine; scroll screen
C9RET; and return to monitor
E5TABPUSH HL; Save current poition of
D5PUSH DE; pointers to blocks 1 and 2
01 F0 FFLD BC -16; Tabulate from 16 bytes
09ADD HL BC; before difference
54LD D H; Put this address into DE
5DLD E L
01 20 00LD BC 32; Tabulate to 16 bytes
09ADD HL BC; beyond the difference
EBEX DE HL; Now get 1st address in HL, 2nd in DE
DF 54SCAL "T; Call the tabulate command
D1POP DE; Recover pointers
E1POP HL
C9RET; End of subroutine

You will see that the routine is relocatable; to incorporate it into your monitor as command F you must put the start address at £078C in Nas-Sys 3, at £0792 in Nas-Sys 1. To compare blocks of memory starting at £1000 and £2000 you simply enter F1000 2000. When one of the command letters is entered the first three hexadecimal values following the letter are held in HL, DE and BC, but if you want to run the program under the E command, entering EXXXX 1000 2000, you will have to prefix a routine to pick up the block addresses; for examples:

2A 0E 0CLD HL (£0C0E); Get block 1 address in HL
ED 5B 10 0CLD DE (£0C10); and block 2 in DE

XXXX will be the start address of the modified program. Also the return instruction at the end of the program (not the one at the end of the subroutine) should be changed to DF 5B, SCAL MRET. Because this means replacing a single byte code by a two byte one you will have to move the subroutine down one byte and change the values in the relative calls. However, you can avoid this by using C7, RST 0, to get back to the monitor.

There are 34 remaining subroutine calls in Nas-Sys 1 (DF 5B – DF 7C). These cannot be entered as commands from the keyboard, but can all be used in programs. Nas-Sys 3 has 3 extra subroutine calls, including the repeat keyboard facility.

Restart £20, £E7, is used by the breakpoint routine to halt the execution of a program and display the current state of the processor. When a breakpoint is entered at address XXXX by entering BXXXX, the address is stored in the workspace at £0C23. The next execute command saves the code it finds at XXXX and then, providing that the address entered was not zero, it inserts a breakpoint restart. When the program arrives at this restart the original code is replaced, and the contents of the registers are saved in the workspace (from £0C61 to £0C6C) and displayed on the screen. The program then returns to the monitor to wait for the next command. If you now enter E without specifying an address execution continues at the replaced code; once again restart £E7 will be inserted (because £0C23 still contains address XXXX) and if

Page 30 of 33