Z80-Assembler		Release 1.8				Page 1
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                       1      1 ;
                       2      2 ;	OCR'ed by Larry Kraemer
                       3      3 ;	Corrected typos and modified for z80asm by Udo Munk
                       4      4 ;	January 2016
                       5      5 ;
                       6      6 ;	Use z80asm 1.8, won't assemble correct with versions before
                       7      7 ;
0000                   8      8 STAT	EQU	0			;STATUS PORT, DEVICE A
0001                   9      9 DATA	EQU	1			;DATA PORT, DEVICE A
0002                  10     10 ACMNDP	EQU	2			;COMMAND PORT, DEV. A
0000                  11     11 ABAUDP	EQU	0			;BAUD PORT, DEVICE A
0004                  12     12 APARLP	EQU	4			;PARALLEL PORT, DEV. A
0052                  13     13 BCMNDP	EQU	52H			;COMMAND PORT, DEV. B
0054                  14     14 BPARLP	EQU	54H			;PARALLEL PORT, DEV. B
0040                  15     15 DAV	EQU	40H			;DATA-AVLAILABLE MASK
0080                  16     16 TBE	EQU	80H			;XMITTER-BUF-EMPTY MASK
                      17     17 ;
0005                  18     18 NBRKPT	EQU	5			;ALLOW ROOM FOR
0016                  19     19 BPSTOR	EQU	NBRKPT*4+2		;BREAKPOINT STORAGE
0016                  20     20 TEMPS	EQU	BPSTOR
000b                  21     21 BPMRK	EQU	0BH			;USED TO MARK THE SET-
                      22     22 ;					;TING OF A BP IN BPSTOR.
0030                  23     23 RSTLC	EQU	30H			;RST LOCATION
0000                  24     24 CASE	EQU	0			;(REQUIRES UPPER-CASE)
0005                  25     25 B2F	EQU	5			;2-BYTE FLAG
0006                  26     26 PF	EQU	6			;PRIME-ABLE REG FLAG
0007                  27     27 CRF	EQU	7			;CRLF FLAG
                      28     28 ;
000d                  29     29 CR	EQU	0DH
000a                  30     30 LF	EQU	0AH
001b                  31     31 ESC	EQU	1BH
007d                  32     32 ALT	EQU	7DH
                      33     33 ;
                      34     34 ;  DISPLACEMENTS FROM IX OF HI BYTE OF REG PAIRS
                      35     35 ;
                      36     36 ;
ffff                  37     37 DUPC	EQU	-1			;(FFFF)
fffd                  38     38 DUAF	EQU	-3			;(FFFD)
fffb                  39     39 DUBC	EQU	-5			;(FFFB)
fff9                  40     40 DUDE	EQU	-7			;(FFF9)
fff7                  41     41 DUHL	EQU	-9			;(FFF7)
fff5                  42     42 DUSP	EQU	-11			;(FFF5)
fff3                  43     43 DUIX	EQU	-13			;(FFF3)	
fff1                  44     44 DUIY	EQU	-15			;(FFF1)
ffef                  45     45 DUIN	EQU	-17			;(FFEF)        I & THE INTERRUPT FF
ffed                  46     46 DUAF2	EQU	-19			;(FFED)
ffeb                  47     47 DUBC2	EQU	-21			;(FFEB)
ffe9                  48     48 DUDE2	EQU	-23			;(FFE9)
ffe7                  49     49 DUHL2	EQU	-25			;(FFE7)
                      50     50 ;
001a                  51     51 LENRGS	EQU	DUPC-DUHL2+2
                      52     52 ;
                      53     53 ;
                      54     54 ;
                      55     55 ;
                      56     56 
                      57     57 	ORG	0E000H
                      58     58 ;
                      59     59 ; ENTER THE MONITOR FROM RESET.
                      60     60 ; COLD START ENTRY. INITIALIZES THE UART
Z80-Assembler		Release 1.8				Page 2
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                      61     61 ; AND ZEROES THE BREAKPOINT STACK POINTER.
                      62     62 ; ALTERS THE A-REGISTER. SAVES ALL OTHER
                      63     63 ; REGISTERS EXCEPT THE PROGRAM COUNTER,
                      64     64 ; BUT DOES NOT DISPLAY THEM.
                      65     65 
e000  3e 01           66     66 CSTART: LD  	A,1
e002  d3 40           67     67 	OUT 	(40H),A			;SELECT BANK B
e004  f5              68     68 	PUSH	AF			;SIMULATE UPC
e005  f5              69     69 	PUSH	AF			;USER-F-REGISTER
e006  18 42           70     70 	JR	COMMON
                      71     71 ; WARM START ENTRY.  INITIALIZES THE BREAKPOINT
                      72     72 ; STORAGE POINTER.  SAVES ALL REGISTERS EXCEPT
                      73     73 ; THE PROGRAM COUNTER, BUT DOES NOT DISPLAY THEM.
                      74     74 
e008  f5              75     75 WSTART:	PUSH	AF			;SIMULATE UPC
e009  f5              76     76 	PUSH	AF			;UAF
e00a  3e 80           77     77 	LD	A,80H			;FLAG:
e00c  18 3c           78     78 	JR	COMMON			;WARM-START ENTRY
                      79     79 ;
                      80     80 ; CHECK INPUT & RETURN WITH DATA IF READY.
                      81     81 ;
e00e  db 00           82     82 CHKIN:	IN	A,(STAT)
e010  e6 40           83     83 	AND	DAV
e012  c8              84     84 	RET	Z
e013  db 01           85     85 	IN	A,(DATA)
e015  c9              86     86 	RET
                      87     87 ;
                      88     88 ;
                      89     89 ; GET CHARACTER FROM INPUT.
                      90     90 ;
e016  cd 0e e0        91     91 GBYTE:	CALL	CHKIN
e019  28 fb           92     92 	JR	Z,GBYTE
e01b  e6 7f           93     93 	AND	7FH
e01d  c9              94     94 	RET
                      95     95 ;
                      96     96 ;
                      97     97 ; PRINT CHARACTER.
                      98     98 ;
e01e  f5              99     99 PBYTE:	PUSH	AF
e01f  db 00          100    100 PBY1:	IN	A,(STAT)
e021  e6 80          101    101 	AND	TBE
e023  28 fa          102    102 	JR	Z,PBY1
e025  f1             103    103 	POP	AF
e026  d3 01          104    104 	OUT	(DATA),A
e028  c9             105    105 	RET
                     106    106 ;
                     107    107 ;
                     108    108 ; SELECT DEVICE A & INITIALIZE ITS BAUD RATE.
                     109    109 ; ENTER WITH A=1.
                     110    110 ;
e029  d3 54          111    111 INIT:	OUT	(BPARLP),A		;SELECT DEVICE A
e02b  d3 52          112    112 	OUT	(BCMNDP),A		;RESET DEVICE B
                     113    113 ;					;[CONTINUE BELOW]
                     114    114 ;
                     115    115 ;
                     116    116 ; INITIALIZE BAUD RATE OF THE CURRENT DEVICE.
                     117    117 ;
                     118    118 ; PUSH CARRIAGE-RETURN TO SELECT THE PROPER BAUD
                     119    119 ; RATE FOR THE CURRENT TERMINAL. (THE MAXIMUM
                     120    120 ; NUMBER OF CARRIAGE-RETURNS REQUIRED IS FOUR.)
Z80-Assembler		Release 1.8				Page 3
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     121    121 ;
                     122    122 ; WITH THE CROMEMCO TUART ANY OF THE FOLLOWING
                     123    123 ; BAUD RATES CAN BE SELECTED:
                     124    124 ; 19200, 9600, 4800, 2400, 1200, 300, 150, 110.
                     125    125 ;
                     126    126 ; WITH THE 3P+S:	2400, 300, 110.
                     127    127 ;
                     128    128 ; TWO CARRIAGE-RETURNS ARE REQUIRED FOR
                     129    129 ; ANY UART WITH A FIXED BAUD RATE.
                     130    130 ;
e02d  21 a3 e3       131    131 INITBAUD: LD	HL,BAUDRS
e030  0e 00          132    132 	LD	C,ABAUDP
e032  3e 11          133    133 	LD	A,11H			;OCTUPLE THE CLOCK
e034  d3 02          134    134 IT1:	OUT	(ACMNDP),A		;& RESET CURRENT DEVICE
e036  ed a3          135    135 	OUTI
e038  cd 16 e0       136    136 	CALL	GBYTE
e03b  cd 16 e0       137    137 	CALL	GBYTE
e03e  fe 0d          138    138 	CP	CR
e040  3e 01          139    139 	LD	A,1			;SLOW THE CLOCK
e042  20 f0          140    140 	JR	NZ,IT1
e044  c9             141    141 	RET
                     142    142 ;
                     143    143 ;
                     144    144 ; BREAKPOINT ENTRY. INITIALIZES	NOTHING.
                     145    145 ; SAVES	ALL REGISTERS AND DISPLAYS THEM.
                     146    146 ;
e045  e3             147    147 SVMS:	EX	(SP),HL			;ADJUST BRKPT
e046  2b             148    148 	DEC	HL			;RET ADDR
e047  e3             149    149 	EX	(SP),HL
e048  f5             150    150 	PUSH	AF			;UAF
e049  97             151    151 	SUB	A			;FLAG:
                     152    152 					;BREAKPOINT ENTRY;
                     153    153 ;
                     154    154 ;
e04a  c5             155    155 COMMON:	PUSH	BC			;UBC
e04b  47             156    156 	LD	B,A			;ENTRY FLAG
e04c  d5             157    157 	PUSH	DE			;UDE
e04d  e5             158    158 	PUSH	HL			;UHL
                     159    159 ;
                     160    160 ; PLACE SYS STACK AT HIGHEST PAGE OF
                     161    161 ; AVAILABLE RAM.
                     162    162 ; ALLOW	ROOM FOR TEMP STORAGE.
                     163    163 ;
e04e  21 e9 00       164    164 	LD	HL,00FFH-TEMPS
e051  25             165    165 COM1:	DEC	H
e052  7e             166    166 	LD	A,(HL)
e053  34             167    167 	INC	(HL)
e054  be             168    168 	CP	(HL)			;DID IT CHANGE?
e055  28 fa          169    169 	JR	Z,COM1
e057  35             170    170 	DEC	(HL)			;YES. RESTORE IT.
                     171    171 ;
e058  78             172    172 	LD	A,B			;ENTRY FLAG
e059  eb             173    173 	EX	DE,HL
e05a  21 09 00       174    174 	LD	HL,9
e05d  39             175    175 	ADD	HL,SP			; -> UPC, HI BYTE
e05e  01 0a 00       176    176 	LD	BC,10
e061  ed b8          177    177 	LDDR
                     178    178 ;
e063  13             179    179 	INC	DE			;-> UHL,LO ON SYS STK
e064  eb             180    180 	EX	DE,HL
Z80-Assembler		Release 1.8				Page 4
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e065  f9             181    181 	LD	SP,HL			;CURRENT SYS SP
e066  eb             182    182 	EX	DE,HL
e067  01 0b 00       183    183 	LD	BC,DUPC-DUHL+3
e06a  09             184    184 	ADD	HL,BC			;HL = USER SP
e06b  e5             185    185 	PUSH	HL			;USP
e06c  dd e5          186    186 	PUSH	IX			;UIX
e06e  fd e5          187    187 	PUSH	IY			;UIY
e070  eb             188    188 	EX	DE,HL
e071  09             189    189 	ADD	HL,BC
e072  4d             190    190 	LD	C,L			;SAVE
e073  2b             191    191 	DEC	HL
e074  e5             192    192 	PUSH	HL
e075  dd e1          193    193 	POP	IX
e077  fe 01          194    194 	CP	1			;ENTRY?
e079  38 07          195    195 	JR	C,COM3			;SKIP IF VIA BP.
e07b  71             196    196 	LD	(HL),C			;BP PNTR, LO BYTE
e07c  23             197    197 	INC	HL
e07d  36 00          198    198 	LD	(HL),0			;BP-STACK ENDMARK
                     199    199 ; INITIALIZE THE TUART IF ENTRY WAS VIA RESET.
                     200    200 ; (A CONTAINS 1.)
                     201    201 ;
e07f  cc 29 e0       202    202 	CALL	Z,INIT
                     203    203 ;
e082  ed 57          204    204 COM3:	LD	A,I
e084  67             205    205 	LD	H,A
e085  2e 00          206    206 	LD	L,0
e087  e2 8b e0       207    207 	JP	PO,COM4
e08a  2c             208    208 	INC	L
e08b  e5             209    209 COM4:	PUSH	HL			;UIN
e08c  08             210    210 	EX	AF,AF'
e08d  f5             211    211 	PUSH	AF			;UAF'
e08e  08             212    212 	EX	AF,AF'
e08f  d9             213    213 	EXX
e090  c5             214    214 	PUSH	BC			;UBC'
e091  d5             215    215 	PUSH	DE			;UDE'
e092  e5             216    216 	PUSH	HL			;UHL'
e093  d9             217    217 	EXX
                     218    218 ;
                     219    219 ;IF CY IS SET, ENTRY WAS VIA A BREAKPOINT
e094  21 f0 e3       220    220 	LD	HL,HEAD
e097  d4 0f e2       221    221 	CALL	NC,PMSG
e09a  01 86 50       222    222 	LD	BC,(('P'+CASE) < 8)+86H ;IF BP ENTRY,
e09d  dc 23 e3       223    223 	CALL	C,SUBR3			;DISPLAY THE PC.
                     224    224 ;
                     225    225 ;
                     226    226 ;CLEAR ALL BREAKPOINTS
                     227    227 ;
e0a0  dd e5          228    228 CLBP:	PUSH	IX
e0a2  e1             229    229 	POP	HL			;POINTS TO BPSP,LO
e0a3  6e             230    230 	LD	L,(HL)			;BPSP NOW IN HL
                     231    231 ;
e0a4  7e             232    232 CL1:	LD	A,(HL)			;BP STK EMPTY?
e0a5  fe 0b          233    233 	CP	BPMRK			;IF BPMRK, BP IS SET
e0a7  20 0a          234    234 	JR	NZ,CL2
                     235    235 ;
e0a9  34             236    236 	INC	(HL)			;BP-ERASED MARK
e0aa  2b             237    237 	DEC	HL
e0ab  56             238    238 	LD	D,(HL)
e0ac  2b             239    239 	DEC	HL
e0ad  5e             240    240 	LD	E,(HL)
Z80-Assembler		Release 1.8				Page 5
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e0ae  2b             241    241 	DEC	HL
e0af  ed a8          242    242 	LDD				;RESTORE MEM CONTENTS
e0b1  18 f1          243    243 	JR	CL1
                     244    244 ;
e0b3  7d             245    245 CL2:	LD	A,L
e0b4  2b             246    246 	DEC	HL
e0b5  77             247    247 	LD	(HL),A			;ADJUST BPSP
                     248    248 ;
e0b6  11 e6 ff       249    249 	LD	DE,-LENRGS		;FOR THE BENEFIT
e0b9  19             250    250 	ADD	HL,DE			;OF ERROR & ESCPE
e0ba  f9             251    251 	LD	SP,HL			;RE-INITIALIZE SP
                     252    252 ;
                     253    253 ;
                     254    254 ;GET 1-BYTE COMMAND.
                     255    255 ;RETURNS VALUE IN HL & JUMPS TO THAT ADDR.
                     256    256 ;
e0bb  cd 4d e1       257    257 	CALL	CRLF
e0be  11 be e0       258    258 CMND:	LD	DE,CMND			;SET-UP RETURN
e0c1  d5             259    259 	PUSH	DE
e0c2  21 ae e3       260    260 CMND1:	LD	HL,PRMPT		;RE-ENTRY POINT
e0c5  cd 0f e2       261    261 	CALL	PMSG			;FOR RECURSION
                     262    262 ;HL NOW PNTS TO THE COMMAND TABLE.
                     263    263 ;
                     264    264 ;GET THE COMMAND.
                     265    265 ;DE GETS THE FIRST ALPHA CHAR LESS 'D'.
                     266    266 
e0c8  cd dd e1       267    267 	CALL	SKSG0			;GET NON-SPACE
e0cb  c8             268    268 	RET	Z			;IF CR, IGNORE.
e0cc  d6 44          269    269 	SUB	'D'+CASE		; < 'D'?
e0ce  38 15          270    270 	JR	C,ERROR
e0d0  fe 14          271    271 	CP	'W'-'D'+1		; > 'W'?
e0d2  30 11          272    272 	JR	NC,ERROR
e0d4  5f             273    273 	LD	E,A
e0d5  16 00          274    274 	LD	D,0
                     275    275 ;
e0d7  4a             276    276 	LD	C,D			;INITIALIZE FOR SUBR
e0d8  eb             277    277 	EX	DE,HL
e0d9  29             278    278 	ADD	HL,HL			;TIMES 2
e0da  19             279    279 	ADD	HL,DE			; + TBL ADDR
e0db  5e             280    280 	LD	E,(HL)
e0dc  23             281    281 	INC	HL
e0dd  56             282    282 	LD	D,(HL)
e0de  eb             283    283 	EX	DE,HL
e0df  cd dd e1       284    284 	CALL	SKSG0			;NEXT CMND GHAR
e0e2  fe 4d          285    285 	CP	'M'+CASE		; (USED IN SUBST & DISPL)
e0e4  e9             286    286 	JP	(HL)
                     287    287 ;
                     288    288 ;
                     289    289 ; ERROR & ESCAPE. RETURNS TO CMND WITH SP
                     290    290 ; POINTING TO SAVED-REG AREA (UHL').
                     291    291 
e0e5  3e 3f          292    292 ERROR:	LD	A,'?'
e0e7  cd 12 e1       293    293 	CALL	PCHR
e0ea  18 b4          294    294 ESCPE:	JR	CLBP			;CLEAR ANY BRKPTS
                     295    295 ;
                     296    296 ;
                     297    297 ; PROGRAM PROMS. ABORTS IF DESTINATION
                     298    298 ; IS NOT ON A 1K (400H) BOUNDARY, OR IF SWATH
                     299    299 ; WIDTH IS NOT A MULTIPLE OF 1K.
                     300    300 ;
Z80-Assembler		Release 1.8				Page 6
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     301    301 ;
e0ec  cd a5 e1       302    302 PROG:	CALL	L3NCR
e0ef  78             303    303 	LD	A,B			;ARE INCREMENT &
e0f0  b2             304    304 	OR	D			;DESTINATION BOTH
e0f1  e6 03          305    305 	AND	3			;MULTIPLES OF
e0f3  b1             306    306 	OR	C			;1024?
e0f4  b3             307    307 	OR	E	
e0f5  20 ee          308    308 ERRV1:	JR	NZ,ERROR		;ERROR VECTOR
                     309    309 ;
e0f7  e5             310    310 	PUSH	HL			;SOURCE
e0f8  21 40 01       311    311 	LD	HL,320			;# OF ITERATIONS
e0fb  e3             312    312 PR1:	EX	(SP),HL
e0fc  cd 1a e2       313    313 	CALL	MVE			;MOVE IT
e0ff  e3             314    314 	EX	(SP),HL
e100  2b             315    315 	DEC	HL			;ITERATION CT
e101  7c             316    316 	LD	A,H
e102  b5             317    317 	OR	L
e103  20 f6          318    318 	JR	NZ,PR1
e105  e1             319    319 	POP	HL
e106  18 61          320    320 	JR	VRFY			;VERIFY IT
                     321    321 ;
                     322    322 ;
                     323    323 ;PRINT THE 2 BYTES IN (HL) & (HL-1)
                     324    324 ;DECREMENTS HL BY 2. ALTERS A.
                     325    325 ;PRESERVES OTHER REGS.
                     326    326 ;
e108  cd ec e1       327    327 P2NMS:	CALL    PNM
e10b  2b             328    328 	DEC     HL
e10c  cd ec e1       329    329 	CALL    PNM
e10f  2b             330    330 	DEC     HL	  		; (CONTINUE BELOW)
                     331    331 ;
                     332    332 ;
                     333    333 ;PRINT	SPACE. ALTERS A.
                     334    334 ;
e110  3e 20          335    335 SPACE:	LD A,20H	  		; (CONTINUE BELOW)
                     336    336 ;
                     337    337 ;
                     338    338 ;PRINT THE CHARACTER IN THE A-REGISTER.
                     339    339 ;(CHKS INPUT FOR ESC.)	PRESERVES ALL REGS.
                     340    340 ;
e112  f5             341    341 PCHR:	PUSH	AF	         	;SAVE THE CHAR
e113  e6 7f          342    342 PC1:	AND	7FH
e115  fe 1b          343    343 	CP	ESC
e117  28 d1          344    344 	JR	Z,ESCPE
e119  fe 7d          345    345 	CP	ALT			;ALT MODE?
e11b  28 cd          346    346 	JR	Z,ESCPE
e11d  cd 0e e0       347    347 	CALL	CHKIN
e120  20 f1          348    348 	JR	NZ,PC1
                     349    349 ;
e122  f1             350    350 PC2:	POP	AF
e123  e5             351    351 	PUSH	HL
e124  f5             352    352 	PUSH	AF
e125  e6 7f          353    353 	AND	7FH
e127  cd 1e e0       354    354 	CALL	PBYTE
e12a  21 ab e3       355    355 	LD	HL,LFNN
e12d  fe 0d          356    356 	CP	CR
e12f  cc 0f e2       357    357 	CALL	Z,PMSG
e132  fe 3c          358    358 	CP	'<'			;RECURSIVE CALL
e134  20 0b          359    359 	JR	NZ,PC3			;ON CMND?
e136  f1             360    360 	POP	AF
Z80-Assembler		Release 1.8				Page 7
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e137  3e 0d          361    361 	LD	A,CR			;YES. CONVERT
e139  f5             362    362 	PUSH	AF			;'<' TO A CR.
e13a  d5             363    363 	PUSH	DE
e13b  c5             364    364 	PUSH	BC
e13c  cd c2 e0       365    365 	CALL	CMND1
e13f  c1             366    366 	POP	BC
e140  d1             367    367 	POP	DE
e141  f1             368    368 PC3:	POP	AF
e142  e1             369    369 	POP	HL
e143  c9             370    370 	RET
                     371    371 ;
                     372    372 ;
                     373    373 ; GET CHARACTER. RETURNS IT IN A.
                     374    374 ; ALTERS F.
                     375    375 ;
e144  cd 16 e0       376    376 GCHR:	CALL	GBYTE
e147  cd 12 e1       377    377 	CALL	PCHR
e14a  28 f8          378    378 	JR	Z,GCHR			;IF NULL DON'T RETURN
e14c  c9             379    379 	RET
                     380    380 ;
                     381    381 ;
                     382    382 ; CRLF.	ALTERS A ONLY.
                     383    383 ;
e14d  3e 0d          384    384 CRLF:	LD	A,CR
e14f  18 c1          385    385 	JR	PCHR
                     386    386 ;
                     387    387 ;
                     388    388 ; LOADS	HL WITH	SOURCE ADDR, BC	& DE
                     389    389 ; WITH THE INCREMENT. ENDS WITH A CRLF.
                     390    390 ;
e151  97             391    391 L2NCR0:	SUB	A
                     392    392 
e152  cd 8b e1       393    393 L2NCR:	CALL	LD2N
                     394    394 ;
                     395    395 ; SKIP INITIAL SPACES.
                     396    396 ; IF DELIMITER NOT A CR, ERROR
                     397    397 ;
e155  cd de e1       398    398 SKSGCR:	CALL	SKSG			;WAIT FOR NON-SPACE
e158  20 9b          399    399 	JR	NZ,ERRV1		;IF NOT CR, ERROR
e15a  eb             400    400 	EX	DE,HL
e15b  c9             401    401 	RET
                     402    402 ;
                     403    403 ;
                     404    404 ; PRINT THE NUMBER IN HL, FOLLOWED BY A COLON.
                     405    405 ; PRESERVES ALL REGISTERS EXCEPT A.
                     406    406 ;
e15c  cd 4d e1       407    407 PCADDR:	CALL	CRLF
                     408    408 ;
e15f  cd f2 e1       409    409 PADDR:	CALL	PNHL
e162  3e 3a          410    410 	LD	A,':'
e164  18 ac          411    411 	JR	PCHR
                     412    412 ;
                     413    413 ;
                     414    414 ; COMMAND
                     415    415 ;
e166  cd a5 e1       416    416 VERIF:	CALL	L3NCR			;GET 3	OPERANDS
                     417    417 ;
                     418    418 ; COMPARES TWO AREAS OF MEMORY. ENTER WITH
                     419    419 ; SOURCE IN HL, DESTINATION IN DE & COUNT
                     420    420 ; IN BC. ALTERS ALL REGISTERS.
Z80-Assembler		Release 1.8				Page 8
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     421    421 ;
e169  1a             422    422 VRFY:	LD	A,(DE)
e16a  ed a1          423    423 	CPI				;COMPARE TO SOURCE
e16c  2b             424    424 	DEC	HL
e16d  c4 f2 e1       425    425 	CALL	NZ,PNHL			;PRINT SOURCE ADDR
e170  c4 e9 e1       426    426 	CALL	NZ,PSNM	  		; & CONTENTS
e173  eb             427    427 	EX	DE,HL
e174  c4 e9 e1       428    428 	CALL	NZ,PSNM	  		; & DEBT CONTENTS
e177  c4 ef e1       429    429 	CALL	NZ,PSNHL	  	; & DEBT ADDR
e17a  c4 4d e1       430    430 	CALL 	NZ,CRLF
e17d  eb             431    431 	EX 	DE,HL
e17e  23             432    432 	INC 	HL
e17f  13             433    433 	INC 	DE
e180  e0             434    434 	RET 	PO 			;IF BC=0, DONE.
e181  18 e6          435    435 	JR VRFY
                     436    436 ;
                     437    437 ;
                     438    438 ; COMMAND
                     439    439 ;
e183  cd a5 e1       440    440 MOVE:	CALL	L3NCR			;OPERANDS
e186  cd 1a e2       441    441 	CALL	MVE			;MOVE IT
e189  18 de          442    442 	JR	VRFY
                     443    443 ;
                     444    444 ;
                     445    445 ; LOAD TWO NUMBERS. LOADS DE WITH THE BEGINNING
                     446    446 ; ADDR, N1. LOADS BC & HL WITH THE INCREMENT
                     447    447 ; N2-Ni+1 (OR WITH N2 IF THE OPR IS 'S').
                     448    448 ; RETURNS WITH LAST DELIMITER IN A.
                     449    449 ;
e18b  cd ae e1       450    450 LD2N: 	CALL	GNHL			;N1 TO HL, DELIM TO A
e18e  eb             451    451 	EX  	DE,HL			;SAVE N1 IN DE
e18f  cd de e1       452    452 	CALL	SKSG			;GET NEXT NON-SPACE
e192  fe 53          453    453 	CP  	'S'+CASE		;SWATH?
e194  20 05          454    454 	JR  	NZ,L2N1
                     455    455 ;
e196  cd ad e1       456    456 	CALL	GNHL0			;YES. INCREMENT TO HL.
e199  18 07          457    457 	JR	L2N2
                     458    458 
e19b  cd ae e1       459    459 L2N1:	CALL	GNHL	        	;INCREMENT
e19e  b7             460    460 	OR  	A  	         	;CLEAR CY
e19f  ed 52          461    461 	SBC 	HL,DE 	        	;N2-N1
e1a1  23             462    462 	INC 	HL 	         	;INCLUDE END POINT
e1a2  44             463    463 L2N2:	LD	B,H
e1a3  4d             464    464 	LD  	C,L  	         	;BC GETS THE INCRM
e1a4  c9             465    465 	RET
                     466    466 ;
                     467    467 ;
                     468    468 ; LOAD 3 OPERANDS. HL GETS THE SOURCE, BC
                     469    469 ; THE INCREMENT, AND DE	THE 3RD OPERAND.
                     470    470 ;
e1a5  cd 8b e1       471    471 L3NCR: CALL	LD2N
                     472    472 ; (CONTINUE BELOW)
                     473    473 ;
                     474    474 ;
                     475    475 ; ENTER WITH SPACE OR THE FIRST DIGIT
                     476    476 ; OF A NUMBER IN A. LOADS HL WITH
                     477    477 ; WITH A NEW NUMBER & THEN EXCHANGES
                     478    478 ; DE & HL. FINISHES WITH A CRLF.
                     479    479 ;
e1a8  cd ae e1       480    480 L1NCR: CALL	GNHL	        	 ;SKIP SPACES, LOAD HL
Z80-Assembler		Release 1.8				Page 9
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e1ab  18 a8          481    481 	JR  	SKSGCR  	         ;WAIT FOR A CR
                     482    482 ;
                     483    483 ;
                     484    484 ; CLEARS HL. IF	ENTERED	WITH HEX CHAR IN A,
                     485    485 ; SHIFTS IT INTO HL. O/W, IGNORES LEADING
                     486    486 ; SPACES. FIRST	CHAR MUST BE HEX. CONTINUES
                     487    487 ; SHIFT UNTIL A	NON-HEX	CHAR RECEIVED & THEN
                     488    488 ; RETURNS WITH THE LATTER IN A.
                     489    489 ; PRESERVES B,C,D,E.
                     490    490 ;
                     491    491 ;
e1ad  97             492    492 GNHL0: SUB	A
                     493    493 ;
e1ae  c5             494    494 GNHL: PUSH	BC	         	;SAVE
e1af  21 00 00       495    495 	LD  	HL,0  	         	;CLR BUFFER
                     496    496 ; STRIP LEADING	SPACES & GET CHAR
e1b2  cd de e1       497    497 	CALL	SKSG
                     498    498 ; FIRST CHAR MUST BE HEX
e1b5  cd c6 e1       499    499 	CALL	HEXSH	         	;IF HEX, SHIFT INTO HL
e1b8  da e5 e0       500    500 	JP  	C,ERROR  	        ;O/W, ERROR
e1bb  cd 44 e1       501    501 GN1: CALL	GCHR
e1be  cd c6 e1       502    502 	CALL	HEXSH			;IF HEX SHIFT INTO HL
e1c1  78             503    503 	LD  	A,B  			;RESTORE CHAR
e1c2  30 f7          504    504 	JR  	NC,GN1			;IF HEX, CONTINUE
e1c4  c1             505    505 	POP 	BC			;IF NON-HEX, DONE
e1c5  c9             506    506 	RET
                     507    507 ;
                     508    508 ;
                     509    509 ; IF A CONTAINS	HEX CHAR, SHIFTS BINARY EQUIVALENT
                     510    510 ; INTO HL. IF NOT HEX, RET WITH CY SET. SAVES
                     511    511 ; ORIGINAL CHAR	IN B
                     512    512 ;
e1c6  47             513    513 HEXSH:	LD	B,A
e1c7  d6 30          514    514 	SUB	'0'			; < '0'?
e1c9  d8             515    515 	RET	C
e1ca  c6 e9          516    516 	ADD	A,'0'-('G'+CASE)
e1cc  d8             517    517 	RET	C
e1cd  d6 fa          518    518 	SUB	'A'-'G'
e1cf  30 03          519    519 	JR	NC,HX1 			;OK IF >= 'A'
e1d1  c6 07          520    520 	ADD	A,('A'+CASE)-('9'+1)
e1d3  d8             521    521 	RET	C
e1d4  c6 0a          522    522 HX1:	ADD	A,'9'+1-'0'
                     523    523 ; THE A-REG NOW CONTAINS THE HEX DIGIT IN BINARY.
                     524    524 ; (THE HIGH-ORDER NIBBLE OF A IS 0.)
e1d6  29             525    525 HXSH4:	ADD	HL,HL 			;SHIFT 4 BITS INTO HL
e1d7  29             526    526 	ADD	HL,HL
e1d8  29             527    527 	ADD	HL,HL
e1d9  29             528    528 	ADD	HL,HL
e1da  b5             529    529 	OR	L
e1db  6f             530    530 	LD	L,A
e1dc  c9             531    531 	RET
                     532    532 ;
                     533    533 ;
                     534    534 ; RETURNS WITH A NON-SPACE IN THE A-REG.
                     535    535 ; IF ENTERED WITH A-REG CONTAINING A NULL
                     536    536 ; OR A SPACE, GETS NEW CHARS UNTIL FIRST
                     537    537 ; NON-SPACE OCCURS. ALTERS AF.
                     538    538 ;
e1dd  97             539    539 SKSG0:	SUB	A
                     540    540 ;
Z80-Assembler		Release 1.8				Page 10
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e1de  b7             541    541 SKSG:	OR	A			;DOES A CONTAIN NULL?
e1df  cc 44 e1       542    542 SK1:	CALL	Z,GCHR
e1e2  fe 20          543    543 	CP	20H			;SPACE?
e1e4  28 f9          544    544 	JR	Z,SK1
e1e6  fe 0d          545    545 	CP	CR
e1e8  c9             546    546 	RET
                     547    547 ;
                     548    548 ;
                     549    549 ; PRINT SPACE FOLLOWED BY THE NUMBER POINTED
                     550    550 ; TO BY HL. ALTERS A ONLY.
                     551    551 ;
e1e9  cd 10 e1       552    552 PSNM:	CALL	SPACE
                     553    553 ;	(CONTINUE BELOW)
                     554    554 
                     555    555 ; PRINTS THE NUMBER POINTED TO BY HL.
                     556    556 ; PRESERVES ALL REGISTERS BUT A.
                     557    557 
e1ec  7e             558    558 PNM:	LD	A,(HL)
e1ed  18 08          559    559 	JR	P2HEX
                     560    560 ;
                     561    561 ;
                     562    562 ; PRINT THE NUMBER IN HL.
                     563    563 ; PRESERVES ALL BUT A.
                     564    564 ;
e1ef  cd 10 e1       565    565 PSNHL:	CALL	SPACE
                     566    566 ;
e1f2  7c             567    567 PNHL:	LD	A,H
e1f3  cd f7 e1       568    568 	CALL	P2HEX
e1f6  7d             569    569 	LD	A,L
                     570    570 ;					; (CONTINUE BELOW)
                     571    571 ;
                     572    572 ;PRINT THE NUMBER IN THE A-REGISTER.
                     573    573 ;PRESERVES ALL REGISTERS.
                     574    574 ;
e1f7  cd fb e1       575    575 P2HEX:	CALL	P1HEX
e1fa  1f             576    576 	RRA
e1fb  1f             577    577 P1HEX:	RRA
e1fc  1f             578    578 	RRA
e1fd  1f             579    579 	RRA
e1fe  1f             580    580 	RRA
e1ff  f5             581    581 	PUSH	AF
e200  e6 0f          582    582 	AND	0FH			;MASK
e202  fe 0a          583    583 	CP	10			; < 9?
e204  38 02          584    584 	JR	C,PH1
e206  c6 07          585    585 	ADD	A,7			;A THRU F
e208  c6 30          586    586 PH1:	ADD	A,30H			;ASCII BIAS
e20a  cd 12 e1       587    587 	CALL	PCHR			;PRINT IT
e20d  f1             588    588 	POP	AF
e20e  c9             589    589 	RET
                     590    590 ;
                     591    591 ;
                     592    592 ;PRINT	MESSAGE. ENTER WITH ADDR OF MSG
                     593    593 ;IN HL. THE MESSAGE IS TERMINATED
                     594    594 ;AFTER PRINTING A CHARACTER WHOSE
                     595    595 ;PARITY BIT WAS SET.
                     596    596 ;PRESERVES FLAGS, INCREMENTS HL.
                     597    597 ;
e20f  f5             598    598 PMSG:	PUSH	AF			;SAVE
e210  7e             599    599 PS1:	LD	A,(HL)
e211  23             600    600 	INC	HL
Z80-Assembler		Release 1.8				Page 11
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e212  cd 12 e1       601    601 	CALL	PCHR
e215  17             602    602 	RLA				;LAST CHARACTER?
e216  30 f8          603    603 	JR	NC,PS1			;IF NOT, LOOP
e218  f1             604    604 	POP	AF
e219  c9             605    605 	RET
                     606    606 ;
                     607    607 ;
                     608    608 ;MOVE FROM ONE LOCATION TO ANOTHER. ENTER
                     609    609 ;WITH SOURCE ADDR IN HL, DEST IN DE, BYTE
                     610    610 ;COUNT IN BC.  PRESERVES ALL REGISTERS.
                     611    611 ;
e21a  e5             612    612 MVE:	PUSH	HL			;SOURCE
e21b  d5             613    613 	PUSH	DE			;DEST
e21c  c5             614    614 	PUSH	BC			;BYTE COUNT
e21d  ed b0          615    615 	LDIR
e21f  c1             616    616 	POP	BC
e220  d1             617    617 	POP	DE
e221  e1             618    618 	POP	HL
e222  c9             619    619 	RET
                     620    620 ;
                     621    621 ;
                     622    622 ; COMMAND
                     623    623 ;
                     624    624 ; GO <CR> EXECUTION BEGINS AT USER PC.
                     625    625 ;
                     626    626 ; COMMAND
                     627    627 ;
                     628    628 ; GO (ADDR1>/(ADDR2> ... <ADDRN>
                     629    629 ; EXECUTION BEGINS AT ADDR1 WITH BREAKPOINTS SET
                     630    630 ; AT ADDR2,... ,ADDRN.
                     631    631 
                     632    632 GO:
                     633    633 ; B GETS NBRKPT+1 (MAX. NUMBER OF BP + 1)
                     634    634 ; C, THE BREAKPOINT FLAG, GETS 0 (NO HP SET)
e223  01 00 06       635    635 	LD   	BC,((NBRKPT+1) < 8)+0
e226  cd de e1       636    636 GO1:	CALL 	SKSG 	 		;WAIT FOR NON-SPACE
e229  28 3a          637    637 	JR   	Z,RETN   	 	;RETN IF CR
e22b  fe 2f          638    638 	CP	'/'	 		;BP?
e22d  20 0d          639    639 	JR   	NZ,GO3
e22f  4f             640    640 	LD   	C,A   	 		;SET BRKPT FLAG (2FH)
e230  21 30 00       641    641 	LD   	HL,RSTLC   	 	;TRANSFER
e233  36 c3          642    642 	LD   	(HL),0C3H   	 	;'JP SVMS' TO
e235  21 45 e0       643    643 	LD   	HL,SVMS
e238  22 31 00       644    644 	LD   	(RSTLC+1),HL   	 	;RST LOC
e23b  97             645    645 	SUB  	A
e23c  cd ae e1       646    646 GO3:	CALL 	GNHL 	 		;GET ADDR
e23f  cb 69          647    647 	BIT  	5,C  	 		; FLAG SET?
e241  eb             648    648 	EX   	DE,HL
e242  dd e5          649    649 	PUSH 	IX
e244  e1             650    650 	POP  	HL
e245  28 18          651    651 	JR   	Z,GO5   	 	;JUMP IF NO BP
                     652    652 ;
e247  05             653    653 	DEC  	B  	 		;IF TOO MANY BP,
e248  ca e5 e0       654    654 	JP   	Z,ERROR   	 	;ERROR.
e24b  6e             655    655 	LD   	L,(HL)   	 	;HL = BPSP
                     656    656 ;
e24c  23             657    657 	INC  	HL  	 		;BUMP BPSP
e24d  eb             658    658 	EX   	DE,HL   	 	;DE = BPSP, HL= BP ADDR
e24e  ed a0          659    659 	LDI
e250  2b             660    660 	DEC  	HL
Z80-Assembler		Release 1.8				Page 12
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e251  36 f7          661    661 	LD   	(HL),0C7H+RSTLC 	;RST INSTRUCTION
e253  eb             662    662 	EX   	DE,HL   	 	;HL = BPSP
e254  73             663    663 	LD   	(HL),E   	 	;BP ADDR TO STACK
e255  23             664    664 	INC  	HL
e256  72             665    665 	LD   	(HL),D
e257  23             666    666 	INC  	HL
e258  36 0b          667    667 	LD   	(HL),BPMRK   	 	;PUNCTUATION (BP SET)
e25a  dd 75 00       668    668 	LD   	(IX+0),L
e25d  18 c7          669    669 	JR   	GO1
                     670    670 ; CHANGE USER PC
e25f  2b             671    671 GO5:	DEC  	HL
e260  72             672    672 	LD   	(HL),D
e261  2b             673    673 	DEC  	HL
e262  73             674    674 	LD   	(HL),E
e263  18 c1          675    675 	JR   	GO1   		 	;BACK FOR MORE
                     676    676 ;
e265  e1             677    677 RETN:	POP  	HL  	 		;STRIP ADDR FROM STK
e266  e1             678    678 	POP  	HL  	 		;UHL'
e267  d1             679    679 	POP  	DE  	 		;UDE'
e268  c1             680    680 	POP	BC			;UBC'
e269  f1             681    681 	POP	AF			;UAF'
e26a  d9             682    682 	EXX
e26b  08             683    683 	EX 	AF,AF'
                     684    684 ;
e26c  f1             685    685 	POP	AF			;UIN
e26d  ed 47          686    686 	LD 	I,A 			; UI
e26f  f3             687    687 	DI
e270  30 01          688    688 	JR 	NC,RT1
e272  fb             689    689 	EI
                     690    690 ;IFF NOW RESTORED
e273  fd e1          691    691 RT1:	POP	IY			;UIY
e275  dd e1          692    692 	POP	IX			;UIX
e277  d1             693    693 	POP	DE			;USP
                     694    694 ;
                     695    695 ;COPY THE REMAINDER OF THE SYS STACK
                     696    696 ;TO THE USER STACK. IF THIS TRANSFER
                     697    697 ;IS MADE WITHOUT ERROR, SWITCH TO THE
                     698    698 ;USER STACK. OTHERWISE, RETAIN THE
                     699    699 ;SYSTEM STACK.
                     700    700 ;
e278  21 0a 00       701    701 	LD	HL,10
e27b  45             702    702 	LD 	B,L
e27c  39             703    703 	ADD	HL,SP
e27d  eb             704    704 	EX 	DE,HL
e27e  1b             705    705 RT2:	DEC	DE
e27f  2b             706    706 	DEC	HL
e280  1a             707    707 	LD 	A,(DE)
e281  77             708    708 	LD 	(HL),A
e282  be             709    709 	CP 	(HL)
e283  20 03          710    710 	JR 	NZ,RT3
e285  10 f7          711    711 	DJNZ	RT2
e287  f9             712    712 	LD 	SP,HL
                     713    713 ;
e288  e1             714    714 RT3:	POP	HL
e289  d1             715    715 	POP	DE
e28a  c1             716    716 	POP	BC
e28b  f1             717    717 	POP	AF
e28c  c9             718    718 	RET
                     719    719 
                     720    720 
Z80-Assembler		Release 1.8				Page 13
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     721    721 ;	COMMAND.  DISPLAY REGISTERS.
                     722    722 ;
                     723    723 ;	DR
                     724    724 ;
                     725    725 ; COMMAND.  DISPLAY MEMORY.
                     726    726 ;
                     727    727 ; DM <STARTING ADDR> <ENDING ADDR OR SWATH>
                     728    728 ;
e28d  01 80 41       729    729 DISPL:	LD	BC,(('A'+CASE) < 8)+80H ;[FOR DR]
e290  20 3f          730    730 	JR	NZ,SUBR2	 	;IF NOT 'M', DR
                     731    731 ;
                     732    732 ;
e292  cd 51 e1       733    733 DSPM:	CALL	L2NCR0	 		;GET OPERANDS
e295  16 10          734    734 DSPM1:	LD	D,16	 		;BYTE COUNT
e297  cd 5c e1       735    735 	CALL	PCADDR	 		;ADDRESS
e29a  cd e9 e1       736    736 DM2:	CALL	PSNM			;MEM CONTENTS
e29d  ed a1          737    737 	CPI				;INC HL & DEC BC
e29f  e2 4d e1       738    738 	JP	PO,CRLF
e2a2  15             739    739 	DEC	D
e2a3  28 f0          740    740 	JR	Z,DSPM1
e2a5  7a             741    741 	LD	A,D
e2a6  e6 03          742    742 	AND	3
e2a8  cc 10 e1       743    743 	CALL	Z,SPACE
e2ab  cc 10 e1       744    744 	CALL	Z,SPACE
e2ae  18 ea          745    745 	JR	DM2
                     746    746 ;
                     747    747 ;
                     748    748 ; COMMAND. SUBSTITUTE MEMORY LOCATION.
                     749    749 ;
                     750    750 ; SM <ADDR>
                     751    751 ;
                     752    752 ; COMMAND. SUBSTITUTE USER-REGISTER.
                     753    753 ;
                     754    754 ; S<REGISTER NAME>
                     755    755 ;
                     756    756 ; REGISTER NAMES: P [PC] , S [SP]
                     757    757 ; A, F, B, C, D, E, H [HL]
                     758    758 ; I, N [1FF], X [IX], Y [IY]
                     759    759 ; A',F',B',C',D',E',H' [HL'].
                     760    760 ;
e2b0  20 16          761    761 SUBST:	JR	NZ,SUBR			;IN NOT 'M', SR
                     762    762 
e2b2  97             763    763 SUBM:	SUB	A
e2b3  47             764    764 	LD	B,A			;1-BYTE MASK
e2b4  cd a8 e1       765    765 	CALL	L1NCR
e2b7  eb             766    766 	EX	DE,HL			;HL GETS ADDR
e2b8  cc 5c e1       767    767 SM1:	CALL	Z,PCADDR
e2bb  cc 10 e1       768    768 	CALL	Z,SPACE
                     769    769 ; PRINT CURRENT VALUE, REQUEST NEW VALUE &
                     770    770 ; PRINT IT IF GIVEN
e2be  cd 32 e3       771    771 	CALL	GSUBV
e2c1  c8             772    772 	RET	Z			;IF CR, DONE.
e2c2  23             773    773 	INC	HL
e2c3  3e 07          774    774 	LD	A,7			;PRINT ADDRESS IF IT
e2c5  a5             775    775 	AND	L			;IS A MULTIPLE OF 8
e2c6  18 f0          776    776 	JR	SM1
                     777    777 ;
                     778    778 ;
e2c8  47             779    779 SUBR:	LD	B,A
e2c9  cd 44 e1       780    780 	CALL	GCHR
Z80-Assembler		Release 1.8				Page 14
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e2cc  fe 00          781    781 	CP	''''
e2ce  20 02          782    782 	JR	NZ,SR2
e2d0  0c             783    783 	INC	C			;TURN ON THE PRIME-FLAG
e2d1  97             784    784 SUBR2:	SUB	A
e2d2  cd 55 e1       785    785 SR2:	CALL	SKSGCR			;WAIT FOR CR
e2d5  78             786    786 SR3:	LD	A,B
e2d6  d6 41          787    787 	SUB	'A'+CASE		;CHECK THE RANGE
e2d8  da e5 e0       788    788 	JP	C,ERROR
e2db  fe 19          789    789 	CP	'Y'-'A'+1
e2dd  d2 e5 e0       790    790 	JP	NC,ERROR
e2e0  5f             791    791 	LD	E,A
e2e1  16 00          792    792 	LD	D,0
e2e3  21 d7 e3       793    793 	LD	HL,RGTBL
e2e6  19             794    794 	ADD	HL,DE
e2e7  7e             795    795 	LD	A,(HL)
e2e8  b7             796    796 	OR	A
e2e9  28 33          797    797 	JR	Z,SR6	    		;IF ENTRY = 0, SKIP
e2eb  1e 00          798    798 	LD	E,0
e2ed  cb 41          799    799 	BIT	0,C	    		;PRIME?
e2ef  28 06          800    800 	JR	Z,SR4
e2f1  cb 76          801    801 	BIT	PF,(HL)			;YES. PRIMEABLE REG?
e2f3  28 29          802    802 	JR	Z,SR6	    		;IF NOT, SKIP.
e2f5  1e 10          803    803 	LD	E,DUAF-DUAF2
e2f7  e6 1f          804    804 SR4:	AND	1FH	    		;STRIP FLAGS FROM ENTRY
e2f9  83             805    805 	ADD	A,E
e2fa  5f             806    806 	LD	E,A
e2fb  c5             807    807 	PUSH	BC	    		;SAVE
e2fc  78             808    808 	LD	A,B	    		;PRINT REG NAME
e2fd  cd 12 e1       809    809 	CALL	PCHR
e300  fe 48          810    810 	CP	'H'+CASE
e302  3e 4c          811    811 	LD	A,'L'+CASE
e304  cc 12 e1       812    812 	CALL	Z,PCHR
e307  ee 71          813    813 	XOR	'L'+CASE ^ '='		;CLEAR CY, A = '='.
e309  cb 41          814    814 	BIT	0,C	    		; PRIME?
e30b  28 02          815    815 	JR	Z,SR5
e30d  3e 00          816    816 	LD	A,''''
e30f  cd 12 e1       817    817 SR5:	CALL	PCHR
e312  46             818    818 	LD	B,(HL)	    		;SAVE ORIGINAL ENTRY
e313  dd e5          819    819 	PUSH	IX
e315  e1             820    820 	POP	HL	   	 	;STACK FRAME
e316  ed 52          821    821 	SBC	HL,DE	    		;HL -> USER REG
e318  cd 32 e3       822    822 	CALL	GSUBV	    		;PRINT VALUE, REQUEST NEW
e31b  78             823    823 	LD	A,B	    		;SAVE
e31c  c1             824    824 	POP	BC
e31d  c8             825    825 	RET	Z	    		;DONE IF CR
                     826    826 ;
e31e  04             827    827 SR6:	INC	B	    		;NEXT REG
e31f  07             828    828 	RLCA		    		;Y OR H?
e320  30 b3          829    829 	JR	NC,SR3	    		;IF NEITHER, LOOP
e322  07             830    830 	RLCA		    		;YES, IS IT Y?
e323  cd 4d e1       831    831 SUBR3:	CALL	CRLF	    		; [ENTRY FOR DISPLAYING PC
e326  38 05          832    832 	JR	C,SR8
e328  06 41          833    833 	LD	B,'A'+CASE		;YES, IT IS Y.
e32a  0c             834    834 	INC	C	    		;TURN ON PRIME-FLAG
e32b  18 a8          835    835 	JR	SR3
e32d  cb 41          836    836 SR8:	BIT	0,C	    		;NO. H OR H'?
e32f  28 a4          837    837 	JR	Z,SR3	   		;IF H, LOOP.
e331  c9             838    838 	RET		    		;IT IS H'. DONE.
                     839    839 
                     840    840 
Z80-Assembler		Release 1.8				Page 15
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     841    841 ; ENTER WITH HL POINTING TO MEMORY &
                     842    842 ; B CONTAINING THE 1-BYTE OR 2-BYTE FLAG.
                     843    843 ; PRINTS SPACE, CONTENTS OF (HL), & ALSO (HL-1) FOR
                     844    844 ; 2-BYTE REGS, GETS SUBSTITUTION VALUE & LOADS IT.
                     845    845 ; RETURNS WITH Z-FLAG SET 1FF THE DELIMITER IS
                     846    846 ; A CARRIAGE-RETURN.
                     847    847 ; PRESERVES BC & HL.
                     848    848 ;
e332  cd ec e1       849    849 GSUBV:	CALL	PNM	 		;PRINT (HL)
e335  cb 68          850    850 	BIT	B2F,B	 		;2-BYTE REG?
e337  28 04          851    851 	JR	Z,GS1
e339  2b             852    852 	DEC	HL
e33a  cd ec e1       853    853 	CALL	PNM	 		;LO BYTE
e33d  79             854    854 GS1:	LD	A,C	 		;SUBST-OR-DISPLAY FLAG
e33e  07             855    855 	RLCA
e33f  38 0a          856    856 	JR	C,GS2			;IF DISPLAY, EXIT.
e341  3e 2e          857    857 	LD	A,'.'
e343  cd 12 e1       858    858 	CALL	PCHR
e346  cd 44 e1       859    859 	CALL	GCHR
e349  fe 2f          860    860 	CP	'.'+1			;SUBSTITUTION?
e34b  dc 12 e1       861    861 GS2:	CALL	C,PCHR			;IF NOT, PRINT ANOTHER.
e34e  38 0c          862    862 	JR	C,GS3
e350  eb             863    863 	EX	DE,HL
e351  cd ae e1       864    864 	CALL	GNHL			;NEW VALUE
e354  eb             865    865 	EX	DE,HL
e355  73             866    866 	LD	(HL),E
e356  cb 68          867    867 	BIT	B2F,B
e358  28 02          868    868 	JR	Z,GS3
e35a  23             869    869 	INC	HL
e35b  72             870    870 	LD	(HL),D
e35c  fe 0d          871    871 GS3:	CP	CR
e35e  c4 10 e1       872    872 	CALL	NZ,SPACE
e361  c9             873    873 	RET
                     874    874 ;
                     875    875 ;
                     876    876 ;...SUBDM 00 7E 5 585 BY 5 100 DBE++
                     877    877 ;
                     878    878 ;
                     879    879 ; COMMAND
                     880    880 ; SELECT UART-A OR UART-B.
                     881    881 ;
                     882    882 ; UA
                     883    883 ; UB
                     884    884 ;
e362  cd a8 e1       885    885 UART:	CALL	L1NCR			;A OR B?
e365  7b             886    886 	LD	A,E
e366  fe 0b          887    887 	CP	0BH
e368  20 05          888    888 	JR	NZ,UARTA
e36a  3e 80          889    889 	LD	A,80H
e36c  d3 04          890    890 	OUT	(APARLP),A
e36e  c9             891    891 	RET
                     892    892 ;
e36f  97             893    893 UARTA:	SUB	A
e370  d3 54          894    894 	OUT	(BPARLP),A
e372  c9             895    895 	RET
                     896    896 ;
                     897    897 ;
                     898    898 ; COMMAND
                     899    899 ; READ BINARY INPUT FROM DATA PORT
                     900    900 ;
Z80-Assembler		Release 1.8				Page 16
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e373  cd 52 e1       901    901 READB:	CALL	L2NCR			;GET MEM ADDRS
e376  cd 0e e0       902    902 RB1:	CALL	CHKIN			;GET INPUT
e379  28 fb          903    903 	JR	Z,RB1
e37b  77             904    904 	LD	(HL),A			;TO MEM
e37c  ed a1          905    905 	CPI
e37e  e0             906    906 	RET	PO
e37f  18 f5          907    907 	JR	RB1
                     908    908 ;
                     909    909 ;
                     910    910 ; COMMAND
                     911    911 ; WRITE BINARY OUTPUT TO DATA PORT
                     912    912 
e381  cd 52 e1       913    913 WRITB:	CALL	L2NCR			;GET MEM ADDRS
e384  7e             914    914 WB1:	LD	A,(HL)
e385  cd 1e e0       915    915 	CALL	PBYTE
e388  ed a1          916    916 	CPI
e38a  e0             917    917 	RET	PO
e38b  18 f7          918    918 	JR	WB1
                     919    919 ;
                     920    920 ;
                     921    921 ; COMMAND
                     922    922 ; PRINT NULLS ON THE CURRENT DEVICE.
                     923    923 ;
                     924    924 ; N <NUMBER-OF-NULLS>
                     925    925 ;
e38d  cd a8 e1       926    926 NULLS:	CALL	L1NCR
e390  43             927    927 	LD	B,E
e391  97             928    928 	SUB	A
e392  cd 12 e1       929    929 N2:	CALL	PCHR
e395  10 fb          930    930 	DJNZ	N2
e397  c9             931    931 	RET
                     932    932 ;
                     933    933 ;
                     934    934 ; COMMAND
                     935    935 ; OUT <DATA-BYTE> <PORT NUMBER>
                     936    936 ;
e398  cd ae e1       937    937 OUTP:	CALL	GNHL
e39b  eb             938    938 	EX	DE,HL			;E GETS DATA
e39c  cd a8 e1       939    939 	CALL	L1NCR			;GET PORT NUMBER
                     940    940 ;
e39f  4b             941    941 	LD	C,E			; TO C
e3a0  ed 69          942    942 	OUT	(C),L
e3a2  c9             943    943 	RET
                     944    944 ;
                     945    945 
                     946    946 ; BAUD RATES.
                     947    947 ; WITH THE CROMEMCO TUART:  19200, 9600, 4800,
                     948    948 ; 			2400, 1200, 300, 150, 110.
                     949    949 ;
                     950    950 ; WITH THE 3P+S: 2400, 300, 110.
                     951    951 ;
                     952    952 ;
e3a3  94 ce a2 92    953    953 BAUDRS:	DEFB	94H,0CEH,0A2H,92H,88H,84H,82H,1
e3a7  88 84 82 01    953    954
                     954    955 ;
                     955    956 ;
e3ab  0a 00 80       956    957 LFNN:	DEFB	LF,0,0 | 80H
                     957    958 ;
                     958    959 ;
e3ae  ba             959    960 PRMPT:	DEFB	(':' | 80H)
Z80-Assembler		Release 1.8				Page 17
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
                     960    961 ; THE COMMAND TBL MUST IMMEDIATELY FOLLOW
                     961    962 ;
                     962    963 ;  THE	PROMPT MESSAGE
e3af  8d e2          963    964 	DEFW	DISPL			;DISPLAY: DM, DR
e3b1  e5 e0          964    965 	DEFW	ERROR			;E
e3b3  e5 e0          965    966 	DEFW	ERROR
e3b5  23 e2          966    967 	DEFW	GO			;GO; GO/WITH BREAKPOINTS
e3b7  e5 e0          967    968 	DEFW	ERROR
e3b9  2d e0          968    969 	DEFW	INITBAUD		;INITIALIZE BAUD RATE
e3bb  e5 e0          969    970 	DEFW	ERROR			;J
e3bd  e5 e0          970    971 	DEFW	ERROR			;K
e3bf  e5 e0          971    972 	DEFW	ERROR			;L
e3c1  83 e1          972    973 	DEFW	MOVE			;MOVE A BLOCK OF MEMORY
e3c3  8d e3          973    974 	DEFW	NULLS			;NULLS
e3c5  98 e3          974    975 	DEFW	OUTP			;OUTPUT
e3c7  ec e0          975    976 	DEFW	PROG			;PROGRAM
e3c9  e5 e0          976    977 	DEFW	ERROR			;Q
e3cb  73 e3          977    978 	DEFW	READB			;READ BINARY OR ASCII
e3cd  b0 e2          978    979 	DEFW	SUBST			;SUBSTITUTE: SM, SA, SB.
e3cf  e5 e0          979    980 	DEFW	ERROR			;T
e3d1  62 e3          980    981 	DEFW	UART			;UART: UA, UB
e3d3  66 e1          981    982 	DEFW	VERIF			;VERIFY BLOCKS OF MEMORY
e3d5  81 e3          982    983 	DEFW	WRITB			;WRITE BINARY OR ASCII
                     983    984 ;
0040                 984    985 PM	EQU	1 < PF			;PRIMEABLE-REG MASK
0000                 985    986 B1M	EQU	0			;1-BYTE REG MASK
0020                 986    987 B2M	EQU	1 < B2F			;2-BYTE REG MASK
0080                 987    988 CRM	EQU	1 < CRF			;CARRIAGE-RETURN MASK
                     988    989 
e3d7  43             989    990 RGTBL:	DEFB	-DUAF | PM		;A
e3d8  45             990    991 	DEFB	-DUBC | PM		;B
e3d9  46             991    992 	DEFB	-DUBC+1 | PM		;C
e3da  47             992    993 	DEFB	-DUDE | PM		;D
e3db  48             993    994 	DEFB	-DUDE+1 | PM		;E
e3dc  44             994    995 	DEFB	-DUAF+1 | PM		;F
e3dd  00             995    996 	DEFB	0
e3de  e9             996    997 	DEFB	-DUHL | PM | B2M | CRM	;H [HL]
e3df  11             997    998 	DEFB	-DUIN | B1M		;I
e3e0  00             998    999 	DEFB	0
e3e1  00             999   1000 	DEFB	0
e3e2  00            1000   1001 	DEFB	0
e3e3  00            1001   1002 	DEFB	0
e3e4  12            1002   1003 	DEFB	-DUIN+1 | B1M		;N [INTERRUPT FF]
e3e5  00            1003   1004 	DEFB	0
e3e6  21            1004   1005 	DEFB	-DUPC | B2M		;PC
e3e7  00            1005   1006 	DEFB	0
e3e8  00            1006   1007 	DEFB	0
e3e9  2b            1007   1008 	DEFB	-DUSP | B2M		;SP
e3ea  00            1008   1009 	DEFB	0
e3eb  00            1009   1010 	DEFB	0
e3ec  00            1010   1011 	DEFB	0
e3ed  00            1011   1012 	DEFB	0
e3ee  2d            1012   1013 	DEFB	-DUIX | B2M		;X [IX]
e3ef  af            1013   1014 	DEFB	-DUIY | B2M | CRM 	;Y [IY]
                    1014   1015 ;
                    1015   1016 ;
e3f0  0d 0d 43 52   1016   1017 HEAD:	DEFB	CR,CR, 'CROMEMCO ZM1.',('4' | 80H)
e3f4  4f 4d 45 4d   1016   1018
e3f8  43 4f 20 5a   1016   1019
e3fc  4d 31 2e b4   1016   1020
Z80-Assembler		Release 1.8				Page 18
Source file: z1mon-1.4.asm
Title:       

LOC   OBJECT CODE   LINE   STMT SOURCE CODE
e400                1017   1021 	END	CSTART
Z80-Assembler		Release 1.8				Page 19
Source file: z1mon-1.4.asm
Title:       Symboltable

ABAUDP   0000	ACMNDP   0002	ALT      007d	APARLP   0004	
B1M      0000	B2F      0005	B2M      0020	BAUDRS   e3a3	
BCMNDP   0052	BPARLP   0054	BPMRK    000b	BPSTOR   0016	
CASE     0000	CHKIN    e00e	CL1      e0a4	CL2      e0b3	
CLBP     e0a0	CMND     e0be	CMND1    e0c2	COM1     e051	
COM3     e082	COM4     e08b	COMMON   e04a	CR       000d	
CRF      0007	CRLF     e14d	CRM      0080	CSTART   e000	
DATA     0001	DAV      0040	DISPL    e28d	DM2      e29a	
DSPM     e292	DSPM1    e295	DUAF     fffd	DUAF2    ffed	
DUBC     fffb	DUBC2    ffeb	DUDE     fff9	DUDE2    ffe9	
DUHL     fff7	DUHL2    ffe7	DUIN     ffef	DUIX     fff3	
DUIY     fff1	DUPC     ffff	DUSP     fff5	ERROR    e0e5	
ERRV1    e0f5	ESC      001b	ESCPE    e0ea	GBYTE    e016	
GCHR     e144	GN1      e1bb	GNHL     e1ae	GNHL0    e1ad	
GO       e223	GO1      e226	GO3      e23c	GO5      e25f	
GS1      e33d	GS2      e34b	GS3      e35c	GSUBV    e332	
HEAD     e3f0	HEXSH    e1c6	HX1      e1d4	HXSH4    e1d6	
INIT     e029	INITBAUD e02d	IT1      e034	L1NCR    e1a8	
L2N1     e19b	L2N2     e1a2	L2NCR    e152	L2NCR0   e151	
L3NCR    e1a5	LD2N     e18b	LENRGS   001a	LF       000a	
LFNN     e3ab	MOVE     e183	MVE      e21a	N2       e392	
NBRKPT   0005	NULLS    e38d	OUTP     e398	P1HEX    e1fb	
P2HEX    e1f7	P2NMS    e108	PADDR    e15f	PBY1     e01f	
PBYTE    e01e	PC1      e113	PC2      e122	PC3      e141	
PCADDR   e15c	PCHR     e112	PF       0006	PH1      e208	
PM       0040	PMSG     e20f	PNHL     e1f2	PNM      e1ec	
PR1      e0fb	PRMPT    e3ae	PROG     e0ec	PS1      e210	
PSNHL    e1ef	PSNM     e1e9	RB1      e376	READB    e373	
RETN     e265	RGTBL    e3d7	RSTLC    0030	RT1      e273	
RT2      e27e	RT3      e288	SK1      e1df	SKSG     e1de	
SKSG0    e1dd	SKSGCR   e155	SM1      e2b8	SPACE    e110	
SR2      e2d2	SR3      e2d5	SR4      e2f7	SR5      e30f	
SR6      e31e	SR8      e32d	STAT     0000	SUBM     e2b2	
SUBR     e2c8	SUBR2    e2d1	SUBR3    e323	SUBST    e2b0	
SVMS     e045	TBE      0080	TEMPS    0016	UART     e362	
UARTA    e36f	VERIF    e166	VRFY     e169	WB1      e384	
WRITB    e381	WSTART   e008	