INMC 80 News


September 1980 – January 1981, Issue 2

Page 38 of 59


(Bd. This program has been assembled using the MACRO 80 assembler, watch out, two byte address operands appear as you would read them. Don’t forget that when entering

code, two byte operands are entered low byte first, ie: in reverse order to that printed below.) VARPRO the variable protector MACRO-80 3.35 Page 1 title VARPRO the variable protector subttl Version 1 3; by M. D. Hendry s 3 Re-assembled, MACRO 80, D. R. Hunt 06.09.80

3; This program is for use with Nascom ROM ; Basic and runs under NAS-SYS. It allows the user to save variables in RAM

and recover them after altering a Basic program, which must be re-entered by (eg) GOTO XXX, where line XXX occurs after ail DIMensions have been declared.

Entry at ODOOH for save Entry at OD30H for restore

No check is made for memory overflow, so do X=FRE(A$) to force a ‘garbage hunt’ and PRINT X to find out number of free bytes for additions to the Basic program. Then call MONITOR, E OD30, and GOTO XXX.

Mo en we ee oe

0000 aseg

+280 0018 scal equ 18h 3; Subroutine call 10D6 var equ 10d6h 3; Ptr. to var. tab. 10D8 $var equ 10d8h 3; Ptr. to strings TODA ramlo equ 10dah ; Ptr. first free byte 1003 ramhi equ 10c3h ; Ptr. last free byte oD80 vari equ 0d80h 3; New loc. of var. tab. ODB2 varl equ var1+2 3; var. tab. length ODB4 nvarl equ varit+4 3 num. var. tab. len. ODe86 ramhit equ vart+6 3; Top of var. tab.

org 0d00hn oped 24 10D8 gave: 1d hi,($var) oD03 ED 4B 10D6 1d be, (var) ODO7 ED 42 sbe hi,be oDo9 22 on84 1d (nvarl) ,hl opoc 2A 10DA 1d h1,(ramlo) ODOF ED 42 sbc hl1,be oD1t 22 OD82 1d (varl),hl op14 2A 1003 1d hl, (ramhi) 0D17 22 OD86 1d (ramhi1),h1 ODIA 23 ine hl ODIB ED 4B OD8z 1d be, (varl) ODIF ED 42 sbe hi,be op21 22 OD80 id (vart),h1

This is an OCR’d version of the scanned page and likely contains recognition errors.

Page 38 of 59