summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-02 11:16:31 +0200
committerLeo C2016-08-02 11:16:31 +0200
commit0c4244e5b6acd0ddc6d50bd7e8eb5f19001f772b (patch)
tree760dda672445fc290b3d0eac6192f42065863117
downloadddt180-0c4244e5b6acd0ddc6d50bd7e8eb5f19001f772b.zip
Initial commit
-rw-r--r--ddtz.z805846
-rw-r--r--doc/ddtz-de.txt1141
-rw-r--r--doc/ddtz-help.txt121
-rw-r--r--doc/ddtz-ref-short.txt150
-rw-r--r--doc/ddtz-ref.txt204
5 files changed, 7462 insertions, 0 deletions
diff --git a/ddtz.z80 b/ddtz.z80
new file mode 100644
index 0000000..6862413
--- /dev/null
+++ b/ddtz.z80
@@ -0,0 +1,5846 @@
+; Disassembled ddtz.com, version "DDT/Z [8101]"
+;
+; Assemble with M80 or a compatible assembler
+; to (re)create the original .com file.
+
+;-------------------------------------------------------------------------------
+; Relocation loader
+;
+ ASEG
+ ORG 00100H
+
+ LD SP,ldr_end+stack
+ LD C,BDOS_PSTR
+ LD DE,ldr_end+expr_buf
+ CALL BDOS
+ LD HL,bitmap
+ EXX
+ LD HL,(BDOS+1)
+ LD (ldr_end+1),HL
+ LD BC,ddtz_size-1
+ LD D,B
+ LD E,0FFH
+ INC DE
+ INC BC
+ PUSH BC
+ OR A
+ SBC HL,DE
+ LD (BDOS+1),HL
+ EX DE,HL
+ LD HL,ldr_end-1
+A0128: INC HL
+ LD A,L
+ AND 007H
+ JR NZ,A0133
+ EXX
+ LD A,(HL)
+ INC HL
+ EXX
+ EX AF,AF'
+A0133: EX AF,AF'
+ ADD A,A
+ JR NC,A0141
+ EX AF,AF'
+ DEC HL
+ LD A,(HL)
+ ADD A,E
+ LD (HL),A
+ INC HL
+ LD A,(HL)
+ ADC A,D
+ LD (HL),A
+ EX AF,AF'
+A0141: EX AF,AF'
+ DEC BC
+ LD A,B
+ OR C
+ JR NZ,A0128
+ POP BC
+ EX DE,HL
+ ADD HL,BC
+ EX DE,HL
+ DEC DE
+ LDDR
+ LD HL,conbuf+2
+ ADD HL,DE
+ JP (HL)
+
+ rept (($+7) and 0FFF8H) - $
+ DEFB 000H
+ endm
+
+ldr_end:
+
+ .phase 0
+;-------------------------------------------------------------------------------
+; DDT/Z core
+;
+
+; Some greneral definitions
+
+TAB equ 9
+LF equ 10
+CR equ 13
+
+; CP/M memory layout
+
+BDOS equ 5
+FCB equ 05ch
+FCB2 equ 06ch
+DMA_BUF equ 080h
+TPA equ 0100h
+
+; BDOS function calls
+
+BDOS_CIN equ 1 ;Console Input
+BDOS_COUT equ 2 ;Console Output
+BDOS_PSTR equ 9 ;Print String
+BDOS_CBUF equ 10 ;Read Console Buffer
+BDOS_CSTAT equ 11 ;Get Console Status
+BDOS_OPEN equ 15 ;Open File
+BDOS_CLOSE equ 16 ;Close File
+BDOS_DELETE equ 19 ;Delete File
+BDOS_READ equ 20 ;Read Sequential
+BDOS_WRITE equ 21 ;Write Sequential
+BDOS_CREATE equ 22 ;Make File
+BDOS_SETDMA equ 26 ;Set DMA Address
+
+; ddtz specific definitions
+
+STACK_SIZE equ 64 ;ddtz internal stack
+CONBUF_SIZE equ 80 ;Size of console input buffer
+EXPR_BUF_SIZE equ 128 ;expressen buffer for conditional breakpoints
+BP_CNT equ 12 ;Number of breakpoints
+BP_SIZE equ 8 ;Size of a breakpoint record
+YREG_CNT equ 10 ;Number of Y registers (0..9)
+
+;-------------------------------------------------------------------------------
+
+ddtz_base:
+ jp 0 ;0000 c3 00 00 . . .
+l0003h:
+ rst 30h ;0003 f7 .
+sub_0004h:
+ nop ;0004 00 .
+ ret ;0005 c9 .
+
+ ds STACK_SIZE
+
+stack:
+reg.l2: db 000h ;0046 00 .
+reg.h2: db 000h ;0047 00 .
+reg.e2: db 000h ;0048 00 .
+reg.d2: db 000h ;0049 00 .
+reg.c2: db 000h ;004a 00 .
+reg.b2: db 000h ;004b 00 .
+reg.f2: db 000h ;004c 00 .
+reg.a2: db 000h ;004d 00 .
+l004eh: db 000h ;004e 00 .
+reg.i: db 000h ;004f 00 .
+reg.iy: dw 0000h ;0050 00 .
+reg.ix: dw 0000h ;0052 00 .
+reg.f: db 000h ;0054 00 .
+reg.a: db 000h ;0055 00 .
+reg.c: db 000h ;0056 00 .
+reg.b: db 000h ;0057 00 .
+reg.e: db 000h ;0058 00 .
+reg.d: db 000h ;0059 00 .
+reg.l: db 000h ;005a 00 .
+reg.h: db 000h ;005b 00 .
+reg_sp: dw TPA ;005c 00 01 .
+reg.iff:
+ db 0f3h ;005e f3 .
+ db 0c3h ;005f c3 .
+REG.PC: dw TPA ;0060 00 01 .
+l0062h: dw 0000h ;0062 00 00 .
+offs.@: dw 0 ;0064 00 00 .
+
+CMD_ERR:dw l0146h ;0066 46 01 F .
+cmd_rpt:dw mainloop ;0068 bd 00 . .
+
+conbuf:
+ db CONBUF_SIZE ;006a 50 P
+
+ ld sp,stack ;006b 31 46 00 1 F .
+ exx ;006e d9 .
+ ld de,ddtz_base ;006f 11 00 00 . . .
+ or a ;0072 b7 .
+ sbc hl,de ;0073 ed 52 . R
+ add hl,de ;0075 19 .
+ jr c,l0079h ;0076 38 01 8 .
+ ex de,hl ;0078 eb .
+l0079h:
+ ld de,TPA ;0079 11 00 01 . . .
+l007ch:
+ dec hl ;007c 2b +
+ ld (hl),000h ;007d 36 00 6 .
+ ld a,h ;007f 7c |
+ sub d ;0080 92 .
+ ld b,a ;0081 47 G
+ ld a,l ;0082 7d }
+ sub e ;0083 93 .
+ or b ;0084 b0 .
+ jr nz,l007ch ;0085 20 f5 .
+ ld a,i ;0087 ed 57 . W
+ ld (reg.i),a ;0089 32 4f 00 2 O .
+ ld a,0f3h ;008c 3e f3 > .
+ jp po,l0093h ;008e e2 93 00 . . .
+ ld a,0fbh ;0091 3e fb > .
+l0093h:
+ ld (reg.iff),a ;0093 32 5e 00 2 ^ .
+ call sub_0004h ;0096 cd 04 00 . . .
+ ld hl,ddtz_base ;0099 21 00 00 ! . .
+ ld l,000h ;009c 2e 00 . .
+ ld (reg_sp),hl ;009e 22 5c 00 " \ .
+ ld a,(FCB+1) ;00a1 3a 5d 00 : ] .
+ cp ' ' ;00a4 fe 20 .
+ ld hl,0 ;00a6 21 00 00 ! . .
+ call nz,read_file ;00a9 c4 68 10 . h .
+ jr mainloop ;00ac 18 0f . .
+
+ ds CONBUF_SIZE + 3 - ($ - conbuf)
+
+mainloop:
+ ld sp,stack ;00bd 31 46 00 1 F .
+ ld hl,l0146h ;00c0 21 46 01 ! F .
+ ld (CMD_ERR),hl ;00c3 22 66 00 " f .
+ ld hl,(REG.PC) ;00c6 2a 60 00 * ` .
+ ld (l0062h),hl ;00c9 22 62 00 " b .
+ call bp_clr_temporary ;00cc cd 54 07 . T .
+ ld hl,(cmd_rpt) ;00cf 2a 68 00 * h .
+ ld de,mainloop ;00d2 11 bd 00 . . .
+ call cp_hl_de ;00d5 cd ee 02 . . .
+ ld a,'>' ;00d8 3e 3e > >
+ call outchar ;00da cd 5d 02 . ] .
+ call nz,outchar ;00dd c4 5d 02 . ] .
+ call z,outbl ;00e0 cc 9f 02 . . .
+ call get_line ;00e3 cd 4e 01 . N .
+ call skipbl ;00e6 cd bf 02 . . .
+ jr z,exe_hl ;00e9 28 1f ( .
+ ld hl,mainloop ;00eb 21 bd 00 ! . .
+ ld (cmd_rpt),hl ;00ee 22 68 00 " h .
+ inc de ;00f1 13 .
+ sub '@' ;00f2 d6 40 . @
+ jr c,ERROR ;00f4 38 11 8 .
+ cp 'Z'+1-'@' ;00f6 fe 1b . .
+ jr nc,ERROR ;00f8 30 0d 0 .
+ add a,a ;00fa 87 .
+ ld hl,CMDTAB ;00fb 21 10 01 ! . .
+ call add_hl_a ;00fe cd b9 02 . . .
+ ld a,(hl) ;0101 7e ~
+ inc hl ;0102 23 #
+ ld h,(hl) ;0103 66 f
+ ld l,a ;0104 6f o
+ jr exe_hl ;0105 18 03 . .
+ERROR:
+ ld hl,(CMD_ERR) ;0107 2a 66 00 * f .
+exe_hl:
+ call CALL_HL ;010a cd 0f 01 . . .
+ jr mainloop ;010d 18 ae . .
+CALL_HL:
+ jp (hl) ;010f e9 .
+
+CMDTAB:
+ defw cmd_@ ;0110 92 0d . .
+ defw cmd_A ;0112 fe 11 . .
+ defw cmd_B ;0114 6d 07 m .
+ defw cmd_C ;0116 17 21 . !
+ defw cmd_D ;0118 48 0f H .
+ defw ERROR ;011a 07 01 . .
+ defw cmd_F ;011c af 0f . .
+ defw cmd_G ;011e 31 07 1 .
+ defw cmd_H ;0120 3d 0e = .
+ defw cmd_I ;0122 a3 0d . .
+ defw ERROR ;0124 07 01 . .
+ defw ERROR ;0126 07 01 . .
+ defw cmd_L ;0128 cd 18 . .
+ defw cmd_M ;012a 19 0e . .
+ defw ERROR ;012c 07 01 . .
+ defw cmd_O ;012e c7 0d . .
+ defw ERROR ;0130 07 01 . .
+ defw cmd_Q ;0132 84 0e . .
+ defw cmd_R ;0134 62 10 b .
+ defw cmd_S ;0136 5a 0d Z .
+ defw cmd_T ;0138 1e 21 . !
+ defw ERROR ;013a 07 01 . .
+ defw cmd_V ;013c ea 0d . .
+ defw cmd_W ;013e a0 11 . .
+ defw cmd_X ;0140 f1 0b . .
+ defw cmd_Y ;0142 b2 0b . .
+ defw cmd_Z ;0144 ba 0e . .
+
+l0146h:
+ ld a,'?' ;0146 3e 3f > ?
+ call outchar ;0148 cd 5d 02 . ] .
+ jp crlf ;014b c3 a3 02 . . .
+get_line:
+ push hl ;014e e5 .
+ ld de,conbuf ;014f 11 6a 00 . j .
+ ld c,BDOS_CBUF ;0152 0e 0a . .
+ call ddtz_base ;0154 cd 00 00 . . .
+ call crlf ;0157 cd a3 02 . . .
+ ld de,conbuf+1 ;015a 11 6b 00 . k .
+ ld a,(de) ;015d 1a .
+ ld b,a ;015e 47 G
+ ld c,000h ;015f 0e 00 . .
+ inc b ;0161 04 .
+l0162h:
+ inc de ;0162 13 .
+ dec b ;0163 05 .
+ jr z,l0194h ;0164 28 2e ( .
+ ld a,(de) ;0166 1a .
+ bit 0,c ;0167 cb 41 . A
+ call z,toupper ;0169 cc 9b 01 . . .
+ ld (de),a ;016c 12 .
+ cp '''' ;016d fe 27 . '
+ jr nz,l0162h ;016f 20 f1 .
+ push de ;0171 d5 .
+ dec de ;0172 1b .
+ ld a,(de) ;0173 1a .
+ cp '''' ;0174 fe 27 . '
+ jr z,l0190h ;0176 28 18 ( .
+ dec de ;0178 1b .
+ ld a,(de) ;0179 1a .
+ cp '^' ;017a fe 5e . ^
+ jr z,l0184h ;017c 28 06 ( .
+ dec de ;017e 1b .
+ ld a,(de) ;017f 1a .
+ cp '^' ;0180 fe 5e . ^
+ jr nz,l0190h ;0182 20 0c .
+l0184h:
+ inc de ;0184 13 .
+ push bc ;0185 c5 .
+ call sub_0303h ;0186 cd 03 03 . . .
+ pop bc ;0189 c1 .
+ dec de ;018a 1b .
+ ld a,(de) ;018b 1a .
+ cp '''' ;018c fe 27 . '
+ jr z,l0191h ;018e 28 01 ( .
+l0190h:
+ inc c ;0190 0c .
+l0191h:
+ pop de ;0191 d1 .
+ jr l0162h ;0192 18 ce . .
+l0194h:
+ xor a ;0194 af .
+ ld (de),a ;0195 12 .
+ ld de,conbuf+2 ;0196 11 6c 00 . l .
+ pop hl ;0199 e1 .
+ ret ;019a c9 .
+
+toupper:
+ cp 'a' ;019b fe 61 . a
+ ret c ;019d d8 .
+ cp 'z'+1 ;019e fe 7b . {
+ ret nc ;01a0 d0 .
+ and 05fh ;01a1 e6 5f . _
+ ret ;01a3 c9 .
+
+out.hl.@:
+ call out_hl ;01a4 cd 13 02 . . .
+ push de ;01a7 d5 .
+ push hl ;01a8 e5 .
+ ld de,(offs.@) ;01a9 ed 5b 64 00 . [ d .
+ ld a,d ;01ad 7a z
+ or e ;01ae b3 .
+ jr z,l01bfh ;01af 28 0e ( .
+ call outbl ;01b1 cd 9f 02 . . .
+ ld a,'@' ;01b4 3e 40 > @
+ call outchar ;01b6 cd 5d 02 . ] .
+ and a ;01b9 a7 .
+ sbc hl,de ;01ba ed 52 . R
+ call out_hl ;01bc cd 13 02 . . .
+l01bfh:
+ pop hl ;01bf e1 .
+ pop de ;01c0 d1 .
+ ret ;01c1 c9 .
+out.bin.w:
+ ld a,h ;01c2 7c |
+ call out.bin.b ;01c3 cd c7 01 . . .
+ ld a,l ;01c6 7d }
+out.bin.b:
+ ld b,8 ;01c7 06 08 . .
+l01c9h:
+ add a,a ;01c9 87 .
+ push af ;01ca f5 .
+ ld a,00 ;01cb 3e 00 > .
+ adc a,a ;01cd 8f .
+ call out_dgt ;01ce cd 21 02 . ! .
+ pop af ;01d1 f1 .
+ djnz l01c9h ;01d2 10 f5 . .
+ ld a,'"' ;01d4 3e 22 > "
+ jp outchar ;01d6 c3 5d 02 . ] .
+
+sub_01d9h:
+ ld a,'-' ;01d9 3e 2d > -
+ call outchar ;01db cd 5d 02 . ] .
+ dec hl ;01de 2b +
+ jp cpl.hl ;01df c3 79 05 . y .
+
+out_hl_dec_neg:
+ push hl ;01e2 e5 .
+ call sub_01d9h ;01e3 cd d9 01 . . .
+ defb 03eh ;01e6 3e >
+out.hl.dec:
+ push hl ;01e7 e5 .
+ ld b,006h ;01e8 06 06 . .
+ call sub_01f9h ;01ea cd f9 01 . . .
+ pop hl ;01ed e1 .
+ ld a,'.' ;01ee 3e 2e > .
+ call outchar ;01f0 cd 5d 02 . ] .
+l01f3h:
+ call outbl ;01f3 cd 9f 02 . . .
+ djnz l01f3h ;01f6 10 fb . .
+ ret ;01f8 c9 .
+sub_01f9h:
+ dec b ;01f9 05 .
+ push de ;01fa d5 .
+ ld de,10 ;01fb 11 0a 00 . . .
+ call div_hl_de ;01fe cd 75 04 . u .
+ ld a,h ;0201 7c |
+ or l ;0202 b5 .
+ call nz,sub_01f9h ;0203 c4 f9 01 . . .
+ ld a,e ;0206 7b {
+ pop de ;0207 d1 .
+ jr out_dgt ;0208 18 17 . .
+
+out_hl_neg:
+ push hl ;020a e5 .
+ call sub_01d9h ;020b cd d9 01 . . .
+ call out_hl ;020e cd 13 02 . . .
+ pop hl ;0211 e1 .
+ ret ;0212 c9 .
+
+out_hl:
+ ld a,h ;0213 7c |
+ call out_hex ;0214 cd 18 02 . . .
+ ld a,l ;0217 7d }
+
+out_hex:
+ push af ;0218 f5 .
+ rra ;0219 1f .
+ rra ;021a 1f .
+ rra ;021b 1f .
+ rra ;021c 1f .
+ call out_dgt ;021d cd 21 02 . ! .
+ pop af ;0220 f1 .
+
+out_dgt:
+ and 0fh ;0221 e6 0f . .
+ cp 10 ;0223 fe 0a . .
+ jr c,l0229h ;0225 38 02 8 .
+ add a,007h ;0227 c6 07 . .
+l0229h:
+ add a,'0' ;0229 c6 30 . 0
+ jr outchar ;022b 18 30 . 0
+l022dh:
+ ld a,'-' ;022d 3e 2d > -
+ call outchar ;022f cd 5d 02 . ] .
+ ld a,040h ;0232 3e 40 > @
+out.ascii:
+ ex af,af' ;0234 08 .
+ call outquote ;0235 cd 5b 02 . [ .
+ ex af,af' ;0238 08 .
+ push af ;0239 f5 .
+ res 7,a ;023a cb bf . .
+ cp ' ' ;023c fe 20 .
+ jr nc,l0242h ;023e 30 02 0 .
+ sub 0c0h ;0240 d6 c0 . .
+l0242h:
+ call outchar ;0242 cd 5d 02 . ] .
+ push af ;0245 f5 .
+ cp '''' ;0246 fe 27 . '
+ call z,outchar ;0248 cc 5d 02 . ] .
+ pop af ;024b f1 .
+ ex af,af' ;024c 08 .
+ call outquote ;024d cd 5b 02 . [ .
+ pop af ;0250 f1 .
+ or a ;0251 b7 .
+ ld a,'.' ;0252 3e 2e > .
+ call m,outchar ;0254 fc 5d 02 . ] .
+ ex af,af' ;0257 08 .
+ jr c,l022dh ;0258 38 d3 8 .
+ ret ;025a c9 .
+outquote:
+ ld a,'''' ;025b 3e 27 > '
+outchar:
+ push hl ;025d e5 .
+ push de ;025e d5 .
+ push bc ;025f c5 .
+ push af ;0260 f5 .
+ and 07fh ;0261 e6 7f . 
+ ld e,a ;0263 5f _
+ ld c,BDOS_COUT ;0264 0e 02 . .
+ call ddtz_base ;0266 cd 00 00 . . .
+ ld hl,con_col ;0269 21 72 02 ! r .
+ inc (hl) ;026c 34 4
+ pop af ;026d f1 .
+ pop bc ;026e c1 .
+ pop de ;026f d1 .
+ pop hl ;0270 e1 .
+ ret ;0271 c9 .
+con_col:
+ db 0 ;0272 00 .
+inchar:
+ push hl ;0273 e5 .
+ push de ;0274 d5 .
+ push bc ;0275 c5 .
+ ld c,BDOS_CSTAT ;0276 0e 0b . .
+ call ddtz_base ;0278 cd 00 00 . . .
+ and a ;027b a7 .
+ jr z,l0284h ;027c 28 06 ( .
+ ld c,BDOS_CIN ;027e 0e 01 . .
+ call ddtz_base ;0280 cd 00 00 . . .
+ scf ;0283 37 7
+l0284h:
+ pop bc ;0284 c1 .
+ pop de ;0285 d1 .
+ pop hl ;0286 e1 .
+ ret ;0287 c9 .
+pstr:
+ ld c,000h ;0288 0e 00 . .
+l028ah:
+ ld a,(hl) ;028a 7e ~
+ and a ;028b a7 .
+ ret z ;028c c8 .
+ call outchar ;028d cd 5d 02 . ] .
+ inc c ;0290 0c .
+ inc hl ;0291 23 #
+ and a ;0292 a7 .
+ ret m ;0293 f8 .
+ jr l028ah ;0294 18 f4 . .
+
+outbl6:
+ call outbl2 ;0296 cd 9c 02 . . .
+outbl4:
+ call outbl2 ;0299 cd 9c 02 . . .
+outbl2:
+ call outbl ;029c cd 9f 02 . . .
+outbl:
+ ld a,' ' ;029f 3e 20 >
+ jr outchar ;02a1 18 ba . .
+crlf:
+ call inchar ;02a3 cd 73 02 . s .
+ ld a,CR ;02a6 3e 0d > .
+ call outchar ;02a8 cd 5d 02 . ] .
+ ld a,LF ;02ab 3e 0a > .
+ call outchar ;02ad cd 5d 02 . ] .
+ ld a,0 ;02b0 3e 00 > .
+ ld (con_col),a ;02b2 32 72 02 2 r .
+ jp c,mainloop ;02b5 da bd 00 . . .
+ ret ;02b8 c9 .
+add_hl_a:
+ add a,l ;02b9 85 .
+ ld l,a ;02ba 6f o
+ ret nc ;02bb d0 .
+ inc h ;02bc 24 $
+ ret ;02bd c9 .
+
+skipbl0:
+ inc de ;02be 13 .
+skipbl:
+ ld a,(de) ;02bf 1a .
+ cp ' ' ;02c0 fe 20 .
+ jr z,skipbl0 ;02c2 28 fa ( .
+ cp TAB ;02c4 fe 09 . .
+ jr z,skipbl0 ;02c6 28 f6 ( .
+ or a ;02c8 b7 .
+ ret ;02c9 c9 .
+
+next_arg:
+ call skipbl ;02ca cd bf 02 . . .
+ cp ',' ;02cd fe 2c . ,
+ ret nz ;02cf c0 .
+ inc de ;02d0 13 .
+ call skipbl ;02d1 cd bf 02 . . .
+ cp a ;02d4 bf .
+ ret ;02d5 c9 .
+
+assert_eol:
+ call skipbl ;02d6 cd bf 02 . . .
+ ret z ;02d9 c8 .
+to_error:
+ jp ERROR ;02da c3 07 01 . . .
+
+chk_sp:
+ push hl ;02dd e5 .
+ push de ;02de d5 .
+ ld hl,0 ;02df 21 00 00 ! . .
+ add hl,sp ;02e2 39 9
+ ld de,stack-40 ;02e3 11 1e 00 . . .
+ call cp_hl_de ;02e6 cd ee 02 . . .
+ pop de ;02e9 d1 .
+ pop hl ;02ea e1 .
+ jr c,to_error ;02eb 38 ed 8 .
+ ret ;02ed c9 .
+
+cp_hl_de:
+ and a ;02ee a7 .
+ sbc hl,de ;02ef ed 52 . R
+ add hl,de ;02f1 19 .
+ ret ;02f2 c9 .
+
+lookupch:
+ ld b,0 ;02f3 06 00 . .
+l02f5h:
+ ld a,(hl) ;02f5 7e ~
+ and a ;02f6 a7 .
+ ret z ;02f7 c8 .
+ ld a,(de) ;02f8 1a .
+ cp (hl) ;02f9 be .
+ jr z,l0300h ;02fa 28 04 ( .
+ inc hl ;02fc 23 #
+ inc b ;02fd 04 .
+ jr l02f5h ;02fe 18 f5 . .
+l0300h:
+ scf ;0300 37 7
+ inc de ;0301 13 .
+ ret ;0302 c9 .
+
+sub_0303h:
+ ld hl,b_0cc3_start ;0303 21 c3 0c ! . .
+ ld b,07fh ;0306 06 7f .
+ jr l030ch ;0308 18 02 . .
+sub_030ah:
+ ld b,0ffh ;030a 06 ff . .
+l030ch:
+ inc b ;030c 04 .
+ ld a,(hl) ;030d 7e ~
+ and a ;030e a7 .
+ ret z ;030f c8 .
+ call sub_031ch ;0310 cd 1c 03 . . .
+ jr nc,l030ch ;0313 30 f7 0 .
+ res 7,b ;0315 cb b8 . .
+ ret ;0317 c9 .
+
+sub_0318h:
+ push bc ;0318 c5 .
+ res 7,b ;0319 cb b8 . .
+ defb 03eh ;031b 3e >
+sub_031ch:
+ push bc ;031c c5 .
+ push de ;031d d5 .
+l031eh:
+ ld a,(de) ;031e 1a .
+ xor (hl) ;031f ae .
+ and 07fh ;0320 e6 7f .
+ jr nz,l0336h ;0322 20 12 .
+ bit 7,(hl) ;0324 cb 7e . ~
+ inc hl ;0326 23 #
+ inc de ;0327 13 .
+ jr z,l031eh ;0328 28 f4 ( .
+ scf ;032a 37 7
+ bit 7,b ;032b cb 78 . x
+ call z,sub_060ch ;032d cc 0c 06 . . .
+ jr nc,l0339h ;0330 30 07 0 .
+ pop af ;0332 f1 .
+ scf ;0333 37 7
+ pop bc ;0334 c1 .
+ ret ;0335 c9 .
+l0336h:
+ call sub_0345h ;0336 cd 45 03 . E .
+l0339h:
+ pop de ;0339 d1 .
+ and a ;033a a7 .
+ pop bc ;033b c1 .
+ ret ;033c c9 .
+sub_033dh:
+ inc b ;033d 04 .
+l033eh:
+ dec b ;033e 05 .
+ ret z ;033f c8 .
+ call sub_0345h ;0340 cd 45 03 . E .
+ jr l033eh ;0343 18 f9 . .
+sub_0345h:
+ ld a,(hl) ;0345 7e ~
+ and a ;0346 a7 .
+ ret z ;0347 c8 .
+l0348h:
+ ld a,(hl) ;0348 7e ~
+ inc hl ;0349 23 #
+ and a ;034a a7 .
+ ret m ;034b f8 .
+ jr l0348h ;034c 18 fa . .
+sub_034eh:
+ call get_arg_range ;034e cd 7d 03 . } .
+ push hl ;0351 e5 .
+ push bc ;0352 c5 .
+ call next_arg ;0353 cd ca 02 . . .
+ call sub_0363h ;0356 cd 63 03 . c .
+ ex de,hl ;0359 eb .
+ pop bc ;035a c1 .
+ pop hl ;035b e1 .
+ ret ;035c c9 .
+
+sub_035dh:
+ call expr ;035d cd be 03 . . .
+ jr c,error0 ;0360 38 33 8 3
+ ret ;0362 c9 .
+
+sub_0363h:
+ call sub_035dh ;0363 cd 5d 03 . ] .
+l0366h:
+ jp assert_eol ;0366 c3 d6 02 . . .
+
+get_lastarg_def:
+ call get_arg_def ;0369 cd 6e 03 . n .
+ jr l0366h ;036c 18 f8 . .
+get_arg_def:
+ push hl ;036e e5 .
+ call expr ;036f cd be 03 . . .
+ jr c,l0375h ;0372 38 01 8 .
+ ex (sp),hl ;0374 e3 .
+l0375h:
+ pop hl ;0375 e1 .
+ ret ;0376 c9 .
+sub_0377h:
+ call b_037c_start ;0377 cd 7c 03 . | .
+ jr l0366h ;037a 18 ea . .
+
+b_037c_start:
+ defb 0e6h ;037c e6 .
+get_arg_range:
+ scf ;037d 37 7
+ ex af,af' ;037e 08 .
+ push bc ;037f c5 .
+ push hl ;0380 e5 .
+ call expr ;0381 cd be 03 . . .
+ jr nc,l038ch ;0384 30 06 0 .
+ ex af,af' ;0386 08 .
+ jr c,error0 ;0387 38 0c 8 .
+ ex af,af' ;0389 08 .
+ pop hl ;038a e1 .
+ defb 03eh ;038b 3e >
+l038ch:
+ pop af ;038c f1 .
+ call sub_039ah ;038d cd 9a 03 . . .
+ jr nc,l0398h ;0390 30 06 0 .
+ ex af,af' ;0392 08 .
+ pop bc ;0393 c1 .
+ ret nc ;0394 d0 .
+error0:
+ jp ERROR ;0395 c3 07 01 . . .
+l0398h:
+ pop af ;0398 f1 .
+ ret ;0399 c9 .
+
+sub_039ah:
+ call next_arg ;039a cd ca 02 . . .
+ cp 'S' ;039d fe 53 . S
+ jr nz,l03a2h ;039f 20 01 .
+ inc de ;03a1 13 .
+l03a2h:
+ push hl ;03a2 e5 .
+ push af ;03a3 f5 .
+ call expr ;03a4 cd be 03 . . .
+ jr c,l03b8h ;03a7 38 0f 8 .
+ ld b,h ;03a9 44 D
+ ld c,l ;03aa 4d M
+ pop af ;03ab f1 .
+ pop hl ;03ac e1 .
+ jr z,l03b6h ;03ad 28 07 ( .
+ ld a,c ;03af 79 y
+ sub l ;03b0 95 .
+ ld c,a ;03b1 4f O
+ ld a,b ;03b2 78 x
+ sbc a,h ;03b3 9c .
+ ld b,a ;03b4 47 G
+ inc bc ;03b5 03 .
+l03b6h:
+ and a ;03b6 a7 .
+ ret ;03b7 c9 .
+l03b8h:
+ pop af ;03b8 f1 .
+ pop hl ;03b9 e1 .
+ jr z,error0 ;03ba 28 d9 ( .
+ scf ;03bc 37 7
+ ret ;03bd c9 .
+
+expr:
+ call skipbl ;03be cd bf 02 . . .
+expr1:
+ call do_subexpr ;03c1 cd 2f 04 . / .
+ ret c ;03c4 d8 .
+ call do_rel_op ;03c5 cd ef 03 . . .
+ ret nc ;03c8 d0 .
+ push bc ;03c9 c5 .
+ push hl ;03ca e5 .
+ call do_subexpr ;03cb cd 2f 04 . / .
+ jr c,error0 ;03ce 38 c5 8 .
+ ex de,hl ;03d0 eb .
+ ex (sp),hl ;03d1 e3 .
+ and a ;03d2 a7 .
+ sbc hl,de ;03d3 ed 52 . R
+ ld hl,0ffffh ;03d5 21 ff ff ! . .
+ pop de ;03d8 d1 .
+ ret ;03d9 c9 .
+
+do_op_eq:
+ jr z,l03edh ;03da 28 11 ( .
+ jr l03ech ;03dc 18 0e . .
+do_op_ne:
+ jr nz,l03edh ;03de 20 0d .
+ jr l03ech ;03e0 18 0a . .
+do_op_le:
+ jr z,l03edh ;03e2 28 09 ( .
+do_op_lt:
+ jr c,l03edh ;03e4 38 07 8 .
+ jr l03ech ;03e6 18 04 . .
+do_op_gt:
+ jr z,l03ech ;03e8 28 02 ( .
+do_op_ge:
+ jr nc,l03edh ;03ea 30 01 0 .
+l03ech:
+ inc hl ;03ec 23 #
+l03edh:
+ and a ;03ed a7 .
+ ret ;03ee c9 .
+do_rel_op:
+ push hl ;03ef e5 .
+ ld hl,tab_eq_le_ge ;03f0 21 1f 04 ! . .
+ call lookupch ;03f3 cd f3 02 . . .
+ jr nc,l041dh ;03f6 30 25 0 %
+ ld a,b ;03f8 78 x
+ or a ;03f9 b7 .
+ jr z,l0411h ;03fa 28 15 ( .
+ ld a,(de) ;03fc 1a .
+ cp '=' ;03fd fe 3d . =
+ jr nz,l0406h ;03ff 20 05 .
+ inc de ;0401 13 .
+ inc b ;0402 04 .
+ inc b ;0403 04 .
+ jr l0411h ;0404 18 0b . .
+l0406h:
+ bit 0,b ;0406 cb 40 . @
+ jr z,l0411h ;0408 28 07 ( .
+ cp '>' ;040a fe 3e . >
+ jr nz,l0411h ;040c 20 03 .
+ inc de ;040e 13 .
+ ld b,005h ;040f 06 05 . .
+l0411h:
+ ld hl,tab_func_eqlege ;0411 21 23 04 ! # .
+ ld a,b ;0414 78 x
+ add a,a ;0415 87 .
+ call add_hl_a ;0416 cd b9 02 . . .
+ ld c,(hl) ;0419 4e N
+ inc hl ;041a 23 #
+ ld b,(hl) ;041b 46 F
+ scf ;041c 37 7
+l041dh:
+ pop hl ;041d e1 .
+ ret ;041e c9 .
+
+tab_eq_le_ge:
+ db '=<>',0
+
+tab_func_eqlege:
+ defw do_op_eq ;0423 da 03 . .
+ defw do_op_lt ;0425 e4 03 . .
+ defw do_op_gt ;0427 e8 03 . .
+ defw do_op_le ;0429 e2 03 . .
+ defw do_op_ge ;042b ea 03 . .
+ defw do_op_ne ;042d de 03 . .
+
+do_subexpr:
+ call do_factor ;042f cd e4 04 . . .
+ ret c ;0432 d8 .
+l0433h:
+ call do_binary_op ;0433 cd ae 04 . . .
+ push hl ;0436 e5 .
+ push bc ;0437 c5 .
+ call do_factor ;0438 cd e4 04 . . .
+ pop bc ;043b c1 .
+ ex de,hl ;043c eb .
+ ex (sp),hl ;043d e3 .
+ jr nc,l0447h ;043e 30 07 0 .
+ pop de ;0440 d1 .
+ ld a,b ;0441 78 x
+ or c ;0442 b1 .
+ ret z ;0443 c8 .
+ jp ERROR ;0444 c3 07 01 . . .
+
+l0447h:
+ ld a,b ;0447 78 x
+ or c ;0448 b1 .
+ push bc ;0449 c5 .
+ ret nz ;044a c0 .
+ pop bc ;044b c1 .
+
+doop_add:
+ add hl,de ;044c 19 .
+l044dh:
+ pop de ;044d d1 .
+ jr l0433h ;044e 18 e3 . .
+
+doop_sub:
+ and a ;0450 a7 .
+ sbc hl,de ;0451 ed 52 . R
+ jr l044dh ;0453 18 f8 . .
+
+doop_mlt:
+ push bc ;0455 c5 .
+ ld b,h ;0456 44 D
+ ld c,l ;0457 4d M
+ ld hl,0 ;0458 21 00 00 ! . .
+ ld a,010h ;045b 3e 10 > .
+l045dh:
+ add hl,hl ;045d 29 )
+ ex de,hl ;045e eb .
+ add hl,hl ;045f 29 )
+ ex de,hl ;0460 eb .
+ jr nc,l0464h ;0461 30 01 0 .
+ add hl,bc ;0463 09 .
+l0464h:
+ dec a ;0464 3d =
+ jr nz,l045dh ;0465 20 f6 .
+ pop bc ;0467 c1 .
+ jr l044dh ;0468 18 e3 . .
+
+doop_div:
+ call div_hl_de ;046a cd 75 04 . u .
+ jr l044dh ;046d 18 de . .
+
+doop_mod:
+ call div_hl_de ;046f cd 75 04 . u .
+ ex de,hl ;0472 eb .
+ jr l044dh ;0473 18 d8 . .
+
+; divide x/y
+; hl: x
+; de: y
+; return:
+; hl: q (x/y)
+; de: r (x%y)
+
+div_hl_de:
+ push bc ;0475 c5 .
+ ex de,hl ;0476 eb .
+ ld b,h ;0477 44 D
+ ld c,l ;0478 4d M
+ ld hl,0 ;0479 21 00 00 ! . .
+ ld a,16 ;047c 3e 10 > .
+
+; de: x (x shifted out, q shifted in)
+; bc: y
+; hl: r (initially 0)
+
+l047eh:
+ push af ;047e f5 .
+ add hl,hl ;047f 29 )
+ ex de,hl ;0480 eb .
+ xor a ;0481 af .
+ add hl,hl ;0482 29 )
+ ex de,hl ;0483 eb .
+ adc a,l ;0484 8d .
+ sub c ;0485 91 .
+ ld l,a ;0486 6f o
+ ld a,h ;0487 7c |
+ sbc a,b ;0488 98 .
+ ld h,a ;0489 67 g
+ inc de ;048a 13 .
+ jr nc,l048fh ;048b 30 02 0 .
+ add hl,bc ;048d 09 .
+ dec de ;048e 1b .
+l048fh:
+ pop af ;048f f1 .
+ dec a ;0490 3d =
+ jr nz,l047eh ;0491 20 eb .
+ ex de,hl ;0493 eb .
+ pop bc ;0494 c1 .
+ ret ;0495 c9 .
+
+doop_and:
+ ld a,h ;0496 7c |
+ and d ;0497 a2 .
+ ld h,a ;0498 67 g
+ ld a,l ;0499 7d }
+ and e ;049a a3 .
+ ld l,a ;049b 6f o
+ jr l044dh ;049c 18 af . .
+
+doop_or:
+ ld a,h ;049e 7c |
+ or d ;049f b2 .
+ ld h,a ;04a0 67 g
+ ld a,l ;04a1 7d }
+ or e ;04a2 b3 .
+ ld l,a ;04a3 6f o
+ jr l044dh ;04a4 18 a7 . .
+
+doop_xor:
+ ld a,h ;04a6 7c |
+ xor d ;04a7 aa .
+ ld h,a ;04a8 67 g
+ ld a,l ;04a9 7d }
+ xor e ;04aa ab .
+ ld l,a ;04ab 6f o
+ jr l044dh ;04ac 18 9f . .
+
+do_binary_op:
+ push hl ;04ae e5 .
+ ld hl,tab_op_a ;04af 21 c2 04 ! . .
+ call lookupch ;04b2 cd f3 02 . . .
+ ld a,b ;04b5 78 x
+ ld hl,tblf_opa ;04b6 21 cb 04 ! . .
+ add a,a ;04b9 87 .
+ call add_hl_a ;04ba cd b9 02 . . .
+ ld c,(hl) ;04bd 4e N
+ inc hl ;04be 23 #
+ ld b,(hl) ;04bf 46 F
+ pop hl ;04c0 e1 .
+ ret ;04c1 c9 .
+
+tab_op_a:
+ DB '+-*/%&!#',0
+
+tblf_opa:
+ defw doop_add ;04cb 4c 04 L .
+ defw doop_sub ;04cd 50 04 P .
+ defw doop_mlt ;04cf 55 04 U .
+ defw doop_div ;04d1 6a 04 j .
+ defw doop_mod ;04d3 6f 04 o .
+ defw doop_and ;04d5 96 04 . .
+ defw doop_or ;04d7 9e 04 . .
+ defw doop_xor ;04d9 a6 04 . .
+ defw 0 ;04db 00 00 . .
+
+fact_factor:
+ call do_factor ;04dd cd e4 04 . . .
+ ret nc ;04e0 d0 .
+ jp ERROR ;04e1 c3 07 01 . . .
+
+do_factor:
+ call chk_sp ;04e4 cd dd 02 . . .
+ call get.number ;04e7 cd aa 05 . . .
+ ret nc ;04ea d0 .
+ inc de ;04eb 13 .
+ ld hl,ddtz_base-1 ;04ec 21 ff ff ! . .
+ cp 'T' ;04ef fe 54 . T
+ ret z ;04f1 c8 .
+ ld hl,(high_load) ;04f2 2a 9c 11 * . .
+ cp 'H' ;04f5 fe 48 . H
+ ret z ;04f7 c8 .
+ ld hl,(max_load) ;04f8 2a 9e 11 * . .
+ cp 'M' ;04fb fe 4d . M
+ ret z ;04fd c8 .
+ ld hl,TPA ;04fe 21 00 01 ! . .
+ cp 'L' ;0501 fe 4c . L
+ ret z ;0503 c8 .
+ ld hl,(offs.@) ;0504 2a 64 00 * d .
+ cp '@' ;0507 fe 40 . @
+ ret z ;0509 c8 .
+ ld hl,(l0062h) ;050a 2a 62 00 * b .
+ cp '$' ;050d fe 24 . $
+ ret z ;050f c8 .
+ cp '-' ;0510 fe 2d . -
+ jr z,fact_factneg ;0512 28 61 ( a
+ cp '~' ;0514 fe 7e . ~
+ jr z,fact_factinv ;0516 28 68 ( h
+ cp '+' ;0518 fe 2b . +
+ jr z,fact_factor ;051a 28 c1 ( .
+ cp '^' ;051c fe 5e . ^
+ jr z,fact_reg.CPU ;051e 28 45 ( E
+ cp 'Y' ;0520 fe 59 . Y
+ jr z,fact_reg.Y ;0522 28 10 ( .
+ cp '(' ;0524 fe 28 . (
+ jr z,fact_mem ;0526 28 5d ( ]
+ cp '[' ;0528 fe 5b . [
+ jp z,expr_brckt ;052a ca 9d 05 . . .
+ cp '''' ;052d fe 27 . '
+ jr z,fact_factstring ;052f 28 17 ( .
+ dec de ;0531 1b .
+ scf ;0532 37 7
+ ret ;0533 c9 .
+
+fact_reg.Y:
+ call get.decdigit ;0534 cd 1d 06 . . .
+ jp c,ERROR ;0537 da 07 01 . . .
+ inc de ;053a 13 .
+ add a,a ;053b 87 .
+ ld hl,reg_Y ;053c 21 9e 0b ! . .
+ call add_hl_a ;053f cd b9 02 . . .
+ ld a,(hl) ;0542 7e ~
+ inc hl ;0543 23 #
+ ld h,(hl) ;0544 66 f
+ ld l,a ;0545 6f o
+ and a ;0546 a7 .
+ ret ;0547 c9 .
+
+fact_factstring:
+ ld hl,0 ;0548 21 00 00 ! . .
+l054bh:
+ ld a,(de) ;054b 1a .
+ cp '''' ;054c fe 27 . '
+ jr z,l0557h ;054e 28 07 ( .
+ and a ;0550 a7 .
+ ret z ;0551 c8 .
+l0552h:
+ ld h,l ;0552 65 e
+ ld l,a ;0553 6f o
+ inc de ;0554 13 .
+ jr l054bh ;0555 18 f4 . .
+l0557h:
+ inc de ;0557 13 .
+ ld a,(de) ;0558 1a .
+ cp '''' ;0559 fe 27 . '
+ jr z,l0552h ;055b 28 f5 ( .
+ sub '.' ;055d d6 2e . .
+ or a ;055f b7 .
+ ret nz ;0560 c0 .
+ inc de ;0561 13 .
+ set 7,l ;0562 cb fd . .
+ ret ;0564 c9 .
+
+fact_reg.CPU:
+ call sub_0caeh ;0565 cd ae 0c . . .
+ jr nc,error4 ;0568 30 3d 0 =
+ ld a,(hl) ;056a 7e ~
+ inc hl ;056b 23 #
+ ld h,(hl) ;056c 66 f
+ ld l,a ;056d 6f o
+ and a ;056e a7 .
+ bit 0,c ;056f cb 41 . A
+ ret nz ;0571 c0 .
+ ld h,000h ;0572 26 00 & .
+ ret ;0574 c9 .
+
+fact_factneg:
+ call fact_factor ;0575 cd dd 04 . . .
+ dec hl ;0578 2b +
+cpl.hl:
+ ld a,h ;0579 7c |
+ cpl ;057a 2f /
+ ld h,a ;057b 67 g
+ ld a,l ;057c 7d }
+ cpl ;057d 2f /
+ ld l,a ;057e 6f o
+ ret ;057f c9 .
+
+fact_factinv:
+ call fact_factor ;0580 cd dd 04 . . .
+ jr cpl.hl ;0583 18 f4 . .
+
+fact_mem:
+ call expr1 ;0585 cd c1 03 . . .
+ jr c,error4 ;0588 38 1d 8 .
+ ld a,(de) ;058a 1a .
+ cp ')' ;058b fe 29 . )
+ jr nz,error4 ;058d 20 18 .
+ inc de ;058f 13 .
+ ld a,(hl) ;0590 7e ~
+ inc hl ;0591 23 #
+ ld h,(hl) ;0592 66 f
+ ld l,a ;0593 6f o
+ ld a,(de) ;0594 1a .
+ inc de ;0595 13 .
+ cp '.' ;0596 fe 2e . .
+ ret z ;0598 c8 .
+ dec de ;0599 1b .
+ xor a ;059a af .
+ ld h,a ;059b 67 g
+ ret ;059c c9 .
+
+expr_brckt:
+ call expr1 ;059d cd c1 03 . . .
+ jr c,error4 ;05a0 38 05 8 .
+ ld a,(de) ;05a2 1a .
+ cp ']' ;05a3 fe 5d . ]
+ inc de ;05a5 13 .
+ ret z ;05a6 c8 .
+error4:
+ jp ERROR ;05a7 c3 07 01 . . .
+
+get.number:
+ call get.hexdigit ;05aa cd 11 06 . . .
+ ret c ;05ad d8 .
+ push de ;05ae d5 .
+test_number:
+ inc de ;05af 13 .
+ call get.hexdigit ;05b0 cd 11 06 . . .
+ jr nc,test_number ;05b3 30 fa 0 .
+ pop de ;05b5 d1 .
+ cp '.' ;05b6 fe 2e . .
+ jr z,get_dec_number ;05b8 28 36 ( 6
+ cp '"' ;05ba fe 22 . "
+ jr z,get_bin_number ;05bc 28 17 ( .
+ ld hl,0 ;05be 21 00 00 ! . .
+next_hexdigit:
+ call get.hexdigit ;05c1 cd 11 06 . . .
+ jr c,hexnum_done ;05c4 38 0a 8 .
+ add hl,hl ;05c6 29 )
+ add hl,hl ;05c7 29 )
+ add hl,hl ;05c8 29 )
+ add hl,hl ;05c9 29 )
+ call add_hl_a ;05ca cd b9 02 . . .
+ inc de ;05cd 13 .
+ jr next_hexdigit ;05ce 18 f1 . .
+
+hexnum_done:
+ xor 'H' ;05d0 ee 48 . H
+ ret nz ;05d2 c0 .
+ inc de ;05d3 13 .
+ ret ;05d4 c9 .
+
+get_bin_number:
+ ld hl,0 ;05d5 21 00 00 ! . .
+next_bindigit:
+ call get.bindigit ;05d8 cd 22 06 . " .
+l05dbh:
+ inc de ;05db 13 .
+ jr c,l05e4h ;05dc 38 06 8 .
+ add hl,hl ;05de 29 )
+ call add_hl_a ;05df cd b9 02 . . .
+ jr next_bindigit ;05e2 18 f4 . .
+l05e4h:
+ cp '"' ;05e4 fe 22 . "
+ jp nz,ERROR ;05e6 c2 07 01 . . .
+ call get.bindigit ;05e9 cd 22 06 . " .
+ jr nc,l05dbh ;05ec 30 ed 0 .
+ or a ;05ee b7 .
+ ret ;05ef c9 .
+
+get_dec_number:
+ ld hl,0 ;05f0 21 00 00 ! . .
+next_decdigit:
+ call get.decdigit ;05f3 cd 1d 06 . . .
+ inc de ;05f6 13 .
+ jr c,decnum_done ;05f7 38 0d 8 .
+ push bc ;05f9 c5 .
+ add hl,hl ;05fa 29 )
+ ld b,h ;05fb 44 D
+ ld c,l ;05fc 4d M
+ add hl,hl ;05fd 29 )
+ add hl,hl ;05fe 29 )
+ add hl,bc ;05ff 09 .
+ pop bc ;0600 c1 .
+ call add_hl_a ;0601 cd b9 02 . . .
+ jr next_decdigit ;0604 18 ed . .
+decnum_done:
+ cp '.' ;0606 fe 2e . .
+ ret z ;0608 c8 .
+ jp ERROR ;0609 c3 07 01 . . .
+
+sub_060ch:
+ ld a,(de) ;060c 1a .
+ cp '[' ;060d fe 5b . [
+ jr l0614h ;060f 18 03 . .
+
+get.hexdigit:
+ ld a,(de) ;0611 1a .
+hex_digit:
+ cp 'F'+1 ;0612 fe 47 . G
+l0614h:
+ ccf ;0614 3f ?
+ ret c ;0615 d8 .
+ cp 'A' ;0616 fe 41 . A
+ jr c,l061eh ;0618 38 04 8 .
+ sub 'A'-10 ;061a d6 37 . 7
+ ret ;061c c9 .
+
+get.decdigit:
+ ld a,(de) ;061d 1a .
+l061eh:
+ cp '9'+1 ;061e fe 3a . :
+ jr l0625h ;0620 18 03 . .
+
+get.bindigit:
+ ld a,(de) ;0622 1a .
+ cp '1'+1 ;0623 fe 32 . 2
+l0625h:
+ ccf ;0625 3f ?
+ ret c ;0626 d8 .
+ cp '0' ;0627 fe 30 . 0
+ ret c ;0629 d8 .
+ sub '0' ;062a d6 30 . 0
+ ret ;062c c9 .
+
+prnt_cpustat0:
+ call assert_eol ;062d cd d6 02 . . .
+prnt_cpustat:
+ call prnt_f ;0630 cd 6e 06 . n .
+ call outbl2 ;0633 cd 9c 02 . . .
+ ld hl,b_06e9_start ;0636 21 e9 06 ! . .
+ ld de,b_0709_start ;0639 11 09 07 . . .
+ ld b,6 ;063c 06 06 . .
+l063eh:
+ call prnt_regs ;063e cd b2 06 . . .
+ djnz l063eh ;0641 10 fb . .
+ push hl ;0643 e5 .
+ push de ;0644 d5 .
+ ld iy,(REG.PC) ;0645 fd 2a 60 00 . * ` .
+ call sub_1965h ;0649 cd 65 19 . e .
+ exx ;064c d9 .
+ ex af,af' ;064d 08 .
+ call crlf ;064e cd a3 02 . . .
+ call prnt_f2 ;0651 cd 81 06 . . .
+ call outbl2 ;0654 cd 9c 02 . . .
+ pop de ;0657 d1 .
+ pop hl ;0658 e1 .
+ ld b,7 ;0659 06 07 . .
+l065bh:
+ call prnt_regs ;065b cd b2 06 . . .
+ djnz l065bh ;065e 10 fb . .
+ exx ;0660 d9 .
+ ex af,af' ;0661 08 .
+ and a ;0662 a7 .
+ jr z,l066bh ;0663 28 06 ( .
+ call outbl6 ;0665 cd 96 02 . . .
+ call prnt_offset ;0668 cd 49 19 . I .
+l066bh:
+ jp crlf ;066b c3 a3 02 . . .
+
+prnt_f:
+ ld a,(reg.f) ;066e 3a 54 00 : T .
+ call prnt_flags ;0671 cd 8a 06 . . .
+ ld a,(reg.iff) ;0674 3a 5e 00 : ^ .
+ cp 0f3h ;0677 fe f3 . .
+ jp z,outbl ;0679 ca 9f 02 . . .
+ ld a,'E' ;067c 3e 45 > E
+ jp outchar ;067e c3 5d 02 . ] .
+prnt_f2:
+ ld a,(reg.f2) ;0681 3a 4c 00 : L .
+ call prnt_flags ;0684 cd 8a 06 . . .
+ jp outbl ;0687 c3 9f 02 . . .
+prnt_flags:
+ ld b,a ;068a 47 G
+ ld a,'S' ;068b 3e 53 > S
+ call sub_06aah ;068d cd aa 06 . . .
+ ld a,'Z' ;0690 3e 5a > Z
+ call sub_06aah ;0692 cd aa 06 . . .
+ rl b ;0695 cb 10 . .
+ ld a,'H' ;0697 3e 48 > H
+ call sub_06aah ;0699 cd aa 06 . . .
+ rl b ;069c cb 10 . .
+ ld a,'V' ;069e 3e 56 > V
+ call sub_06aah ;06a0 cd aa 06 . . .
+ ld a,'N' ;06a3 3e 4e > N
+ call sub_06aah ;06a5 cd aa 06 . . .
+ ld a,'C' ;06a8 3e 43 > C
+sub_06aah:
+ rl b ;06aa cb 10 . .
+ jp c,outchar ;06ac da 5d 02 . ] .
+ jp outbl ;06af c3 9f 02 . . .
+prnt_regs:
+ push bc ;06b2 c5 .
+ push de ;06b3 d5 .
+ call pstr ;06b4 cd 88 02 . . .
+ ld a,'=' ;06b7 3e 3d > =
+ call outchar ;06b9 cd 5d 02 . ] .
+ ex (sp),hl ;06bc e3 .
+ ld e,(hl) ;06bd 5e ^
+ inc hl ;06be 23 #
+ ld d,(hl) ;06bf 56 V
+ inc hl ;06c0 23 #
+ ld a,(hl) ;06c1 7e ~
+ inc hl ;06c2 23 #
+ push hl ;06c3 e5 .
+ and a ;06c4 a7 .
+ jr z,l06deh ;06c5 28 17 ( .
+ push af ;06c7 f5 .
+ ld a,(de) ;06c8 1a .
+ ld l,a ;06c9 6f o
+ inc de ;06ca 13 .
+ ld a,(de) ;06cb 1a .
+ ld h,a ;06cc 67 g
+ pop af ;06cd f1 .
+ dec a ;06ce 3d =
+ jr z,l06d9h ;06cf 28 08 ( .
+ call out.hl.@ ;06d1 cd a4 01 . . .
+ call z,outbl6 ;06d4 cc 96 02 . . .
+ jr l06e2h ;06d7 18 09 . .
+l06d9h:
+ call out_hl ;06d9 cd 13 02 . . .
+ jr l06e2h ;06dc 18 04 . .
+l06deh:
+ ld a,(de) ;06de 1a .
+ call out_hex ;06df cd 18 02 . . .
+l06e2h:
+ call outbl ;06e2 cd 9f 02 . . .
+ pop de ;06e5 d1 .
+ pop hl ;06e6 e1 .
+ pop bc ;06e7 c1 .
+ ret ;06e8 c9 .
+
+b_06e9_start:
+ DC 'A '
+ DC 'BC '
+ DC 'DE '
+ DC 'HL '
+ DC 'SP'
+ DC 'PC'
+ DC 'A'''
+ DC 'BC'''
+ DC 'DE'''
+ DC 'HL'''
+ DC 'IX'
+ DC 'IY'
+ DC 'I'
+ DB 0
+
+b_0709_start:
+ defw reg.a ;0709 55 00 U .
+ defb 000h ;070b 00 .
+ defw reg.c ;070c 56 00 V .
+ defb 001h ;070e 01 .
+ defw reg.e ;070f 58 00 X .
+ defb 001h ;0711 01 .
+ defw reg.l ;0712 5a 00 Z .
+ defb 001h ;0714 01 .
+ defw reg_sp ;0715 5c 00 \ .
+ defb 001h ;0717 01 .
+ defw REG.PC ;0718 60 00 ` .
+ defb 002h ;071a 02 .
+ defw reg.a2 ;071b 4d 00 M .
+ defb 000h ;071d 00 .
+ defw reg.c2 ;071e 4a 00 J .
+ defb 001h ;0720 01 .
+ defw reg.e2 ;0721 48 00 H .
+ defb 001h ;0723 01 .
+ defw reg.l2 ;0724 46 00 F .
+ defb 001h ;0726 01 .
+ defw reg.ix ;0727 52 00 R .
+ defb 001h ;0729 01 .
+ defw reg.iy ;072a 50 00 P .
+ defb 001h ;072c 01 .
+ defw reg.i ;072d 4f 00 O .
+ defb 000h ;072f 00 .
+ defb 000h ;0730 00 .
+
+cmd_G:
+ sub a ;0731 97 .
+ ld (trace_call_flag),a ;0732 32 e3 21 2 . !
+ ld (l0941h),a ;0735 32 41 09 2 A .
+ call expr ;0738 cd be 03 . . .
+ jr c,l0740h ;073b 38 03 8 .
+ ld (REG.PC),hl ;073d 22 60 00 " ` .
+l0740h:
+ call skipbl ;0740 cd bf 02 . . .
+ jp z,user_go ;0743 ca 25 0a . % .
+ cp ';' ;0746 fe 3b . ;
+ jp nz,ERROR ;0748 c2 07 01 . . .
+ inc de ;074b 13 .
+ ld a,002h ;074c 3e 02 > .
+ call bp_enter ;074e cd 10 08 . . .
+ jp user_go ;0751 c3 25 0a . % .
+
+bp_clr_temporary:
+ ld b,BP_CNT ;0754 06 0c . .
+ ld ix,bp_tab ;0756 dd 21 b8 0a . ! . .
+l075ah:
+ ld a,(ix+000h) ;075a dd 7e 00 . ~ .
+ and 0f1h ;075d e6 f1 . .
+ ld (ix+000h),a ;075f dd 77 00 . w .
+ call bp_clr_condition ;0762 cd 5f 0a . _ .
+ ld de,BP_SIZE ;0765 11 08 00 . . .
+ add ix,de ;0768 dd 19 . .
+ djnz l075ah ;076a 10 ee . .
+ ret ;076c c9 .
+
+cmd_B:
+ call skipbl ;076d cd bf 02 . . .
+ jr z,l07b7h ;0770 28 45 ( E
+ inc de ;0772 13 .
+ cp 'X' ;0773 fe 58 . X
+ jr z,l077dh ;0775 28 06 ( .
+ dec de ;0777 1b .
+ ld a,001h ;0778 3e 01 > .
+ jp bp_enter ;077a c3 10 08 . . .
+l077dh:
+ call skipbl ;077d cd bf 02 . . .
+ jr z,bp_clr_all ;0780 28 10 ( .
+l0782h:
+ call expr ;0782 cd be 03 . . .
+ jp c,assert_eol ;0785 da d6 02 . . .
+ push de ;0788 d5 .
+ call bp_clr ;0789 cd 93 07 . . .
+ pop de ;078c d1 .
+ call next_arg ;078d cd ca 02 . . .
+ jr l0782h ;0790 18 f0 . .
+
+bp_clr_all:
+ scf ;0792 37 7
+bp_clr:
+ ld b,BP_CNT ;0793 06 0c . .
+ ld ix,bp_tab ;0795 dd 21 b8 0a . ! . .
+l0799h:
+ push af ;0799 f5 .
+ jr c,l07a7h ;079a 38 0b 8 .
+ ld e,(ix+002h) ;079c dd 5e 02 . ^ .
+ ld d,(ix+003h) ;079f dd 56 03 . V .
+ call cp_hl_de ;07a2 cd ee 02 . . .
+ jr nz,l07aeh ;07a5 20 07 .
+l07a7h:
+ ld (ix+000h),000h ;07a7 dd 36 00 00 . 6 . .
+ call bp_clr_condition ;07ab cd 5f 0a . _ .
+l07aeh:
+ ld de,BP_SIZE ;07ae 11 08 00 . . .
+ add ix,de ;07b1 dd 19 . .
+ pop af ;07b3 f1 .
+ djnz l0799h ;07b4 10 e3 . .
+ ret ;07b6 c9 .
+
+l07b7h:
+ ld b,BP_CNT ;07b7 06 0c . .
+ ld ix,bp_tab ;07b9 dd 21 b8 0a . ! . .
+l07bdh:
+ bit 0,(ix+000h) ;07bd dd cb 00 46 . . . F
+ jr z,l0808h ;07c1 28 45 ( E
+ ld a,'R' ;07c3 3e 52 > R
+ bit 4,(ix+000h) ;07c5 dd cb 00 66 . . . f
+ jr nz,l07cdh ;07c9 20 02 .
+ ld a,' ' ;07cb 3e 20 >
+l07cdh:
+ call outchar ;07cd cd 5d 02 . ] .
+ call outbl ;07d0 cd 9f 02 . . .
+ ld l,(ix+002h) ;07d3 dd 6e 02 . n .
+ ld h,(ix+003h) ;07d6 dd 66 03 . f .
+ call out.hl.@ ;07d9 cd a4 01 . . .
+ call outbl2 ;07dc cd 9c 02 . . .
+ ld a,':' ;07df 3e 3a > :
+ call outchar ;07e1 cd 5d 02 . ] .
+ ld l,(ix+004h) ;07e4 dd 6e 04 . n .
+ ld h,(ix+005h) ;07e7 dd 66 05 . f .
+ call out_hl ;07ea cd 13 02 . . .
+ ld l,(ix+006h) ;07ed dd 6e 06 . n .
+ ld h,(ix+007h) ;07f0 dd 66 07 . f .
+ ld a,h ;07f3 7c |
+ or l ;07f4 b5 .
+ jr z,l0805h ;07f5 28 0e ( .
+ call outbl4 ;07f7 cd 99 02 . . .
+ ld a,'I' ;07fa 3e 49 > I
+ call outchar ;07fc cd 5d 02 . ] .
+ call outbl2 ;07ff cd 9c 02 . . .
+ call pstr ;0802 cd 88 02 . . .
+l0805h:
+ call crlf ;0805 cd a3 02 . . .
+l0808h:
+ ld de,BP_SIZE ;0808 11 08 00 . . .
+ add ix,de ;080b dd 19 . .
+ djnz l07bdh ;080d 10 ae . .
+ ret ;080f c9 .
+
+; Add break points to list
+; A = 1 Permanent (B command)
+; A = 2 Temporary (G command)
+
+bp_enter:
+ ld b,a ;0810 47 G
+ call skipbl ;0811 cd bf 02 . . .
+ ret z ;0814 c8 .
+ cp 'R' ;0815 fe 52 . R
+ jr nz,l081ch ;0817 20 03 .
+ inc de ;0819 13 .
+ set 4,b ;081a cb e0 . .
+l081ch:
+ push bc ;081c c5 .
+ call expr ;081d cd be 03 . . .
+ jp c,ERROR ;0820 da 07 01 . . .
+ pop bc ;0823 c1 .
+ bit 0,b ;0824 cb 40 . @
+ push bc ;0826 c5 .
+ push de ;0827 d5 .
+ push hl ;0828 e5 .
+ call nz,bp_clr ;0829 c4 93 07 . . .
+ pop hl ;082c e1 .
+ call bp_get_freeslot ;082d cd 54 08 . T .
+ pop de ;0830 d1 .
+ ld (ix+002h),l ;0831 dd 75 02 . u .
+ ld (ix+003h),h ;0834 dd 74 03 . t .
+ call bp_get_count ;0837 cd 6c 08 . l .
+ ld (ix+004h),l ;083a dd 75 04 . u .
+ ld (ix+005h),h ;083d dd 74 05 . t .
+ call bp_get_condition ;0840 cd 7d 08 . } .
+ ld (ix+006h),l ;0843 dd 75 06 . u .
+ ld (ix+007h),h ;0846 dd 74 07 . t .
+ call next_arg ;0849 cd ca 02 . . .
+ pop af ;084c f1 .
+ ld (ix+000h),a ;084d dd 77 00 . w .
+ and 00fh ;0850 e6 0f . .
+ jr bp_enter ;0852 18 bc . .
+
+bp_get_freeslot:
+ ld b,BP_CNT ;0854 06 0c . .
+ ld ix,bp_tab ;0856 dd 21 b8 0a . ! . .
+l085ah:
+ ld a,(ix+000h) ;085a dd 7e 00 . ~ .
+ and 00fh ;085d e6 0f . .
+ ret z ;085f c8 .
+ push bc ;0860 c5 .
+ ld bc,BP_SIZE ;0861 01 08 00 . . .
+ add ix,bc ;0864 dd 09 . .
+ pop bc ;0866 c1 .
+ djnz l085ah ;0867 10 f1 . .
+ jp ERROR ;0869 c3 07 01 . . .
+
+bp_get_count:
+ call skipbl ;086c cd bf 02 . . .
+ ld hl,1 ;086f 21 01 00 ! . .
+ cp ':' ;0872 fe 3a . :
+ ret nz ;0874 c0 .
+ inc de ;0875 13 .
+ call expr ;0876 cd be 03 . . .
+ jp c,ERROR ;0879 da 07 01 . . .
+ ret ;087c c9 .
+
+bp_get_condition:
+ call skipbl ;087d cd bf 02 . . .
+ cp 'I' ;0880 fe 49 . I
+ ld hl,0 ;0882 21 00 00 ! . .
+ ret nz ;0885 c0 .
+ inc de ;0886 13 .
+ call skipbl ;0887 cd bf 02 . . .
+ push de ;088a d5 .
+ call expr ;088b cd be 03 . . .
+ jp c,ERROR ;088e da 07 01 . . .
+ ex de,hl ;0891 eb .
+ pop de ;0892 d1 .
+ push de ;0893 d5 .
+ sbc hl,de ;0894 ed 52 . R
+ ld b,h ;0896 44 D
+ ld c,l ;0897 4d M
+ ld hl,(expr_p1) ;0898 2a 18 0b * . .
+ push hl ;089b e5 .
+ add hl,bc ;089c 09 .
+ ld de,expr_bufe ;089d 11 9c 0b . . .
+ call cp_hl_de ;08a0 cd ee 02 . . .
+ jp nc,ERROR ;08a3 d2 07 01 . . .
+ pop hl ;08a6 e1 .
+ ld (expr_p2),hl ;08a7 22 1a 0b " . .
+ pop de ;08aa d1 .
+ ex de,hl ;08ab eb .
+ ldir ;08ac ed b0 . .
+ xor a ;08ae af .
+ ld (de),a ;08af 12 .
+ inc de ;08b0 13 .
+ ex de,hl ;08b1 eb .
+ ld (expr_p1),hl ;08b2 22 18 0b " . .
+ ld hl,(expr_p2) ;08b5 2a 1a 0b * . .
+ ret ;08b8 c9 .
+
+bpddtz:
+ ld (reg.l),hl ;08b9 22 5a 00 " Z .
+ pop hl ;08bc e1 .
+ dec hl ;08bd 2b +
+ ld (REG.PC),hl ;08be 22 60 00 " ` .
+ ld (reg_sp),sp ;08c1 ed 73 5c 00 . s \ .
+ ld sp,reg.l ;08c5 31 5a 00 1 Z .
+ push de ;08c8 d5 .
+ push bc ;08c9 c5 .
+ push af ;08ca f5 .
+ push ix ;08cb dd e5 . .
+ push iy ;08cd fd e5 . .
+ ld a,i ;08cf ed 57 . W
+ call sub_0004h ;08d1 cd 04 00 . . .
+ ld h,a ;08d4 67 g
+ ld l,000h ;08d5 2e 00 . .
+ push hl ;08d7 e5 .
+ ld a,0f3h ;08d8 3e f3 > .
+ jp po,l08dfh ;08da e2 df 08 . . .
+ ld a,0fbh ;08dd 3e fb > .
+l08dfh:
+ ld (reg.iff),a ;08df 32 5e 00 2 ^ .
+ ex af,af' ;08e2 08 .
+ push af ;08e3 f5 .
+ exx ;08e4 d9 .
+ push bc ;08e5 c5 .
+ push de ;08e6 d5 .
+ push hl ;08e7 e5 .
+ call sub_097ah ;08e8 cd 7a 09 . z .
+ ld a,(b_21e2_start) ;08eb 3a e2 21 : . !
+ dec a ;08ee 3d =
+ jr z,l090bh ;08ef 28 1a ( .
+ call inchar ;08f1 cd 73 02 . s .
+ jr c,l0902h ;08f4 38 0c 8 .
+ call sub_0913h ;08f6 cd 13 09 . . .
+ and a ;08f9 a7 .
+ jp z,user_go ;08fa ca 25 0a . % .
+ and 083h ;08fd e6 83 . .
+ jp z,l2151h ;08ff ca 51 21 . Q !
+l0902h:
+ call bp_clr_temporary ;0902 cd 54 07 . T .
+ call prnt_cpustat ;0905 cd 30 06 . 0 .
+ jp mainloop ;0908 c3 bd 00 . . .
+
+l090bh:
+ ld (b_21e2_start),a ;090b 32 e2 21 2 . !
+ ld c,007h ;090e 0e 07 . .
+ jp l0a41h ;0910 c3 41 0a . A .
+
+sub_0913h:
+ ld a,080h ;0913 3e 80 > .
+ ex af,af' ;0915 08 .
+ sub a ;0916 97 .
+ ld (l0941h),a ;0917 32 41 09 2 A .
+ ld b,BP_CNT ;091a 06 0c . .
+ ld ix,bp_tab ;091c dd 21 b8 0a . ! . .
+l0920h:
+ ld a,(ix+000h) ;0920 dd 7e 00 . ~ .
+ and 007h ;0923 e6 07 . .
+ jr z,l0938h ;0925 28 11 ( .
+ ld e,(ix+002h) ;0927 dd 5e 02 . ^ .
+ ld d,(ix+003h) ;092a dd 56 03 . V .
+ ld hl,(REG.PC) ;092d 2a 60 00 * ` .
+ call cp_hl_de ;0930 cd ee 02 . . .
+ push bc ;0933 c5 .
+ call z,sub_0942h ;0934 cc 42 09 . B .
+ pop bc ;0937 c1 .
+l0938h:
+ ld de,BP_SIZE ;0938 11 08 00 . . .
+ add ix,de ;093b dd 19 . .
+ djnz l0920h ;093d 10 e1 . .
+ ex af,af' ;093f 08 .
+ ret ;0940 c9 .
+
+l0941h:
+ db 0 ;0941 00 .
+
+sub_0942h:
+ ex af,af' ;0942 08 .
+ res 7,a ;0943 cb bf . .
+ ex af,af' ;0945 08 .
+ ld e,(ix+006h) ;0946 dd 5e 06 . ^ .
+ ld d,(ix+007h) ;0949 dd 56 07 . V .
+ ld a,d ;094c 7a z
+ or e ;094d b3 .
+ ld hl,0ffffh ;094e 21 ff ff ! . .
+ call nz,expr ;0951 c4 be 03 . . .
+ ld a,h ;0954 7c |
+ or l ;0955 b5 .
+ jr z,l0969h ;0956 28 11 ( .
+ ld e,(ix+004h) ;0958 dd 5e 04 . ^ .
+ ld d,(ix+005h) ;095b dd 56 05 . V .
+ dec de ;095e 1b .
+ ld a,d ;095f 7a z
+ or e ;0960 b3 .
+ jr z,l0974h ;0961 28 11 ( .
+ ld (ix+004h),e ;0963 dd 73 04 . s .
+ ld (ix+005h),d ;0966 dd 72 05 . r .
+l0969h:
+ bit 4,(ix+000h) ;0969 dd cb 00 66 . . . f
+ ret z ;096d c8 .
+ ld a,001h ;096e 3e 01 > .
+ ld (l0941h),a ;0970 32 41 09 2 A .
+ ret ;0973 c9 .
+l0974h:
+ ex af,af' ;0974 08 .
+ or (ix+000h) ;0975 dd b6 00 . . .
+ ex af,af' ;0978 08 .
+ ret ;0979 c9 .
+
+sub_097ah:
+ ld b,BP_CNT ;097a 06 0c . .
+ ld ix,bp_tab ;097c dd 21 b8 0a . ! . .
+l0980h:
+ bit 5,(ix+000h) ;0980 dd cb 00 6e . . . n
+ res 5,(ix+000h) ;0984 dd cb 00 ae . . . .
+ jr z,l099ah ;0988 28 10 ( .
+ ld l,(ix+002h) ;098a dd 6e 02 . n .
+ ld h,(ix+003h) ;098d dd 66 03 . f .
+ ld a,(l0003h) ;0990 3a 03 00 : . .
+ cp (hl) ;0993 be .
+ jr nz,l099ah ;0994 20 04 .
+ ld a,(ix+001h) ;0996 dd 7e 01 . ~ .
+ ld (hl),a ;0999 77 w
+l099ah:
+ res 3,(ix+000h) ;099a dd cb 00 9e . . . .
+ ld de,BP_SIZE ;099e 11 08 00 . . .
+ add ix,de ;09a1 dd 19 . .
+ djnz l0980h ;09a3 10 db . .
+ ret ;09a5 c9 .
+
+sub_09a6h:
+ ld b,BP_CNT ;09a6 06 0c . .
+ ld ix,bp_tab ;09a8 dd 21 b8 0a . ! . .
+l09ach:
+ ld a,(ix+000h) ;09ac dd 7e 00 . ~ .
+ and 003h ;09af e6 03 . .
+ jr z,l09c0h ;09b1 28 0d ( .
+ ld e,(ix+002h) ;09b3 dd 5e 02 . ^ .
+ ld d,(ix+003h) ;09b6 dd 56 03 . V .
+ ld hl,(REG.PC) ;09b9 2a 60 00 * ` .
+ call cp_hl_de ;09bc cd ee 02 . . .
+ ret z ;09bf c8 .
+l09c0h:
+ ld de,BP_SIZE ;09c0 11 08 00 . . .
+ add ix,de ;09c3 dd 19 . .
+ djnz l09ach ;09c5 10 e5 . .
+ sub a ;09c7 97 .
+ inc a ;09c8 3c <
+ ret ;09c9 c9 .
+
+sub_09cah:
+ call bp_get_freeslot ;09ca cd 54 08 . T .
+ ld (ix+004h),001h ;09cd dd 36 04 01 . 6 . .
+ ld (ix+005h),000h ;09d1 dd 36 05 00 . 6 . .
+ ld (ix+002h),l ;09d5 dd 75 02 . u .
+ ld (ix+003h),h ;09d8 dd 74 03 . t .
+ ld (ix+006h),000h ;09db dd 36 06 00 . 6 . .
+ ld (ix+007h),000h ;09df dd 36 07 00 . 6 . .
+ ld a,(b_21e2_start) ;09e3 3a e2 21 : . !
+ and a ;09e6 a7 .
+ ld a,008h ;09e7 3e 08 > .
+ jr nz,l09edh ;09e9 20 02 .
+ ld a,004h ;09eb 3e 04 > .
+l09edh:
+ ld (ix+000h),a ;09ed dd 77 00 . w .
+ ret ;09f0 c9 .
+
+sub_09f1h:
+ ld b,BP_CNT ;09f1 06 0c . .
+ ld ix,bp_tab ;09f3 dd 21 b8 0a . ! . .
+l09f7h:
+ ld a,(ix+000h) ;09f7 dd 7e 00 . ~ .
+ and c ;09fa a1 .
+ jr z,l0a1dh ;09fb 28 20 (
+ set 5,(ix+000h) ;09fd dd cb 00 ee . . . .
+ ld l,(ix+002h) ;0a01 dd 6e 02 . n .
+ ld h,(ix+003h) ;0a04 dd 66 03 . f .
+ ld a,(hl) ;0a07 7e ~
+ ld (ix+001h),a ;0a08 dd 77 01 . w .
+ ld a,(l0003h) ;0a0b 3a 03 00 : . .
+ ld (hl),a ;0a0e 77 w
+ and 038h ;0a0f e6 38 . 8
+ ld h,000h ;0a11 26 00 & .
+ ld l,a ;0a13 6f o
+ ld (hl),0c3h ;0a14 36 c3 6 .
+ inc hl ;0a16 23 #
+ ld de,bpddtz ;0a17 11 b9 08 . . .
+ ld (hl),e ;0a1a 73 s
+ inc hl ;0a1b 23 #
+ ld (hl),d ;0a1c 72 r
+l0a1dh:
+ ld de,BP_SIZE ;0a1d 11 08 00 . . .
+ add ix,de ;0a20 dd 19 . .
+ djnz l09f7h ;0a22 10 d3 . .
+ ret ;0a24 c9 .
+
+user_go:
+ sub a ;0a25 97 .
+ ld (b_21e2_start),a ;0a26 32 e2 21 2 . !
+ ld a,(l0941h) ;0a29 3a 41 09 : A .
+ and a ;0a2c a7 .
+ call nz,prnt_cpustat ;0a2d c4 30 06 . 0 .
+ call sub_09a6h ;0a30 cd a6 09 . . .
+ ld c,007h ;0a33 0e 07 . .
+ jr nz,l0a41h ;0a35 20 0a .
+ ld a,001h ;0a37 3e 01 > .
+ ld (b_21e2_start),a ;0a39 32 e2 21 2 . !
+ call sub_1ffeh ;0a3c cd fe 1f . . .
+ ld c,008h ;0a3f 0e 08 . .
+l0a41h:
+ call sub_09f1h ;0a41 cd f1 09 . . .
+ ld sp,reg.l2 ;0a44 31 46 00 1 F .
+ pop hl ;0a47 e1 .
+ pop de ;0a48 d1 .
+ pop bc ;0a49 c1 .
+ pop af ;0a4a f1 .
+ exx ;0a4b d9 .
+ ex af,af' ;0a4c 08 .
+ pop af ;0a4d f1 .
+ ld i,a ;0a4e ed 47 . G
+ pop iy ;0a50 fd e1 . .
+ pop ix ;0a52 dd e1 . .
+ pop af ;0a54 f1 .
+ pop bc ;0a55 c1 .
+ pop de ;0a56 d1 .
+ pop hl ;0a57 e1 .
+ ld sp,(reg_sp) ;0a58 ed 7b 5c 00 . { \ .
+ jp reg.iff ;0a5c c3 5e 00 . ^ .
+
+bp_clr_condition:
+ ld a,(ix+000h) ;0a5f dd 7e 00 . ~ .
+ and 003h ;0a62 e6 03 . .
+ ret nz ;0a64 c0 .
+ ld e,(ix+006h) ;0a65 dd 5e 06 . ^ .
+ ld d,(ix+007h) ;0a68 dd 56 07 . V .
+ ld a,d ;0a6b 7a z
+ or e ;0a6c b3 .
+ ret z ;0a6d c8 .
+ push bc ;0a6e c5 .
+ ld h,d ;0a6f 62 b
+ ld l,e ;0a70 6b k
+ sub a ;0a71 97 .
+ ld (ix+006h),a ;0a72 dd 77 06 . w .
+ ld (ix+007h),a ;0a75 dd 77 07 . w .
+ ld bc,0ffffh ;0a78 01 ff ff . . .
+ cpir ;0a7b ed b1 . .
+l0a7dh:
+ push de ;0a7d d5 .
+ ld de,(expr_p1) ;0a7e ed 5b 18 0b . [ . .
+ call cp_hl_de ;0a82 cd ee 02 . . .
+ pop de ;0a85 d1 .
+ jr nc,l0a93h ;0a86 30 0b 0 .
+ call sub_0a99h ;0a88 cd 99 0a . . .
+l0a8bh:
+ ld a,(hl) ;0a8b 7e ~
+ ldi ;0a8c ed a0 . .
+ and a ;0a8e a7 .
+ jr nz,l0a8bh ;0a8f 20 fa .
+ jr l0a7dh ;0a91 18 ea . .
+l0a93h:
+ ld (expr_p1),de ;0a93 ed 53 18 0b . S . .
+ pop bc ;0a97 c1 .
+ ret ;0a98 c9 .
+
+sub_0a99h:
+ ld iy,bp_tab ;0a99 fd 21 b8 0a . ! . .
+ push de ;0a9d d5 .
+l0a9eh:
+ ld e,(iy+006h) ;0a9e fd 5e 06 . ^ .
+ ld d,(iy+007h) ;0aa1 fd 56 07 . V .
+ call cp_hl_de ;0aa4 cd ee 02 . . .
+ jr z,l0ab0h ;0aa7 28 07 ( .
+ ld de,BP_SIZE ;0aa9 11 08 00 . . .
+ add iy,de ;0aac fd 19 . .
+ jr l0a9eh ;0aae 18 ee . .
+l0ab0h:
+ pop de ;0ab0 d1 .
+ ld (iy+006h),e ;0ab1 fd 73 06 . s .
+ ld (iy+007h),d ;0ab4 fd 72 07 . r .
+ ret ;0ab7 c9 .
+
+bp_tab:
+ rept BP_CNT
+ rept BP_SIZE
+ db 0
+ endm
+ endm
+
+expr_p1:
+ defw expr_buf ;0b18 1c 0b . .
+expr_p2:
+ defw expr_buf ;0b1a 1c 0b . .
+
+expr_buf:
+ db 'DDT/Z',TAB
+ db '[8101]',CR,LF,'$'
+ db 000h ;0b2b 00 .
+ db 06dh ;0b2c 6d m
+ db 085h ;0b2d 85 .
+ db 0cch ;0b2e cc .
+ db 0f6h ;0b2f f6 .
+ db 053h ;0b30 53 S
+ db 05bh ;0b31 5b [
+
+ ds EXPR_BUF_SIZE - ($ - expr_buf)
+expr_bufe:
+
+msg_Y:
+ dc 'Yn' ;0b9c 59 ee Y n.
+reg_Y:
+ rept YREG_CNT
+ dw 0
+ endm
+
+cmd_Y:
+ call get.decdigit ;0bb2 cd 1d 06 . . .
+ jr c,l0bc3h ;0bb5 38 0c 8 .
+ inc de ;0bb7 13 .
+ push af ;0bb8 f5 .
+ call assert_eol ;0bb9 cd d6 02 . . .
+ pop af ;0bbc f1 .
+ call sub_0bdch ;0bbd cd dc 0b . . .
+ jp l0c15h ;0bc0 c3 15 0c . . .
+l0bc3h:
+ call assert_eol ;0bc3 cd d6 02 . . .
+ xor a ;0bc6 af .
+l0bc7h:
+ push af ;0bc7 f5 .
+ call sub_0bdch ;0bc8 cd dc 0b . . .
+ call outbl4 ;0bcb cd 99 02 . . .
+ pop af ;0bce f1 .
+ inc a ;0bcf 3c <
+ bit 0,a ;0bd0 cb 47 . G
+ push af ;0bd2 f5 .
+ call z,crlf ;0bd3 cc a3 02 . . .
+ pop af ;0bd6 f1 .
+ cp YREG_CNT ;0bd7 fe 0a . .
+ jr c,l0bc7h ;0bd9 38 ec 8 .
+ ret ;0bdb c9 .
+
+sub_0bdch:
+ ld c,a ;0bdc 4f O
+ ld b,0 ;0bdd 06 00 . .
+ add a,'0'+080h ;0bdf c6 b0 . .
+ ld de,msg_Y+1 ;0be1 11 9d 0b . . .
+ ld (de),a ;0be4 12 .
+ dec de ;0be5 1b .
+ ld hl,reg_Y ;0be6 21 9e 0b ! . .
+ add hl,bc ;0be9 09 .
+ add hl,bc ;0bea 09 .
+ ex de,hl ;0beb eb .
+ ld c,003h ;0bec 0e 03 . .
+ jp l0c33h ;0bee c3 33 0c . 3 .
+
+cmd_X:
+ call skipbl ;0bf1 cd bf 02 . . .
+ call sub_0caeh ;0bf4 cd ae 0c . . .
+ jp nc,prnt_cpustat0 ;0bf7 d2 2d 06 . - .
+ call assert_eol ;0bfa cd d6 02 . . .
+ ld a,b ;0bfd 78 x
+ cp 01eh ;0bfe fe 1e . .
+ jr z,l0c5fh ;0c00 28 5d ( ]
+ cp 01fh ;0c02 fe 1f . .
+ jr z,l0c4fh ;0c04 28 49 ( I
+ cp 01dh ;0c06 fe 1d . .
+ jp z,ERROR ;0c08 ca 07 01 . . .
+ ex de,hl ;0c0b eb .
+ ld hl,b_0cc3_start ;0c0c 21 c3 0c ! . .
+ call sub_033dh ;0c0f cd 3d 03 . = .
+l0c12h:
+ call l0c33h ;0c12 cd 33 0c . 3 .
+l0c15h:
+ call outbl ;0c15 cd 9f 02 . . .
+ push de ;0c18 d5 .
+ push bc ;0c19 c5 .
+ call get_line ;0c1a cd 4e 01 . N .
+ call skipbl ;0c1d cd bf 02 . . .
+ jr z,l0c30h ;0c20 28 0e ( .
+ call sub_0363h ;0c22 cd 63 03 . c .
+ ld b,h ;0c25 44 D
+ ld c,l ;0c26 4d M
+ pop af ;0c27 f1 .
+ pop hl ;0c28 e1 .
+ ld (hl),c ;0c29 71 q
+ bit 0,a ;0c2a cb 47 . G
+ ret z ;0c2c c8 .
+ inc hl ;0c2d 23 #
+ ld (hl),b ;0c2e 70 p
+ ret ;0c2f c9 .
+l0c30h:
+ pop af ;0c30 f1 .
+ pop hl ;0c31 e1 .
+ ret ;0c32 c9 .
+l0c33h:
+ ld b,c ;0c33 41 A
+ call pstr ;0c34 cd 88 02 . . .
+ ld a,'=' ;0c37 3e 3d > =
+ call outchar ;0c39 cd 5d 02 . ] .
+ ld a,(de) ;0c3c 1a .
+ bit 0,b ;0c3d cb 40 . @
+ jp z,out_hex ;0c3f ca 18 02 . . .
+ ld l,a ;0c42 6f o
+ inc de ;0c43 13 .
+ ld a,(de) ;0c44 1a .
+ dec de ;0c45 1b .
+ ld h,a ;0c46 67 g
+ bit 1,b ;0c47 cb 48 . H
+ jp z,out_hl ;0c49 ca 13 02 . . .
+ jp out.hl.@ ;0c4c c3 a4 01 . . .
+
+l0c4fh:
+ call prnt_f ;0c4f cd 6e 06 . n .
+ ld a,0f3h ;0c52 3e f3 > .
+ ld (reg.iff),a ;0c54 32 5e 00 2 ^ .
+ scf ;0c57 37 7
+ call sub_0c6ah ;0c58 cd 6a 0c . j .
+ ld (reg.f),a ;0c5b 32 54 00 2 T .
+ ret ;0c5e c9 .
+l0c5fh:
+ call prnt_f2 ;0c5f cd 81 06 . . .
+ and a ;0c62 a7 .
+ call sub_0c6ah ;0c63 cd 6a 0c . j .
+ ld (reg.f2),a ;0c66 32 4c 00 2 L .
+ ret ;0c69 c9 .
+sub_0c6ah:
+ ex af,af' ;0c6a 08 .
+ ld b,000h ;0c6b 06 00 . .
+ call outbl ;0c6d cd 9f 02 . . .
+ call assert_eol ;0c70 cd d6 02 . . .
+ call get_line ;0c73 cd 4e 01 . N .
+l0c76h:
+ call skipbl ;0c76 cd bf 02 . . .
+ ld a,b ;0c79 78 x
+ ret z ;0c7a c8 .
+ push bc ;0c7b c5 .
+ ld hl,b_0ca4_start ;0c7c 21 a4 0c ! . .
+ call lookupch ;0c7f cd f3 02 . . .
+ jp nc,ERROR ;0c82 d2 07 01 . . .
+ ld a,b ;0c85 78 x
+ cp 008h ;0c86 fe 08 . .
+ jr z,l0c97h ;0c88 28 0d ( .
+ pop bc ;0c8a c1 .
+ rlca ;0c8b 07 .
+ rlca ;0c8c 07 .
+ rlca ;0c8d 07 .
+ add a,0c0h ;0c8e c6 c0 . .
+ ld (l0c94h),a ;0c90 32 94 0c 2 . .
+ defb 0cbh ;0c93 cb .
+l0c94h:
+ defb 0c0h ;0c94 c0 .
+ jr l0c76h ;0c95 18 df . .
+l0c97h:
+ ex af,af' ;0c97 08 .
+ jp nc,ERROR ;0c98 d2 07 01 . . .
+ ex af,af' ;0c9b 08 .
+ ld a,0fbh ;0c9c 3e fb > .
+ ld (reg.iff),a ;0c9e 32 5e 00 2 ^ .
+ pop bc ;0ca1 c1 .
+ jr l0c76h ;0ca2 18 d2 . .
+
+b_0ca4_start:
+ db 'CNV H ZSE',0
+
+sub_0caeh:
+ call sub_0303h ;0cae cd 03 03 . . .
+ ret nc ;0cb1 d0 .
+ ld a,b ;0cb2 78 x
+ add a,b ;0cb3 80 .
+ add a,b ;0cb4 80 .
+ ld hl,b_0cfa_start ;0cb5 21 fa 0c ! . .
+ call add_hl_a ;0cb8 cd b9 02 . . .
+ ld c,(hl) ;0cbb 4e N
+ inc hl ;0cbc 23 #
+ ld a,(hl) ;0cbd 7e ~
+ inc hl ;0cbe 23 #
+ ld h,(hl) ;0cbf 66 f
+ ld l,a ;0cc0 6f o
+ scf ;0cc1 37 7
+ ret ;0cc2 c9 .
+
+b_0cc3_start:
+ DC 'BC'''
+ DC 'DE'''
+ DC 'HL'''
+ DC 'BC'
+ DC 'DE'
+ DC 'HL'
+ DC 'A'''
+ DC 'B'''
+ DC 'C'''
+ DC 'D'''
+ DC 'E'''
+ DC 'H'''
+ DC 'L'''
+ DC 'A'
+ DC 'B'
+ DC 'C'
+ DC 'D'
+ DC 'E'
+ DC 'H'
+ DC 'L'
+ DC 'IX'
+ DC 'IY'
+ DC 'SP'
+ DC 'PC'
+ DC 'X'
+ DC 'Y'
+ DC 'S'
+ DC 'P'
+ DC 'I'
+ DC 'IP'
+ DC 'F'''
+ DC 'F'
+ DB 0
+
+b_0cfa_start:
+ defb 003h ;0cfa 03 .
+ defw reg.c2 ;0cfb 4a 00 J .
+ defb 003h ;0cfd 03 .
+ defw reg.e2 ;0cfe 48 00 H .
+ defb 003h ;0d00 03 .
+ defw reg.l2 ;0d01 46 00 F .
+ defb 003h ;0d03 03 .
+ defw reg.c ;0d04 56 00 V .
+ defb 003h ;0d06 03 .
+ defw reg.e ;0d07 58 00 X .
+ defb 003h ;0d09 03 .
+ defw reg.l ;0d0a 5a 00 Z .
+ defb 000h ;0d0c 00 .
+ defw reg.a2 ;0d0d 4d 00 M .
+ defb 000h ;0d0f 00 .
+ defw reg.b2 ;0d10 4b 00 K .
+ defb 000h ;0d12 00 .
+ defw reg.c2 ;0d13 4a 00 J .
+ defb 000h ;0d15 00 .
+ defw reg.d2 ;0d16 49 00 I .
+ defb 000h ;0d18 00 .
+ defw reg.e2 ;0d19 48 00 H .
+ defb 000h ;0d1b 00 .
+ defw reg.h2 ;0d1c 47 00 G .
+ defb 000h ;0d1e 00 .
+ defw reg.l2 ;0d1f 46 00 F .
+ defb 000h ;0d21 00 .
+ defw reg.a ;0d22 55 00 U .
+ defb 000h ;0d24 00 .
+ defw reg.b ;0d25 57 00 W .
+ defb 000h ;0d27 00 .
+ defw reg.c ;0d28 56 00 V .
+ defb 000h ;0d2a 00 .
+ defw reg.d ;0d2b 59 00 Y .
+ defb 000h ;0d2d 00 .
+ defw reg.e ;0d2e 58 00 X .
+ defb 000h ;0d30 00 .
+ defw reg.h ;0d31 5b 00 [ .
+ defb 000h ;0d33 00 .
+ defw reg.l ;0d34 5a 00 Z .
+ defb 003h ;0d36 03 .
+ defw reg.ix ;0d37 52 00 R .
+ defb 003h ;0d39 03 .
+ defw reg.iy ;0d3a 50 00 P .
+ defb 003h ;0d3c 03 .
+ defw reg_sp ;0d3d 5c 00 \ .
+ defb 003h ;0d3f 03 .
+ defw REG.PC ;0d40 60 00 ` .
+ defb 003h ;0d42 03 .
+ defw reg.ix ;0d43 52 00 R .
+ defb 003h ;0d45 03 .
+ defw reg.iy ;0d46 50 00 P .
+ defb 003h ;0d48 03 .
+ defw reg_sp ;0d49 5c 00 \ .
+ defb 003h ;0d4b 03 .
+ defw REG.PC ;0d4c 60 00 ` .
+ defb 000h ;0d4e 00 .
+ defw reg.i ;0d4f 4f 00 O .
+ defb 003h ;0d51 03 .
+ defw l004eh ;0d52 4e 00 N .
+ defb 000h ;0d54 00 .
+ defw reg.f2 ;0d55 4c 00 L .
+ defb 000h ;0d57 00 .
+ defw reg.f ;0d58 54 00 T .
+
+cmd_S:
+ ld hl,(last_S) ;0d5a 2a 90 0d * . .
+ call get_lastarg_def ;0d5d cd 69 03 . i .
+l0d60h:
+ ld (last_S),hl ;0d60 22 90 0d " . .
+ call out.hl.@ ;0d63 cd a4 01 . . .
+ call outbl ;0d66 cd 9f 02 . . .
+ ld a,(hl) ;0d69 7e ~
+ call out_hex ;0d6a cd 18 02 . . .
+ call outbl2 ;0d6d cd 9c 02 . . .
+ call get_line ;0d70 cd 4e 01 . N .
+ call skipbl ;0d73 cd bf 02 . . .
+ inc hl ;0d76 23 #
+ jr z,l0d60h ;0d77 28 e7 ( .
+ dec hl ;0d79 2b +
+ inc de ;0d7a 13 .
+ cp '.' ;0d7b fe 2e . .
+ jp z,assert_eol ;0d7d ca d6 02 . . .
+ cp '-' ;0d80 fe 2d . -
+ jr nz,l0d8ah ;0d82 20 06 .
+ ld a,(de) ;0d84 1a .
+ or a ;0d85 b7 .
+ dec hl ;0d86 2b +
+ jr z,l0d60h ;0d87 28 d7 ( .
+ inc hl ;0d89 23 #
+l0d8ah:
+ dec de ;0d8a 1b .
+ call sub_0ef8h ;0d8b cd f8 0e . . .
+ jr l0d60h ;0d8e 18 d0 . .
+
+last_S:
+ defw TPA ;0d90 00 01 . .
+cmd_@:
+ call assert_eol ;0d92 cd d6 02 . . .
+ ld hl,msg_offset ;0d95 21 a0 0d ! . .
+ ld de,offs.@ ;0d98 11 64 00 . d .
+ ld c,001h ;0d9b 0e 01 . .
+ jp l0c12h ;0d9d c3 12 0c . . .
+
+msg_offset:
+ dc '@' ;0da0 c0 .
+
+last_I:
+ defw 0 ;0da1 00 00 . .
+cmd_I:
+ ld hl,cmd_I ;0da3 21 a3 0d ! . .
+ ld (cmd_rpt),hl ;0da6 22 68 00 " h .
+ ld hl,(last_I) ;0da9 2a a1 0d * . .
+ call get_lastarg_def ;0dac cd 69 03 . i .
+ ld (last_I),hl ;0daf 22 a1 0d " . .
+ ld b,h ;0db2 44 D
+ ld c,l ;0db3 4d M
+ in a,(c) ;0db4 ed 78 . x
+ push af ;0db6 f5 .
+ call out_hex ;0db7 cd 18 02 . . .
+ call outbl4 ;0dba cd 99 02 . . .
+ pop af ;0dbd f1 .
+ call out.bin.b ;0dbe cd c7 01 . . .
+ jp crlf ;0dc1 c3 a3 02 . . .
+
+last_O_addr:
+ dw 0 ;0dc4 00 .
+last_O_val:
+ db 0 ;0dc6 00 .
+cmd_O:
+ ld hl,cmd_O ;0dc7 21 c7 0d ! . .
+ ld (cmd_rpt),hl ;0dca 22 68 00 " h .
+ ld hl,(last_O_val) ;0dcd 2a c6 0d * . .
+ call get_arg_def ;0dd0 cd 6e 03 . n .
+ ld a,l ;0dd3 7d }
+ ld (last_O_val),a ;0dd4 32 c6 0d 2 . .
+ push af ;0dd7 f5 .
+ call next_arg ;0dd8 cd ca 02 . . .
+ ld hl,(last_O_addr) ;0ddb 2a c4 0d * . .
+ call get_lastarg_def ;0dde cd 69 03 . i .
+ ld (last_O_addr),hl ;0de1 22 c4 0d " . .
+ ld b,h ;0de4 44 D
+ ld c,l ;0de5 4d M
+ pop af ;0de6 f1 .
+ out (c),a ;0de7 ed 79 . y
+ ret ;0de9 c9 .
+
+cmd_V:
+ call sub_034eh ;0dea cd 4e 03 . N .
+l0dedh:
+ push bc ;0ded c5 .
+ ld a,(de) ;0dee 1a .
+ ld b,(hl) ;0def 46 F
+ cp b ;0df0 b8 .
+ jr z,l0e10h ;0df1 28 1d ( .
+ ld c,a ;0df3 4f O
+ call out.hl.@ ;0df4 cd a4 01 . . .
+ call outbl ;0df7 cd 9f 02 . . .
+ ld a,b ;0dfa 78 x
+ call out_hex ;0dfb cd 18 02 . . .
+ call outbl2 ;0dfe cd 9c 02 . . .
+ ld a,c ;0e01 79 y
+ call out_hex ;0e02 cd 18 02 . . .
+ call outbl ;0e05 cd 9f 02 . . .
+ ex de,hl ;0e08 eb .
+ call out.hl.@ ;0e09 cd a4 01 . . .
+ ex de,hl ;0e0c eb .
+ call crlf ;0e0d cd a3 02 . . .
+l0e10h:
+ pop bc ;0e10 c1 .
+ inc hl ;0e11 23 #
+ inc de ;0e12 13 .
+ dec bc ;0e13 0b .
+ ld a,b ;0e14 78 x
+ or c ;0e15 b1 .
+ jr nz,l0dedh ;0e16 20 d5 .
+ ret ;0e18 c9 .
+
+cmd_M:
+ ld a,(de) ;0e19 1a .
+ cp 'V' ;0e1a fe 56 . V
+ jr nz,l0e1fh ;0e1c 20 01 .
+ inc de ;0e1e 13 .
+l0e1fh:
+ push af ;0e1f f5 .
+ call sub_034eh ;0e20 cd 4e 03 . N .
+ push hl ;0e23 e5 .
+ push de ;0e24 d5 .
+ push bc ;0e25 c5 .
+ call cp_hl_de ;0e26 cd ee 02 . . .
+ jr nc,$+11 ;0e29 30 09 0 .
+ add hl,bc ;0e2b 09 .
+ ex de,hl ;0e2c eb .
+ add hl,bc ;0e2d 09 .
+ ex de,hl ;0e2e eb .
+ dec hl ;0e2f 2b +
+ dec de ;0e30 1b .
+ lddr ;0e31 ed b8 . .
+ ld bc,0b0edh ;0e33 01 ed b0 . . .
+ pop bc ;0e36 c1 .
+ pop de ;0e37 d1 .
+ pop hl ;0e38 e1 .
+ pop af ;0e39 f1 .
+ jr z,l0dedh ;0e3a 28 b1 ( .
+ ret ;0e3c c9 .
+
+cmd_H:
+ call expr ;0e3d cd be 03 . . .
+ jp c,prnt_max_high0 ;0e40 da 6f 11 . o .
+ call next_arg ;0e43 cd ca 02 . . .
+ push hl ;0e46 e5 .
+ call expr ;0e47 cd be 03 . . .
+ push af ;0e4a f5 .
+ call assert_eol ;0e4b cd d6 02 . . .
+ pop af ;0e4e f1 .
+ ex de,hl ;0e4f eb .
+ pop hl ;0e50 e1 .
+ jr c,l0e5eh ;0e51 38 0b 8 .
+ push hl ;0e53 e5 .
+ push de ;0e54 d5 .
+ add hl,de ;0e55 19 .
+ call l0e5eh ;0e56 cd 5e 0e . ^ .
+ pop de ;0e59 d1 .
+ pop hl ;0e5a e1 .
+ and a ;0e5b a7 .
+ sbc hl,de ;0e5c ed 52 . R
+l0e5eh:
+ call out_hl ;0e5e cd 13 02 . . .
+ call outbl2 ;0e61 cd 9c 02 . . .
+ call out_hl_neg ;0e64 cd 0a 02 . . .
+ call outbl4 ;0e67 cd 99 02 . . .
+ call out.hl.dec ;0e6a cd e7 01 . . .
+ call outbl2 ;0e6d cd 9c 02 . . .
+ call out_hl_dec_neg ;0e70 cd e2 01 . . .
+ call outbl4 ;0e73 cd 99 02 . . .
+ call out.bin.w ;0e76 cd c2 01 . . .
+ call outbl2 ;0e79 cd 9c 02 . . .
+ ld a,l ;0e7c 7d }
+ call out.ascii ;0e7d cd 34 02 . 4 .
+ jp crlf ;0e80 c3 a3 02 . . .
+
+cmd_Q_jopt:
+ db -1 ;0e83 ff .
+
+cmd_Q:
+ ld a,(de) ;0e84 1a .
+ sub 'J' ;0e85 d6 4a . J
+ ld (cmd_Q_jopt),a ;0e87 32 83 0e 2 . .
+ jr nz,l0e8dh ;0e8a 20 01 .
+ inc de ;0e8c 13 .
+l0e8dh:
+ call get_arg_range ;0e8d cd 7d 03 . } .
+ push bc ;0e90 c5 .
+ push hl ;0e91 e5 .
+ call sub_0ee6h ;0e92 cd e6 0e . . .
+ pop hl ;0e95 e1 .
+l0e96h:
+ call sub_0ed7h ;0e96 cd d7 0e . . .
+ jr nz,l0eb0h ;0e99 20 15 .
+ push bc ;0e9b c5 .
+ push hl ;0e9c e5 .
+ ld a,(cmd_Q_jopt) ;0e9d 3a 83 0e : . .
+ or a ;0ea0 b7 .
+ jr nz,l0ea7h ;0ea1 20 04 .
+ ld bc,-8 ;0ea3 01 f8 ff . . .
+ add hl,bc ;0ea6 09 .
+l0ea7h:
+ ld bc,16 ;0ea7 01 10 00 . . .
+ and a ;0eaa a7 .
+ call sub_0f58h ;0eab cd 58 0f . X .
+ pop hl ;0eae e1 .
+ pop bc ;0eaf c1 .
+l0eb0h:
+ inc hl ;0eb0 23 #
+ ex (sp),hl ;0eb1 e3 .
+ dec hl ;0eb2 2b +
+ ld a,h ;0eb3 7c |
+ or l ;0eb4 b5 .
+ ex (sp),hl ;0eb5 e3 .
+ jr nz,l0e96h ;0eb6 20 de .
+ pop bc ;0eb8 c1 .
+ ret ;0eb9 c9 .
+
+cmd_Z:
+ call get_arg_range ;0eba cd 7d 03 . } .
+ push bc ;0ebd c5 .
+ push hl ;0ebe e5 .
+ call sub_0ee6h ;0ebf cd e6 0e . . .
+ ld a,b ;0ec2 78 x
+ pop hl ;0ec3 e1 .
+ pop bc ;0ec4 c1 .
+ push hl ;0ec5 e5 .
+ ex de,hl ;0ec6 eb .
+l0ec7h:
+ ldi ;0ec7 ed a0 . .
+ jp po,l0ed3h ;0ec9 e2 d3 0e . . .
+ dec a ;0ecc 3d =
+ jr nz,l0ec7h ;0ecd 20 f8 .
+ pop hl ;0ecf e1 .
+ ldir ;0ed0 ed b0 . .
+ ret ;0ed2 c9 .
+l0ed3h:
+ pop hl ;0ed3 e1 .
+ ret ;0ed4 c9 .
+
+last_D:
+ dw TPA
+
+sub_0ed7h:
+ push hl ;0ed7 e5 d5 . .
+ push de
+ push bc ;0ed9 c5 .
+l0edah:
+ ld a,(de) ;0eda 1a .
+ cp (hl) ;0edb be .
+ jr nz,l0ee2h ;0edc 20 04 .
+ inc de ;0ede 13 .
+ inc hl ;0edf 23 #
+ djnz l0edah ;0ee0 10 f8 . .
+l0ee2h:
+ pop bc ;0ee2 c1 .
+ pop de ;0ee3 d1 .
+ pop hl ;0ee4 e1 .
+ ret ;0ee5 c9 .
+
+sub_0ee6h:
+ ld hl,conbuf+1 ;0ee6 21 6b 00 ! k .
+ call sub_0ef7h ;0ee9 cd f7 0e . . .
+ ld de,conbuf+1 ;0eec 11 6b 00 . k .
+ and a ;0eef a7 .
+ sbc hl,de ;0ef0 ed 52 . R
+ ld b,l ;0ef2 45 E
+ ret nz ;0ef3 c0 .
+ jp ERROR ;0ef4 c3 07 01 . . .
+
+sub_0ef7h:
+ db 0e6h ;0ef7 e6 and 037h (clear carry)
+sub_0ef8h:
+ scf ;0ef8 37 . 7
+l0ef9h:
+ push af ;0ef9 f5 .
+ call next_arg ;0efa cd ca 02 . . .
+ cp 'W' ;0efd fe 57 . W
+ jr nz,l0f0eh ;0eff 20 0d .
+ inc de ;0f01 13 .
+ push hl ;0f02 e5 .
+ call sub_035dh ;0f03 cd 5d 03 . ] .
+ ex de,hl ;0f06 eb .
+ ex (sp),hl ;0f07 e3 .
+ ld (hl),e ;0f08 73 s
+ inc hl ;0f09 23 #
+ ld a,d ;0f0a 7a z
+ pop de ;0f0b d1 .
+ jr l0f1ah ;0f0c 18 0c . .
+l0f0eh:
+ cp '''' ;0f0e fe 27 . '
+ jr z,l0f1eh ;0f10 28 0c ( .
+ push hl ;0f12 e5 .
+ call expr ;0f13 cd be 03 . . .
+ ld a,l ;0f16 7d }
+ pop hl ;0f17 e1 .
+ jr c,l0f42h ;0f18 38 28 8 (
+l0f1ah:
+ ld (hl),a ;0f1a 77 w
+ inc hl ;0f1b 23 #
+ jr l0f3ah ;0f1c 18 1c . .
+l0f1eh:
+ inc de ;0f1e 13 .
+ ld a,(de) ;0f1f 1a .
+ cp '''' ;0f20 fe 27 . '
+ jr z,l0f2bh ;0f22 28 07 ( .
+ or a ;0f24 b7 .
+ jr z,l0f42h ;0f25 28 1b ( .
+l0f27h:
+ ld (hl),a ;0f27 77 w
+ inc hl ;0f28 23 #
+ jr l0f1eh ;0f29 18 f3 . .
+l0f2bh:
+ inc de ;0f2b 13 .
+ ld a,(de) ;0f2c 1a .
+ cp '''' ;0f2d fe 27 . '
+ jr z,l0f27h ;0f2f 28 f6 ( .
+ cp '.' ;0f31 fe 2e . .
+ jr nz,l0f3ah ;0f33 20 05 .
+ inc de ;0f35 13 .
+ dec hl ;0f36 2b +
+ set 7,(hl) ;0f37 cb fe . .
+ inc hl ;0f39 23 #
+l0f3ah:
+ pop af ;0f3a f1 .
+ jr nc,l0ef9h ;0f3b 30 bc 0 .
+ ld (last_S),hl ;0f3d 22 90 0d " . .
+ jr l0ef9h ;0f40 18 b7 . .
+l0f42h:
+ pop af ;0f42 f1 .
+ ret nc ;0f43 d0 .
+ ld (last_S),hl ;0f44 22 90 0d " . .
+ ret ;0f47 c9 .
+
+cmd_D:
+ ld hl,cmd_D ;0f48 21 48 0f ! H .
+ ld (cmd_rpt),hl ;0f4b 22 68 00 " h .
+ ld hl,(last_D) ;0f4e 2a d5 0e * . .
+ ld bc,128 ;0f51 01 80 00 . . .
+ call sub_0377h ;0f54 cd 77 03 . w .
+ scf ;0f57 37 7
+sub_0f58h:
+ push bc ;0f58 c5 .
+ push de ;0f59 d5 .
+ push hl ;0f5a e5 .
+ ex af,af' ;0f5b 08 .
+l0f5ch:
+ call out.hl.@ ;0f5c cd a4 01 . . .
+ call z,outbl2 ;0f5f cc 9c 02 . . .
+ call outbl ;0f62 cd 9f 02 . . .
+ ld de,0 ;0f65 11 00 00 . . .
+l0f68h:
+ ld a,(hl) ;0f68 7e ~
+ inc hl ;0f69 23 #
+ call out_hex ;0f6a cd 18 02 . . .
+ call outbl ;0f6d cd 9f 02 . . .
+ dec bc ;0f70 0b .
+ inc e ;0f71 1c .
+ ld a,e ;0f72 7b {
+ cp 010h ;0f73 fe 10 . .
+ jr z,l0f80h ;0f75 28 09 ( .
+ and 003h ;0f77 e6 03 . .
+ call z,outbl ;0f79 cc 9f 02 . . .
+ ld a,b ;0f7c 78 x
+ or c ;0f7d b1 .
+ jr nz,l0f68h ;0f7e 20 e8 .
+l0f80h:
+ call outbl ;0f80 cd 9f 02 . . .
+ and a ;0f83 a7 .
+ sbc hl,de ;0f84 ed 52 . R
+l0f86h:
+ ld a,(hl) ;0f86 7e ~
+ call sub_0fa3h ;0f87 cd a3 0f . . .
+ call outchar ;0f8a cd 5d 02 . ] .
+ inc hl ;0f8d 23 #
+ dec e ;0f8e 1d .
+ jr nz,l0f86h ;0f8f 20 f5 .
+ ex af,af' ;0f91 08 .
+ jr nc,l0f97h ;0f92 30 03 0 .
+ ld (last_D),hl ;0f94 22 d5 0e " . .
+l0f97h:
+ ex af,af' ;0f97 08 .
+ call crlf ;0f98 cd a3 02 . . .
+ ld a,b ;0f9b 78 x
+ or c ;0f9c b1 .
+ jr nz,l0f5ch ;0f9d 20 bd .
+ pop hl ;0f9f e1 .
+ pop de ;0fa0 d1 .
+ pop bc ;0fa1 c1 .
+ ret ;0fa2 c9 .
+
+sub_0fa3h:
+ and 07fh ;0fa3 e6 7f . 
+ cp 07fh ;0fa5 fe 7f . 
+ jr z,l0fach ;0fa7 28 03 ( .
+ cp ' ' ;0fa9 fe 20 .
+ ret nc ;0fab d0 .
+l0fach:
+ ld a,'.' ;0fac 3e 2e > .
+ ret ;0fae c9 .
+
+cmd_F:
+ push de ;0faf d5 .
+ ld hl,DMA_BUF+1 ;0fb0 21 81 00 ! . .
+ ld (hl),' ' ;0fb3 36 20 6
+ inc hl ;0fb5 23 #
+l0fb6h:
+ ld a,(de) ;0fb6 1a .
+ ld (hl),a ;0fb7 77 w
+ inc hl ;0fb8 23 #
+ inc de ;0fb9 13 .
+ and a ;0fba a7 .
+ jr nz,l0fb6h ;0fbb 20 f9 .
+ ld a,l ;0fbd 7d }
+ sub DMA_BUF+2 ;0fbe d6 82 . .
+ ld (DMA_BUF),a ;0fc0 32 80 00 2 . .
+ pop hl ;0fc3 e1 .
+ ld de,FCB ;0fc4 11 5c 00 . \ .
+ call parse_filename ;0fc7 cd cd 0f . . .
+ ld de,FCB2 ;0fca 11 6c 00 . l .
+
+parse_filename:
+ call sub_102ch ;0fcd cd 2c 10 . , .
+ push de ;0fd0 d5 .
+ push bc ;0fd1 c5 .
+ ld b,(hl) ;0fd2 46 F
+ inc hl ;0fd3 23 #
+ ld a,(hl) ;0fd4 7e ~
+ cp ':' ;0fd5 fe 3a . :
+ jr nz,l0fe1h ;0fd7 20 08 .
+ inc hl ;0fd9 23 #
+ ld a,b ;0fda 78 x
+ sub 040h ;0fdb d6 40 . @
+ and 01fh ;0fdd e6 1f . .
+ jr l0fe3h ;0fdf 18 02 . .
+l0fe1h:
+ dec hl ;0fe1 2b +
+ xor a ;0fe2 af .
+l0fe3h:
+ ld (de),a ;0fe3 12 .
+ inc de ;0fe4 13 .
+ ld b,8 ;0fe5 06 08 . .
+ call sub_0ff2h ;0fe7 cd f2 0f . . .
+ ld b,3 ;0fea 06 03 . .
+ call sub_0ff2h ;0fec cd f2 0f . . .
+ pop bc ;0fef c1 .
+ pop de ;0ff0 d1 .
+ ret ;0ff1 c9 .
+
+sub_0ff2h:
+ call sub_1012h ;0ff2 cd 12 10 . . .
+ jr z,l0ffeh ;0ff5 28 07 ( .
+ inc hl ;0ff7 23 #
+ ld (de),a ;0ff8 12 .
+ inc de ;0ff9 13 .
+ djnz sub_0ff2h ;0ffa 10 f6 . .
+ jr l1003h ;0ffc 18 05 . .
+l0ffeh:
+ ld a,c ;0ffe 79 y
+l0fffh:
+ ld (de),a ;0fff 12 .
+ inc de ;1000 13 .
+ djnz l0fffh ;1001 10 fc . .
+l1003h:
+ call sub_1012h ;1003 cd 12 10 . . .
+ inc hl ;1006 23 #
+ jr nz,l1003h ;1007 20 fa .
+ cp '*' ;1009 fe 2a . *
+ jr z,l1003h ;100b 28 f6 ( .
+ cp '.' ;100d fe 2e . .
+ ret z ;100f c8 .
+ dec hl ;1010 2b +
+ ret ;1011 c9 .
+
+sub_1012h:
+ ld a,(hl) ;1012 7e ~
+ ld c,' ' ;1013 0e 20 .
+ and 01fh ;1015 e6 1f . .
+ ret z ;1017 c8 .
+ ld a,(hl) ;1018 7e ~
+ cp ' ' ;1019 fe 20 .
+ ret z ;101b c8 .
+ call sub_1043h ;101c cd 43 10 . C .
+ ret z ;101f c8 .
+ cp '/' ;1020 fe 2f . /
+ ret z ;1022 c8 .
+ cp '.' ;1023 fe 2e . .
+ ret z ;1025 c8 .
+ ld c,'?' ;1026 0e 3f . ?
+ cp '*' ;1028 fe 2a . *
+ ret ;102a c9 .
+
+l102bh:
+ inc hl ;102b 23 #
+sub_102ch:
+ ld a,(hl) ;102c 7e ~
+ cp '/' ;102d fe 2f . /
+ jr z,l103bh ;102f 28 0a ( .
+ call sub_1043h ;1031 cd 43 10 . C .
+ jr z,l102bh ;1034 28 f5 ( .
+l1036h:
+ cp ' ' ;1036 fe 20 .
+ jr z,l102bh ;1038 28 f1 ( .
+ ret ;103a c9 .
+
+l103bh:
+ ld a,(hl) ;103b 7e ~
+ cp ' '+1 ;103c fe 21 . !
+ jr c,l1036h ;103e 38 f6 8 .
+ inc hl ;1040 23 #
+ jr l103bh ;1041 18 f8 . .
+
+sub_1043h:
+ cp '=' ;1043 fe 3d . =
+ ret z ;1045 c8 .
+ cp '_' ;1046 fe 5f . _
+ ret z ;1048 c8 .
+ cp ',' ;1049 fe 2c . ,
+ ret ;104b c9 .
+
+fcb_clear_rc:
+ xor a ;104c af .
+ ld hl,FCB+12 ;104d 21 68 00 ! h .
+ ld b,21 ;1050 06 15 . .
+l1052h:
+ ld (hl),a ;1052 77 w
+ inc hl ;1053 23 #
+ djnz l1052h ;1054 10 fc . .
+ ld de,DMA_BUF ;1056 11 80 00 . . .
+ ld c,BDOS_SETDMA ;1059 0e 1a . .
+ call ddtz_base ;105b cd 00 00 . . .
+ ld de,FCB ;105e 11 5c 00 . \ .
+ ret ;1061 c9 .
+
+cmd_R:
+ ld hl,0 ;1062 21 00 00 ! . .
+ call get_lastarg_def ;1065 cd 69 03 . i .
+read_file:
+ push hl ;1068 e5 .
+ ld hl,0 ;1069 21 00 00 ! . .
+ ld (high_load),hl ;106c 22 9c 11 " . .
+ call fcb_clear_rc ;106f cd 4c 10 . L .
+ ld c,BDOS_OPEN ;1072 0e 0f . .
+ call ddtz_base ;1074 cd 00 00 . . .
+ inc a ;1077 3c <
+ jp z,ERROR ;1078 ca 07 01 . . .
+ ld hl,FCB+9 ;107b 21 65 00 ! e .
+ ld de,str_hex ;107e 11 a5 10 . . .
+ ld b,3 ;1081 06 03 . .
+ call strncmp ;1083 cd 67 11 . g .
+ pop hl ;1086 e1 .
+ jr z,read_hexfile ;1087 28 1f ( .
+ ld de,TPA ;1089 11 00 01 . . .
+ add hl,de ;108c 19 .
+ push hl ;108d e5 .
+l108eh:
+ call read_sector ;108e cd 21 11 . ! .
+ pop hl ;1091 e1 .
+ jp z,prnt_max_high ;1092 ca 72 11 . r .
+ ld de,DMA_BUF ;1095 11 80 00 . . .
+ ld b,080h ;1098 06 80 . .
+l109ah:
+ ld a,(de) ;109a 1a .
+ call cmdR_storebyte ;109b cd 36 11 . 6 .
+ inc de ;109e 13 .
+ inc hl ;109f 23 #
+ djnz l109ah ;10a0 10 f8 . .
+ push hl ;10a2 e5 .
+ jr l108eh ;10a3 18 e9 . .
+
+str_hex:
+ db 'HEX' ;10a5 48 H E X
+
+read_hexfile:
+ push hl ;10a8 e5 .
+ ld a,080h ;10a9 3e 80 > .
+ ld (cmdR_rindex),a ;10ab 32 20 11 2 .
+l10aeh:
+ call read_byte ;10ae cd 05 11 . . .
+ jr z,rdhex_done ;10b1 28 31 ( 1
+ cp ':' ;10b3 fe 3a . :
+ jr nz,l10aeh ;10b5 20 f7 .
+ ld c,0 ;10b7 0e 00 . .
+ call read_hexchar ;10b9 cd e8 10 . . .
+ ld b,a ;10bc 47 G
+ call read_hexchar ;10bd cd e8 10 . . .
+ ld h,a ;10c0 67 g
+ call read_hexchar ;10c1 cd e8 10 . . .
+ ld l,a ;10c4 6f o
+ ld a,b ;10c5 78 x
+ and a ;10c6 a7 .
+ jr z,rdhex_done ;10c7 28 1b ( .
+ call read_hexchar ;10c9 cd e8 10 . . .
+l10cch:
+ call read_hexchar ;10cc cd e8 10 . . .
+ pop de ;10cf d1 .
+ push de ;10d0 d5 .
+ push hl ;10d1 e5 .
+ add hl,de ;10d2 19 .
+ call cmdR_storebyte ;10d3 cd 36 11 . 6 .
+ pop hl ;10d6 e1 .
+ inc hl ;10d7 23 #
+ djnz l10cch ;10d8 10 f2 . .
+ call read_hexchar ;10da cd e8 10 . . .
+ ld a,c ;10dd 79 y
+ and a ;10de a7 .
+ jp nz,ERROR ;10df c2 07 01 . . .
+ jr l10aeh ;10e2 18 ca . .
+rdhex_done:
+ pop hl ;10e4 e1 .
+ jp prnt_max_high ;10e5 c3 72 11 . r .
+
+read_hexchar:
+ call read_hexdigit ;10e8 cd f9 10 . . .
+ rlca ;10eb 07 .
+ rlca ;10ec 07 .
+ rlca ;10ed 07 .
+ rlca ;10ee 07 .
+ ld d,a ;10ef 57 W
+ call read_hexdigit ;10f0 cd f9 10 . . .
+ add a,d ;10f3 82 .
+ ld d,a ;10f4 57 W
+ add a,c ;10f5 81 .
+ ld c,a ;10f6 4f O
+ ld a,d ;10f7 7a z
+ ret ;10f8 c9 .
+
+read_hexdigit:
+ call read_byte ;10f9 cd 05 11 . . .
+ jr z,l1102h ;10fc 28 04 ( .
+ call hex_digit ;10fe cd 12 06 . . .
+ ret nc ;1101 d0 .
+l1102h:
+ jp ERROR ;1102 c3 07 01 . . .
+
+read_byte:
+ ld a,(cmdR_rindex) ;1105 3a 20 11 : .
+ cp 080h ;1108 fe 80 . .
+ jr nz,l1111h ;110a 20 05 .
+ call read_sector ;110c cd 21 11 . ! .
+ ret z ;110f c8 .
+ sub a ;1110 97 .
+l1111h:
+ inc a ;1111 3c <
+ ld (cmdR_rindex),a ;1112 32 20 11 2 .
+ push hl ;1115 e5 .
+ add a,07fh ;1116 c6 7f . 
+ ld l,a ;1118 6f o
+ ld h,000h ;1119 26 00 & .
+ ld a,(hl) ;111b 7e ~
+ pop hl ;111c e1 .
+ cp 01ah ;111d fe 1a . .
+ ret ;111f c9 .
+
+cmdR_rindex:
+ db 0 ;1120 00 .
+
+read_sector:
+ push hl ;1121 e5 .
+ push de ;1122 d5 .
+ push bc ;1123 c5 .
+ ld de,FCB ;1124 11 5c 00 . \ .
+ ld c,BDOS_READ ;1127 0e 14 . .
+ call ddtz_base ;1129 cd 00 00 . . .
+ dec a ;112c 3d =
+ jr z,l1132h ;112d 28 03 ( .
+ jp p,ERROR ;112f f2 07 01 . . .
+l1132h:
+ pop bc ;1132 c1 .
+ pop de ;1133 d1 .
+ pop hl ;1134 e1 .
+ ret ;1135 c9 .
+
+cmdR_storebyte:
+ push af ;1136 f5 .
+ push de ;1137 d5 .
+ ld de,TPA ;1138 11 00 01 . . .
+ call cp_hl_de ;113b cd ee 02 . . .
+ jp c,ERROR ;113e da 07 01 . . .
+ ld de,(BDOS+1) ;1141 ed 5b 06 00 . [ . .
+ call cp_hl_de ;1145 cd ee 02 . . .
+ jp nc,ERROR ;1148 d2 07 01 . . .
+ ld de,(high_load) ;114b ed 5b 9c 11 . [ . .
+ call cp_hl_de ;114f cd ee 02 . . .
+ jr c,l1157h ;1152 38 03 8 .
+ ld (high_load),hl ;1154 22 9c 11 " . .
+l1157h:
+ ld de,(max_load) ;1157 ed 5b 9e 11 . [ . .
+ call cp_hl_de ;115b cd ee 02 . . .
+ jr c,l1163h ;115e 38 03 8 .
+ ld (max_load),hl ;1160 22 9e 11 " . .
+l1163h:
+ pop de ;1163 d1 .
+ pop af ;1164 f1 .
+ ld (hl),a ;1165 77 w
+ ret ;1166 c9 .
+
+strncmp:
+ ld a,(de) ;1167 1a .
+ cp (hl) ;1168 be .
+ inc de ;1169 13 .
+ inc hl ;116a 23 #
+ ret nz ;116b c0 .
+ djnz strncmp ;116c 10 f9 . .
+ ret ;116e c9 .
+
+prnt_max_high0:
+ call assert_eol ;116f cd d6 02 . . .
+prnt_max_high:
+ ld hl,msg_high ;1172 21 8d 11 ! . .
+ call pstr ;1175 cd 88 02 . . .
+ ld hl,(high_load) ;1178 2a 9c 11 * . .
+ call out_hl ;117b cd 13 02 . . .
+ ld hl,msg_max ;117e 21 94 11 ! . .
+ call pstr ;1181 cd 88 02 . . .
+ ld hl,(max_load) ;1184 2a 9e 11 * . .
+ call out_hl ;1187 cd 13 02 . . .
+ jp crlf ;118a c3 a3 02 . . .
+
+msg_high:
+ DC 'High = '
+msg_max:
+ DC ' Max = '
+
+high_load:
+ defw TPA ;119c 00 01 . .
+max_load:
+ defw TPA ;119e 00 01 . .
+
+cmd_W:
+ call get_arg_range ;11a0 cd 7d 03 . } .
+ call assert_eol ;11a3 cd d6 02 . . .
+ push hl ;11a6 e5 .
+ ld a,c ;11a7 79 y
+ add a,07fh ;11a8 c6 7f . 
+ jr nc,l11adh ;11aa 30 01 0 .
+ inc b ;11ac 04 .
+l11adh:
+ and 080h ;11ad e6 80 . .
+ ld c,a ;11af 4f O
+ push bc ;11b0 c5 .
+ ld a,(FCB+1) ;11b1 3a 5d 00 : ] .
+ cp ' ' ;11b4 fe 20 .
+ jr z,error5 ;11b6 28 3b ( ;
+ call fcb_clear_rc ;11b8 cd 4c 10 . L .
+ push de ;11bb d5 .
+ ld c,BDOS_DELETE ;11bc 0e 13 . .
+ call ddtz_base ;11be cd 00 00 . . .
+ pop de ;11c1 d1 .
+ ld c,BDOS_CREATE ;11c2 0e 16 . .
+ call ddtz_base ;11c4 cd 00 00 . . .
+ inc a ;11c7 3c <
+ jr z,error5 ;11c8 28 29 ( )
+ pop bc ;11ca c1 .
+ pop hl ;11cb e1 .
+l11cch:
+ ld a,b ;11cc 78 x
+ or c ;11cd b1 .
+ jr z,close_file ;11ce 28 26 ( &
+ push bc ;11d0 c5 .
+ ld de,080h ;11d1 11 80 00 . . . DMA_BUF
+ ld b,d ;11d4 42 B
+ ld c,e ;11d5 4b K
+ ldir ;11d6 ed b0 . .
+ call write_sector ;11d8 cd e4 11 . . .
+ ex (sp),hl ;11db e3 .
+ ld bc,0ff80h ;11dc 01 80 ff . . .
+ add hl,bc ;11df 09 .
+ ex (sp),hl ;11e0 e3 .
+ pop bc ;11e1 c1 .
+ jr l11cch ;11e2 18 e8 . .
+
+write_sector:
+ push hl ;11e4 e5 .
+ ld de,FCB ;11e5 11 5c 00 . \ .
+ ld c,BDOS_WRITE ;11e8 0e 15 . .
+ call ddtz_base ;11ea cd 00 00 . . .
+ pop hl ;11ed e1 .
+ and a ;11ee a7 .
+ ret z ;11ef c8 .
+ call close_file ;11f0 cd f6 11 . . .
+error5:
+ jp ERROR ;11f3 c3 07 01 . . .
+
+close_file:
+ ld de,FCB ;11f6 11 5c 00 . \ .
+ ld c,BDOS_CLOSE ;11f9 0e 10 . .
+ jp ddtz_base ;11fb c3 00 00 . . .
+
+cmd_A:
+ ld hl,(last_A) ;11fe 2a 64 12 * d .
+ call get_lastarg_def ;1201 cd 69 03 . i .
+ push hl ;1204 e5 .
+ pop iy ;1205 fd e1 . .
+ ld hl,l1259h ;1207 21 59 12 ! Y .
+ ld (CMD_ERR),hl ;120a 22 66 00 " f .
+ ld (l1262h),sp ;120d ed 73 62 12 . s b .
+l1211h:
+ push iy ;1211 fd e5 . .
+ pop hl ;1213 e1 .
+ ld (last_A),hl ;1214 22 64 12 " d .
+ ld (l0062h),hl ;1217 22 62 00 " b .
+ push hl ;121a e5 .
+ call sub_192dh ;121b cd 2d 19 . - .
+ pop iy ;121e fd e1 . .
+ ld c,b ;1220 48 H
+ ld de,(offs.@) ;1221 ed 5b 64 00 . [ d .
+ ld a,d ;1225 7a z
+ or e ;1226 b3 .
+ ld b,011h ;1227 06 11 . .
+ jr z,l122dh ;1229 28 02 ( .
+ ld b,019h ;122b 06 19 . .
+l122dh:
+ call outbl ;122d cd 9f 02 . . .
+ ld a,(con_col) ;1230 3a 72 02 : r .
+ cp b ;1233 b8 .
+ jr c,l122dh ;1234 38 f7 8 .
+ push bc ;1236 c5 .
+ call get_line ;1237 cd 4e 01 . N .
+ pop bc ;123a c1 .
+ call skipbl ;123b cd bf 02 . . .
+ cp '.' ;123e fe 2e . .
+ ret z ;1240 c8 .
+ cp '-' ;1241 fe 2d . -
+ jr nz,l124bh ;1243 20 06 .
+ ld iy,(cmd_A_prev) ;1245 fd 2a 66 12 . * f .
+ jr l1211h ;1249 18 c6 . .
+l124bh:
+ and a ;124b a7 .
+ call nz,sub_1268h ;124c c4 68 12 . h .
+ ld (cmd_A_prev),iy ;124f fd 22 66 12 . " f .
+ ld b,0 ;1253 06 00 . .
+ add iy,bc ;1255 fd 09 . .
+ jr l1211h ;1257 18 b8 . .
+l1259h:
+ call l0146h ;1259 cd 46 01 . F .
+ ld sp,(l1262h) ;125c ed 7b 62 12 . { b .
+ jr l1211h ;1260 18 af . .
+
+l1262h:
+ dw 0 ;1262 00 00 .
+last_A:
+ dw TPA ;1264 00 01 .
+cmd_A_prev:
+ dw TPA ;1266 00 01 . .
+
+sub_1268h:
+ call skipbl ;1268 cd bf 02 . . .
+ ld hl,t_MNEMONICS ;126b 21 c6 1e ! . .
+ call sub_030ah ;126e cd 0a 03 . . .
+ jp nc,ERROR ;1271 d2 07 01 . . .
+ call skipbl ;1274 cd bf 02 . . .
+ push de ;1277 d5 .
+ ld a,b ;1278 78 x
+ add a,b ;1279 80 .
+ add a,b ;127a 80 .
+ ld hl,b_1289_start ;127b 21 89 12 ! . .
+ call add_hl_a ;127e cd b9 02 . . .
+ ld e,(hl) ;1281 5e ^
+ inc hl ;1282 23 #
+ ld d,(hl) ;1283 56 V
+ inc hl ;1284 23 #
+ ld b,(hl) ;1285 46 F
+ ex de,hl ;1286 eb .
+ pop de ;1287 d1 .
+ jp (hl) ;1288 e9 .
+
+b_1289_start:
+ defw l1551h ;1289 51 15 Q .
+ defb 088h ;128b 88 .
+ defw l1571h ;128c 71 15 q .
+ defb 080h ;128e 80 .
+ defw l15a8h ;128f a8 15 . .
+ defb 0a0h ;1291 a0 .
+ defw l1609h ;1292 09 16 . .
+ defb 040h ;1294 40 @
+ defw l162dh ;1295 2d 16 - .
+ defb 0c4h ;1297 c4 .
+ defw l153bh ;1298 3b 15 ; .
+ defb 03fh ;129a 3f ?
+ defw l15a8h ;129b a8 15 . .
+ defb 0b8h ;129d b8 .
+ defw l1544h ;129e 44 15 D .
+ defb 0a9h ;12a0 a9 .
+ defw l1544h ;12a1 44 15 D .
+ defb 0b9h ;12a3 b9 .
+ defw l1544h ;12a4 44 15 D .
+ defb 0a1h ;12a6 a1 .
+ defw l1544h ;12a7 44 15 D .
+ defb 0b1h ;12a9 b1 .
+ defw l153bh ;12aa 3b 15 ; .
+ defb 02fh ;12ac 2f /
+ defw l153bh ;12ad 3b 15 ; .
+ defb 027h ;12af 27 '
+ defw l1798h ;12b0 98 17 . .
+ defb 005h ;12b2 05 .
+ defw l153bh ;12b3 3b 15 ; .
+ defb 0f3h ;12b5 f3 .
+ defw l1699h ;12b6 99 16 . .
+ defb 010h ;12b8 10 .
+ defw l153bh ;12b9 3b 15 ; .
+ defb 0fbh ;12bb fb .
+ defw l1749h ;12bc 49 17 I .
+ defb 0e3h ;12be e3 .
+ defw l153bh ;12bf 3b 15 ; .
+ defb 0d9h ;12c1 d9 .
+ defw l153bh ;12c2 3b 15 ; .
+ defb 076h ;12c4 76 v
+ defw l16b4h ;12c5 b4 16 . .
+ defb 046h ;12c7 46 F
+ defw l16edh ;12c8 ed 16 . .
+ defb 040h ;12ca 40 @
+ defw l1798h ;12cb 98 17 . .
+ defb 004h ;12cd 04 .
+ defw l1544h ;12ce 44 15 D .
+ defb 0aah ;12d0 aa .
+ defw l1544h ;12d1 44 15 D .
+ defb 0bah ;12d3 ba .
+ defw l1544h ;12d4 44 15 D .
+ defb 0a2h ;12d6 a2 .
+ defw l1544h ;12d7 44 15 D .
+ defb 0b2h ;12d9 b2 .
+ defw l1653h ;12da 53 16 S .
+ defb 0c2h ;12dc c2 .
+ defw l16a0h ;12dd a0 16 . .
+ defb 020h ;12df 20
+ defw l1352h ;12e0 52 13 R .
+ defb 040h ;12e2 40 @
+ defw l1544h ;12e3 44 15 D .
+ defb 0a8h ;12e5 a8 .
+ defw l1544h ;12e6 44 15 D .
+ defb 0b8h ;12e8 b8 .
+ defw l1544h ;12e9 44 15 D .
+ defb 0a0h ;12eb a0 .
+ defw l1544h ;12ec 44 15 D .
+ defb 0b0h ;12ee b0 .
+ defw l1544h ;12ef 44 15 D .
+ defb 044h ;12f1 44 D
+ defw l153bh ;12f2 3b 15 ; .
+ defb 000h ;12f4 00 .
+ defw l15a8h ;12f5 a8 15 . .
+ defb 0b0h ;12f7 b0 .
+ defw l1544h ;12f8 44 15 D .
+ defb 0bbh ;12fa bb .
+ defw l1544h ;12fb 44 15 D .
+ defb 0b3h ;12fd b3 .
+ defw l1721h ;12fe 21 17 ! .
+ defb 041h ;1300 41 A
+ defw l1544h ;1301 44 15 D .
+ defb 0abh ;1303 ab .
+ defw l1544h ;1304 44 15 D .
+ defb 0a3h ;1306 a3 .
+ defw l16d9h ;1307 d9 16 . .
+ defb 0c1h ;1309 c1 .
+ defw l16d9h ;130a d9 16 . .
+ defb 0c5h ;130c c5 .
+ defw l1609h ;130d 09 16 . .
+ defb 080h ;130f 80 .
+ defw l1645h ;1310 45 16 E .
+ defb 0c0h ;1312 c0 .
+ defw l1544h ;1313 44 15 D .
+ defb 04dh ;1315 4d M
+ defw l1544h ;1316 44 15 D .
+ defb 045h ;1318 45 E
+ defw l15d5h ;1319 d5 15 . .
+ defb 010h ;131b 10 .
+ defw l153bh ;131c 3b 15 ; .
+ defb 017h ;131e 17 .
+ defw l15d5h ;131f d5 15 . .
+ defb 000h ;1321 00 .
+ defw l153bh ;1322 3b 15 ; .
+ defb 007h ;1324 07 .
+ defw l1544h ;1325 44 15 D .
+ defb 06fh ;1327 6f o
+ defw l15d5h ;1328 d5 15 . .
+ defb 018h ;132a 18 .
+ defw l153bh ;132b 3b 15 ; .
+ defb 01fh ;132d 1f .
+ defw l15d5h ;132e d5 15 . .
+ defb 008h ;1330 08 .
+ defw l153bh ;1331 3b 15 ; .
+ defb 00fh ;1333 0f .
+ defw l1544h ;1334 44 15 D .
+ defb 067h ;1336 67 g
+ defw l16cah ;1337 ca 16 . .
+ defb 0c7h ;1339 c7 .
+ defw l1551h ;133a 51 15 Q .
+ defb 098h ;133c 98 .
+ defw l153bh ;133d 3b 15 ; .
+ defb 037h ;133f 37 7
+ defw l1609h ;1340 09 16 . .
+ defb 0c0h ;1342 c0 .
+ defw l15d5h ;1343 d5 15 . .
+ defb 020h ;1345 20
+ defw l15d5h ;1346 d5 15 . .
+ defb 028h ;1348 28 (
+ defw l15d5h ;1349 d5 15 . .
+ defb 038h ;134b 38 8
+ defw l15a8h ;134c a8 15 . .
+ defb 090h ;134e 90 .
+ defw l15a8h ;134f a8 15 . .
+ defb 0a8h ;1351 a8 .
+
+l1352h:
+ call sub_182eh ;1352 cd 2e 18 . . .
+ jr c,l13d4h ;1355 38 7d 8 }
+ call sub_1855h ;1357 cd 55 18 . U .
+ jp c,l1471h ;135a da 71 14 . q .
+ call sub_181bh ;135d cd 1b 18 . . .
+ jp c,l149ch ;1360 da 9c 14 . . .
+ call sub_183dh ;1363 cd 3d 18 . = .
+ jp c,l14f5h ;1366 da f5 14 . . .
+ ld a,(de) ;1369 1a .
+ cp 'I' ;136a fe 49 . I
+ jp z,l1511h ;136c ca 11 15 . . .
+ cp 'R' ;136f fe 52 . R
+ jp z,l1519h ;1371 ca 19 15 . . .
+ cp '(' ;1374 fe 28 . (
+ jp nz,ERROR ;1376 c2 07 01 . . .
+ inc de ;1379 13 .
+ call sub_181bh ;137a cd 1b 18 . . .
+ jp c,l1528h ;137d da 28 15 . ( .
+ call test_expr ;1380 cd 09 18 . . .
+ call test_paren_close ;1383 cd c5 18 . . .
+ call assert_comma ;1386 cd be 18 . . .
+ call sub_181bh ;1389 cd 1b 18 . . .
+ jr c,l13c2h ;138c 38 34 8 4
+ call sub_183dh ;138e cd 3d 18 . = .
+ jr nc,l13aah ;1391 30 17 0 .
+ ld b,022h ;1393 06 22 . "
+l1395h:
+ call assert_eol ;1395 cd d6 02 . . .
+ ld a,(prefix_ixiy) ;1398 3a cc 18 : . .
+l139bh:
+ ld (iy+000h),a ;139b fd 77 00 . w .
+ ld (iy+001h),b ;139e fd 70 01 . p .
+ ld (iy+002h),l ;13a1 fd 75 02 . u .
+ ld (iy+003h),h ;13a4 fd 74 03 . t .
+ ld c,004h ;13a7 0e 04 . .
+ ret ;13a9 c9 .
+l13aah:
+ ld a,(de) ;13aa 1a .
+ cp 'A' ;13ab fe 41 . A
+ jp nz,ERROR ;13ad c2 07 01 . . .
+ inc de ;13b0 13 .
+ ld b,032h ;13b1 06 32 . 2
+l13b3h:
+ call assert_eol ;13b3 cd d6 02 . . .
+ ld (iy+000h),b ;13b6 fd 70 00 . p .
+ ld (iy+001h),l ;13b9 fd 75 01 . u .
+ ld (iy+002h),h ;13bc fd 74 02 . t .
+ ld c,003h ;13bf 0e 03 . .
+ ret ;13c1 c9 .
+l13c2h:
+ cp 020h ;13c2 fe 20 .
+ jr z,l13d0h ;13c4 28 0a ( .
+ add a,043h ;13c6 c6 43 . C
+ ld b,a ;13c8 47 G
+l13c9h:
+ call assert_eol ;13c9 cd d6 02 . . .
+ ld a,0edh ;13cc 3e ed > .
+ jr l139bh ;13ce 18 cb . .
+l13d0h:
+ ld b,022h ;13d0 06 22 . "
+ jr l13b3h ;13d2 18 df . .
+l13d4h:
+ ld b,a ;13d4 47 G
+ call assert_comma ;13d5 cd be 18 . . .
+ call sub_182eh ;13d8 cd 2e 18 . . .
+ jr nc,l13f0h ;13db 30 13 0 .
+ push af ;13dd f5 .
+ ld a,b ;13de 78 x
+ rlca ;13df 07 .
+ rlca ;13e0 07 .
+ rlca ;13e1 07 .
+ ld b,a ;13e2 47 G
+ pop af ;13e3 f1 .
+ add a,b ;13e4 80 .
+ add a,040h ;13e5 c6 40 . @
+ cp 076h ;13e7 fe 76 . v
+ jp z,ERROR ;13e9 ca 07 01 . . .
+l13ech:
+ ld b,a ;13ec 47 G
+ jp l153bh ;13ed c3 3b 15 . ; .
+l13f0h:
+ call sub_1855h ;13f0 cd 55 18 . U .
+ jr nc,l1413h ;13f3 30 1e 0 .
+ ld a,b ;13f5 78 x
+ rlca ;13f6 07 .
+ rlca ;13f7 07 .
+ rlca ;13f8 07 .
+ add a,046h ;13f9 c6 46 . F
+ cp 076h ;13fb fe 76 . v
+ jp z,ERROR ;13fd ca 07 01 . . .
+l1400h:
+ ld b,a ;1400 47 G
+ call assert_eol ;1401 cd d6 02 . . .
+ ld (iy+001h),b ;1404 fd 70 01 . p .
+ ld (iy+002h),c ;1407 fd 71 02 . q .
+ ld a,(prefix_ixiy) ;140a 3a cc 18 : . .
+ ld (iy+000h),a ;140d fd 77 00 . w .
+ ld c,003h ;1410 0e 03 . .
+ ret ;1412 c9 .
+l1413h:
+ ld a,(de) ;1413 1a .
+ cp 'I' ;1414 fe 49 . I
+ jr z,l1426h ;1416 28 0e ( .
+ cp 'R' ;1418 fe 52 . R
+ jr nz,l1432h ;141a 20 16 .
+ ld a,b ;141c 78 x
+ cp 007h ;141d fe 07 . .
+ jp nz,ERROR ;141f c2 07 01 . . .
+ ld b,05fh ;1422 06 5f . _
+ jr l142eh ;1424 18 08 . .
+l1426h:
+ ld a,b ;1426 78 x
+ cp 007h ;1427 fe 07 . .
+ jp nz,ERROR ;1429 c2 07 01 . . .
+ ld b,057h ;142c 06 57 . W
+l142eh:
+ inc de ;142e 13 .
+ jp l1544h ;142f c3 44 15 . D .
+l1432h:
+ cp '(' ;1432 fe 28 . (
+ jr z,l144ch ;1434 28 16 ( .
+ call sub_17ffh ;1436 cd ff 17 . . .
+ ld a,b ;1439 78 x
+ rlca ;143a 07 .
+ rlca ;143b 07 .
+ rlca ;143c 07 .
+ add a,006h ;143d c6 06 . .
+l143fh:
+ ld b,a ;143f 47 G
+l1440h:
+ call assert_eol ;1440 cd d6 02 . . .
+ ld (iy+000h),b ;1443 fd 70 00 . p .
+ ld (iy+001h),l ;1446 fd 75 01 . u .
+ ld c,002h ;1449 0e 02 . .
+ ret ;144b c9 .
+l144ch:
+ inc de ;144c 13 .
+ ld a,b ;144d 78 x
+ cp 007h ;144e fe 07 . .
+ jp nz,ERROR ;1450 c2 07 01 . . .
+ call sub_181bh ;1453 cd 1b 18 . . .
+ jr nc,l1466h ;1456 30 0e 0 .
+ cp 030h ;1458 fe 30 . 0
+ jp nc,ERROR ;145a d2 07 01 . . .
+ add a,00ah ;145d c6 0a . .
+ ld b,a ;145f 47 G
+ call test_paren_close ;1460 cd c5 18 . . .
+ jp l153bh ;1463 c3 3b 15 . ; .
+l1466h:
+ call test_expr ;1466 cd 09 18 . . .
+ call test_paren_close ;1469 cd c5 18 . . .
+ ld b,03ah ;146c 06 3a . :
+ jp l13b3h ;146e c3 b3 13 . . .
+l1471h:
+ call assert_comma ;1471 cd be 18 . . .
+ call sub_182eh ;1474 cd 2e 18 . . .
+ jr nc,l1483h ;1477 30 0a 0 .
+ cp 006h ;1479 fe 06 . .
+ jp z,ERROR ;147b ca 07 01 . . .
+ add a,070h ;147e c6 70 . p
+ jp l1400h ;1480 c3 00 14 . . .
+l1483h:
+ call sub_17ffh ;1483 cd ff 17 . . .
+ call assert_eol ;1486 cd d6 02 . . .
+ ld a,(prefix_ixiy) ;1489 3a cc 18 : . .
+ ld (iy+000h),a ;148c fd 77 00 . w .
+ ld (iy+001h),036h ;148f fd 36 01 36 . 6 . 6
+ ld (iy+002h),c ;1493 fd 71 02 . q .
+ ld (iy+003h),l ;1496 fd 75 03 . u .
+ ld c,004h ;1499 0e 04 . .
+ ret ;149b c9 .
+l149ch:
+ ld b,a ;149c 47 G
+ call assert_comma ;149d cd be 18 . . .
+ ld hl,t_HL.AF ;14a0 21 af 1f ! . .
+ call sub_0318h ;14a3 cd 18 03 . . .
+ jr c,l14c3h ;14a6 38 1b 8 .
+ call sub_183dh ;14a8 cd 3d 18 . = .
+ jr nc,l14cch ;14ab 30 1f 0 .
+ ld a,b ;14ad 78 x
+ cp 030h ;14ae fe 30 . 0
+ jr nz,error6 ;14b0 20 73 s
+ ld b,0f9h ;14b2 06 f9 . .
+l14b4h:
+ call assert_eol ;14b4 cd d6 02 . . .
+ ld a,(prefix_ixiy) ;14b7 3a cc 18 : . .
+ ld (iy+000h),a ;14ba fd 77 00 . w .
+ ld (iy+001h),b ;14bd fd 70 01 . p .
+ ld c,002h ;14c0 0e 02 . .
+ ret ;14c2 c9 .
+l14c3h:
+ ld a,b ;14c3 78 x
+ cp 030h ;14c4 fe 30 . 0
+ jr nz,error6 ;14c6 20 5d ]
+ ld b,0f9h ;14c8 06 f9 . .
+ jr l153bh ;14ca 18 6f . o
+l14cch:
+ ld a,(de) ;14cc 1a .
+ cp '(' ;14cd fe 28 . (
+ jr nz,l14e8h ;14cf 20 17 .
+ inc de ;14d1 13 .
+ call test_expr ;14d2 cd 09 18 . . .
+ call test_paren_close ;14d5 cd c5 18 . . .
+ ld a,b ;14d8 78 x
+ cp 020h ;14d9 fe 20 .
+ jr z,l14e3h ;14db 28 06 ( .
+ add a,04bh ;14dd c6 4b . K
+ ld b,a ;14df 47 G
+ jp l13c9h ;14e0 c3 c9 13 . . .
+l14e3h:
+ ld b,02ah ;14e3 06 2a . *
+ jp l13b3h ;14e5 c3 b3 13 . . .
+l14e8h:
+ call test_expr ;14e8 cd 09 18 . . .
+ call assert_eol ;14eb cd d6 02 . . .
+ ld a,001h ;14ee 3e 01 > .
+ add a,b ;14f0 80 .
+ ld b,a ;14f1 47 G
+ jp l13b3h ;14f2 c3 b3 13 . . .
+l14f5h:
+ call assert_comma ;14f5 cd be 18 . . .
+ ld a,(de) ;14f8 1a .
+ cp '(' ;14f9 fe 28 . (
+ jr nz,l1509h ;14fb 20 0c .
+ inc de ;14fd 13 .
+ call test_expr ;14fe cd 09 18 . . .
+ call test_paren_close ;1501 cd c5 18 . . .
+ ld b,02ah ;1504 06 2a . *
+ jp l1395h ;1506 c3 95 13 . . .
+l1509h:
+ call test_expr ;1509 cd 09 18 . . .
+ ld b,021h ;150c 06 21 . !
+ jp l1395h ;150e c3 95 13 . . .
+l1511h:
+ inc de ;1511 13 .
+ call assert_comma ;1512 cd be 18 . . .
+ ld b,047h ;1515 06 47 . G
+ jr l151fh ;1517 18 06 . .
+l1519h:
+ inc de ;1519 13 .
+ call assert_comma ;151a cd be 18 . . .
+ ld b,04fh ;151d 06 4f . O
+l151fh:
+ ld a,(de) ;151f 1a .
+ inc de ;1520 13 .
+ cp 'A' ;1521 fe 41 . A
+ jr z,l1544h ;1523 28 1f ( .
+error6:
+ jp ERROR ;1525 c3 07 01 . . .
+
+l1528h:
+ cp 020h ;1528 fe 20 .
+ jr nc,error6 ;152a 30 f9 0 .
+ add a,002h ;152c c6 02 . .
+ ld b,a ;152e 47 G
+ call test_paren_close ;152f cd c5 18 . . .
+ call assert_comma ;1532 cd be 18 . . .
+ ld a,(de) ;1535 1a .
+ cp 'A' ;1536 fe 41 . A
+ jr nz,error6 ;1538 20 eb .
+ inc de ;153a 13 .
+l153bh:
+ call assert_eol ;153b cd d6 02 . . .
+ ld (iy+000h),b ;153e fd 70 00 . p .
+ ld c,001h ;1541 0e 01 . .
+ ret ;1543 c9 .
+
+l1544h:
+ call assert_eol ;1544 cd d6 02 . . .
+ ld (iy+000h),0edh ;1547 fd 36 00 ed . 6 . .
+ ld (iy+001h),b ;154b fd 70 01 . p .
+ ld c,002h ;154e 0e 02 . .
+ ret ;1550 c9 .
+
+l1551h:
+ ld hl,t_HL.AF ;1551 21 af 1f ! . .
+ call sub_0318h ;1554 cd 18 03 . . .
+ jr nc,l15a8h ;1557 30 4f 0 O
+ call assert_comma ;1559 cd be 18 . . .
+ call sub_181bh ;155c cd 1b 18 . . .
+ jp nc,ERROR ;155f d2 07 01 . . .
+ push af ;1562 f5 .
+ ld a,b ;1563 78 x
+ cp 088h ;1564 fe 88 . .
+ ld b,04ah ;1566 06 4a . J
+ jr z,l156ch ;1568 28 02 ( .
+ ld b,042h ;156a 06 42 . B
+l156ch:
+ pop af ;156c f1 .
+ add a,b ;156d 80 .
+l156eh:
+ ld b,a ;156e 47 G
+ jr l1544h ;156f 18 d3 . .
+l1571h:
+ ld hl,t_HL.AF ;1571 21 af 1f ! . .
+ call sub_0318h ;1574 cd 18 03 . . .
+ jr c,l159ah ;1577 38 21 8 !
+ call sub_183dh ;1579 cd 3d 18 . = .
+ jr nc,l15a8h ;157c 30 2a 0 *
+ call assert_comma ;157e cd be 18 . . .
+ ld hl,t_BC.DE.IX.SP ;1581 21 bd 1f ! . .
+ ld a,(prefix_ixiy) ;1584 3a cc 18 : . .
+ cp 0fdh ;1587 fe fd . .
+ jr nz,l158eh ;1589 20 03 .
+ ld hl,t_BC.DE.IY.SP ;158b 21 b4 1f ! . .
+l158eh:
+ call sub_1818h ;158e cd 18 18 . . .
+ jp nc,ERROR ;1591 d2 07 01 . . .
+ add a,009h ;1594 c6 09 . .
+l1596h:
+ ld b,a ;1596 47 G
+ jp l14b4h ;1597 c3 b4 14 . . .
+l159ah:
+ call assert_comma ;159a cd be 18 . . .
+ call sub_181bh ;159d cd 1b 18 . . .
+ jp nc,ERROR ;15a0 d2 07 01 . . .
+ add a,009h ;15a3 c6 09 . .
+ jp l13ech ;15a5 c3 ec 13 . . .
+l15a8h:
+ ld a,(de) ;15a8 1a .
+ cp 'A' ;15a9 fe 41 . A
+ jr nz,l15b8h ;15ab 20 0b .
+ push de ;15ad d5 .
+ inc de ;15ae 13 .
+ call next_arg ;15af cd ca 02 . . .
+ jr z,l15b7h ;15b2 28 03 ( .
+ pop de ;15b4 d1 .
+ jr l15b8h ;15b5 18 01 . .
+l15b7h:
+ pop af ;15b7 f1 .
+l15b8h:
+ call sub_182eh ;15b8 cd 2e 18 . . .
+ jr c,l15cbh ;15bb 38 0e 8 .
+ call sub_1855h ;15bd cd 55 18 . U .
+ jr c,l15cfh ;15c0 38 0d 8 .
+ call sub_17ffh ;15c2 cd ff 17 . . .
+ ld a,b ;15c5 78 x
+ add a,046h ;15c6 c6 46 . F
+ jp l143fh ;15c8 c3 3f 14 . ? .
+l15cbh:
+ add a,b ;15cb 80 .
+ jp l13ech ;15cc c3 ec 13 . . .
+l15cfh:
+ ld a,b ;15cf 78 x
+ add a,006h ;15d0 c6 06 . .
+ jp l1400h ;15d2 c3 00 14 . . .
+l15d5h:
+ call sub_182eh ;15d5 cd 2e 18 . . .
+ jr c,l15fah ;15d8 38 20 8
+ call sub_1855h ;15da cd 55 18 . U .
+ jp nc,ERROR ;15dd d2 07 01 . . .
+ ld a,b ;15e0 78 x
+ add a,006h ;15e1 c6 06 . .
+ ld b,a ;15e3 47 G
+l15e4h:
+ call assert_eol ;15e4 cd d6 02 . . .
+ ld a,(prefix_ixiy) ;15e7 3a cc 18 : . .
+ ld (iy+000h),a ;15ea fd 77 00 . w .
+ ld (iy+001h),0cbh ;15ed fd 36 01 cb . 6 . .
+ ld (iy+002h),c ;15f1 fd 71 02 . q .
+ ld (iy+003h),b ;15f4 fd 70 03 . p .
+ ld c,004h ;15f7 0e 04 . .
+ ret ;15f9 c9 .
+l15fah:
+ add a,b ;15fa 80 .
+l15fbh:
+ ld b,a ;15fb 47 G
+ call assert_eol ;15fc cd d6 02 . . .
+ ld (iy+001h),b ;15ff fd 70 01 . p .
+ ld (iy+000h),0cbh ;1602 fd 36 00 cb . 6 . .
+ ld c,002h ;1606 0e 02 . .
+ ret ;1608 c9 .
+l1609h:
+ call sub_17d3h ;1609 cd d3 17 . . .
+ call assert_comma ;160c cd be 18 . . .
+ call sub_182eh ;160f cd 2e 18 . . .
+ jr c,l1624h ;1612 38 10 8 .
+ call sub_1855h ;1614 cd 55 18 . U .
+ jp nc,ERROR ;1617 d2 07 01 . . .
+ ld a,l ;161a 7d }
+ rlca ;161b 07 .
+ rlca ;161c 07 .
+ rlca ;161d 07 .
+ add a,006h ;161e c6 06 . .
+ add a,b ;1620 80 .
+ ld b,a ;1621 47 G
+ jr l15e4h ;1622 18 c0 . .
+l1624h:
+ add a,b ;1624 80 .
+ ld b,a ;1625 47 G
+ ld a,l ;1626 7d }
+ rlca ;1627 07 .
+ rlca ;1628 07 .
+ rlca ;1629 07 .
+ add a,b ;162a 80 .
+ jr l15fbh ;162b 18 ce . .
+l162dh:
+ push de ;162d d5 .
+ call sub_18a5h ;162e cd a5 18 . . .
+ jr nc,l163ch ;1631 30 09 0 .
+ add a,b ;1633 80 .
+ ld b,a ;1634 47 G
+ call next_arg ;1635 cd ca 02 . . .
+ jr z,l163eh ;1638 28 04 ( .
+ pop de ;163a d1 .
+ push de ;163b d5 .
+l163ch:
+ ld b,0cdh ;163c 06 cd . .
+l163eh:
+ pop af ;163e f1 .
+ call test_expr ;163f cd 09 18 . . .
+ jp l13b3h ;1642 c3 b3 13 . . .
+l1645h:
+ call sub_18a5h ;1645 cd a5 18 . . .
+ jr nc,l164eh ;1648 30 04 0 .
+ add a,b ;164a 80 .
+ ld b,a ;164b 47 G
+ jr l1650h ;164c 18 02 . .
+l164eh:
+ ld b,0c9h ;164e 06 c9 . .
+l1650h:
+ jp l153bh ;1650 c3 3b 15 . ; .
+l1653h:
+ push de ;1653 d5 .
+ call sub_18a5h ;1654 cd a5 18 . . .
+ jr c,l1666h ;1657 38 0d 8 .
+l1659h:
+ pop de ;1659 d1 .
+ ld hl,l168ch ;165a 21 8c 16 ! . .
+ call sub_030ah ;165d cd 0a 03 . . .
+ jr c,l1674h ;1660 38 12 8 .
+ ld b,0c3h ;1662 06 c3 . .
+ jr l166eh ;1664 18 08 . .
+l1666h:
+ add a,b ;1666 80 .
+ ld b,a ;1667 47 G
+ call next_arg ;1668 cd ca 02 . . .
+ jr nz,l1659h ;166b 20 ec .
+ pop af ;166d f1 .
+l166eh:
+ call test_expr ;166e cd 09 18 . . .
+ jp l13b3h ;1671 c3 b3 13 . . .
+l1674h:
+ call assert_eol ;1674 cd d6 02 . . .
+ ld a,b ;1677 78 x
+ and a ;1678 a7 .
+ jr nz,l1680h ;1679 20 05 .
+ ld b,0e9h ;167b 06 e9 . .
+ jp l153bh ;167d c3 3b 15 . ; .
+l1680h:
+ ld b,0ddh ;1680 06 dd . .
+ dec a ;1682 3d =
+ jr z,l1687h ;1683 28 02 ( .
+ ld b,0fdh ;1685 06 fd . .
+l1687h:
+ ld l,0e9h ;1687 2e e9 . .
+ jp l1440h ;1689 c3 40 14 . @ .
+
+l168ch:
+ DC '(HL)'
+ DC '(IX)'
+ DC '(IY)'
+ DB 0
+
+l1699h:
+ call next_arg ;1699 cd ca 02 . . .
+ ld b,010h ;169c 06 10 . .
+ jr l16aeh ;169e 18 0e . .
+l16a0h:
+ call sub_18ach ;16a0 cd ac 18 . . .
+ jr c,l16a9h ;16a3 38 04 8 .
+ ld b,018h ;16a5 06 18 . .
+ jr l16aeh ;16a7 18 05 . .
+l16a9h:
+ add a,b ;16a9 80 .
+ ld b,a ;16aa 47 G
+ call assert_comma ;16ab cd be 18 . . .
+l16aeh:
+ call sub_17dch ;16ae cd dc 17 . . .
+ jp l1440h ;16b1 c3 40 14 . @ .
+
+l16b4h:
+ call sub_17ffh ;16b4 cd ff 17 . . .
+ ld a,l ;16b7 7d }
+ cp 003h ;16b8 fe 03 . .
+ jr nc,error2 ;16ba 30 5c 0 \
+ and a ;16bc a7 .
+ jr z,l16c7h ;16bd 28 08 ( .
+ ld b,056h ;16bf 06 56 . V
+ cp 001h ;16c1 fe 01 . .
+ jr z,l16c7h ;16c3 28 02 ( .
+ ld b,05eh ;16c5 06 5e . ^
+l16c7h:
+ jp l1544h ;16c7 c3 44 15 . D .
+
+l16cah:
+ call sub_17ffh ;16ca cd ff 17 . . .
+ ld a,l ;16cd 7d }
+ push af ;16ce f5 .
+ add a,b ;16cf 80 .
+ ld b,a ;16d0 47 G
+ pop af ;16d1 f1 .
+ and 0c7h ;16d2 e6 c7 . .
+ jr nz,error2 ;16d4 20 42 B
+ jp l153bh ;16d6 c3 3b 15 . ; .
+
+l16d9h:
+ call sub_183dh ;16d9 cd 3d 18 . = .
+ jr c,l16e7h ;16dc 38 09 8 .
+ call sub_1812h ;16de cd 12 18 . . .
+ jr nc,error2 ;16e1 30 35 0 5
+ add a,b ;16e3 80 .
+ jp l13ech ;16e4 c3 ec 13 . . .
+l16e7h:
+ ld a,b ;16e7 78 x
+ add a,020h ;16e8 c6 20 .
+ jp l1596h ;16ea c3 96 15 . . .
+
+l16edh:
+ call sub_182eh ;16ed cd 2e 18 . . .
+ jr nc,error2 ;16f0 30 26 0 &
+ cp 006h ;16f2 fe 06 . .
+ jr z,error2 ;16f4 28 22 ( "
+ rlca ;16f6 07 .
+ rlca ;16f7 07 .
+ rlca ;16f8 07 .
+ add a,b ;16f9 80 .
+ ld b,a ;16fa 47 G
+ cp 078h ;16fb fe 78 . x
+ jr nz,l170fh ;16fd 20 10 .
+ call assert_comma ;16ff cd be 18 . . .
+ call sub_171bh ;1702 cd 1b 17 . . .
+ jr c,l1715h ;1705 38 0e 8 .
+ call sub_17f3h ;1707 cd f3 17 . . .
+ ld b,0dbh ;170a 06 db . .
+ jp l1440h ;170c c3 40 14 . @ .
+l170fh:
+ call assert_comma ;170f cd be 18 . . .
+ call sub_171bh ;1712 cd 1b 17 . . .
+l1715h:
+ jp c,l1544h ;1715 da 44 15 . D .
+error2:
+ jp ERROR ;1718 c3 07 01 . . .
+
+sub_171bh:
+ ld hl,t__C_ ;171b 21 f4 1f ! . .
+ jp sub_0318h ;171e c3 18 03 . . .
+
+l1721h:
+ call sub_171bh ;1721 cd 1b 17 . . .
+ jr nc,l1739h ;1724 30 13 0 .
+ call assert_comma ;1726 cd be 18 . . .
+ call sub_182eh ;1729 cd 2e 18 . . .
+ jr nc,error2 ;172c 30 ea 0 .
+ cp 006h ;172e fe 06 . .
+ jr z,error2 ;1730 28 e6 ( .
+ rlca ;1732 07 .
+ rlca ;1733 07 .
+ rlca ;1734 07 .
+ add a,b ;1735 80 .
+ jp l156eh ;1736 c3 6e 15 . n .
+
+l1739h:
+ call sub_17f3h ;1739 cd f3 17 . . .
+ call assert_comma ;173c cd be 18 . . .
+ cp 'A' ;173f fe 41 . A
+ jr nz,error2 ;1741 20 d5 .
+ inc de ;1743 13 .
+ ld b,0d3h ;1744 06 d3 . .
+ jp l1440h ;1746 c3 40 14 . @ .
+
+l1749h:
+ ld hl,b_176d_start ;1749 21 6d 17 ! m .
+ call sub_030ah ;174c cd 0a 03 . . .
+ jp nc,ERROR ;174f d2 07 01 . . .
+ ld c,b ;1752 48 H
+ call assert_eol ;1753 cd d6 02 . . .
+ ld b,000h ;1756 06 00 . .
+ ld hl,l178eh ;1758 21 8e 17 ! . .
+ add hl,bc ;175b 09 .
+ add hl,bc ;175c 09 .
+ ld a,(hl) ;175d 7e ~
+ ld (iy+000h),a ;175e fd 77 00 . w .
+ ld c,001h ;1761 0e 01 . .
+ inc hl ;1763 23 #
+ ld a,(hl) ;1764 7e ~
+ and a ;1765 a7 .
+ ret z ;1766 c8 .
+ ld (iy+001h),a ;1767 fd 77 01 . w .
+ ld c,002h ;176a 0e 02 . .
+ ret ;176c c9 .
+
+b_176d_start:
+ DC 'AF,AF'''
+l1773h:
+ DC 'DE,HL'
+ DC '(SP),HL'
+ DC '(SP),IX'
+ DC '(SP),IY'
+ db 0
+l178eh:
+ db 008h,000h ;178e 08 .
+ db 0ebh,000h ;1790 eb .
+ db 0e3h,000h ;1792 e3 .
+ db 0ddh,0e3h ;1794 dd .
+ db 0fdh,0e3h ;1796 fd .
+
+l1798h:
+ call sub_183dh ;1798 cd 3d 18 . = .
+ jr c,l17b3h ;179b 38 16 8 .
+ call sub_181bh ;179d cd 1b 18 . . .
+ jr c,l17bfh ;17a0 38 1d 8 .
+ call sub_182eh ;17a2 cd 2e 18 . . .
+ jr c,l17cch ;17a5 38 25 8 %
+ call sub_1855h ;17a7 cd 55 18 . U .
+ jp nc,ERROR ;17aa d2 07 01 . . .
+ ld a,b ;17ad 78 x
+ add a,030h ;17ae c6 30 . 0
+ jp l1400h ;17b0 c3 00 14 . . .
+l17b3h:
+ ld a,b ;17b3 78 x
+ ld b,023h ;17b4 06 23 . #
+ cp 004h ;17b6 fe 04 . .
+ jr z,l17bch ;17b8 28 02 ( .
+ ld b,02bh ;17ba 06 2b . +
+l17bch:
+ jp l14b4h ;17bc c3 b4 14 . . .
+l17bfh:
+ push af ;17bf f5 .
+ ld a,b ;17c0 78 x
+ ld b,003h ;17c1 06 03 . .
+ cp 004h ;17c3 fe 04 . .
+ jr z,l17c9h ;17c5 28 02 ( .
+ ld b,00bh ;17c7 06 0b . .
+l17c9h:
+ pop af ;17c9 f1 .
+ jr l17cfh ;17ca 18 03 . .
+l17cch:
+ rlca ;17cc 07 .
+ rlca ;17cd 07 .
+ rlca ;17ce 07 .
+l17cfh:
+ add a,b ;17cf 80 .
+ jp l13ech ;17d0 c3 ec 13 . . .
+sub_17d3h:
+ call sub_17ffh ;17d3 cd ff 17 . . .
+ ld a,l ;17d6 7d }
+ cp 008h ;17d7 fe 08 . .
+ jr nc,error3 ;17d9 30 34 0 4
+ ret ;17db c9 .
+sub_17dch:
+ call test_expr ;17dc cd 09 18 . . .
+ push bc ;17df c5 .
+ push iy ;17e0 fd e5 . .
+ pop bc ;17e2 c1 .
+ and a ;17e3 a7 .
+ sbc hl,bc ;17e4 ed 42 . B
+ dec hl ;17e6 2b +
+ dec hl ;17e7 2b +
+ pop bc ;17e8 c1 .
+ call sub_1802h ;17e9 cd 02 18 . . .
+ ld a,h ;17ec 7c |
+ xor l ;17ed ad .
+ bit 7,a ;17ee cb 7f . 
+ jr nz,error3 ;17f0 20 1d .
+ ret ;17f2 c9 .
+
+sub_17f3h:
+ ld a,(de) ;17f3 1a .
+ cp '(' ;17f4 fe 28 . (
+ jr nz,sub_17ffh ;17f6 20 07 .
+ inc de ;17f8 13 .
+ call sub_17ffh ;17f9 cd ff 17 . . .
+ jp test_paren_close ;17fc c3 c5 18 . . .
+
+sub_17ffh:
+ call test_expr ;17ff cd 09 18 . . .
+sub_1802h:
+ ld a,h ;1802 7c |
+ and a ;1803 a7 .
+ ret z ;1804 c8 .
+ inc a ;1805 3c <
+ ret z ;1806 c8 .
+ jr error3 ;1807 18 06 . .
+
+test_expr:
+ push bc ;1809 c5 .
+ call expr ;180a cd be 03 . . .
+ pop bc ;180d c1 .
+ ret nc ;180e d0 .
+error3:
+ jp ERROR ;180f c3 07 01 . . .
+
+sub_1812h:
+ push hl ;1812 e5 .
+ ld hl,t_BC.DE.HL.AF ;1813 21 ab 1f ! . .
+ jr l181fh ;1816 18 07 . .
+
+sub_1818h:
+ push hl ;1818 e5 .
+ jr l181fh ;1819 18 04 . .
+
+sub_181bh:
+ push hl ;181b e5 .
+ ld hl,t_BC.DE.HL.SP ;181c 21 a2 1f ! . .
+l181fh:
+ push bc ;181f c5 .
+ call sub_030ah ;1820 cd 0a 03 . . .
+ jr nc,l182bh ;1823 30 06 0 .
+ ld a,b ;1825 78 x
+ rlca ;1826 07 .
+ rlca ;1827 07 .
+ rlca ;1828 07 .
+ rlca ;1829 07 .
+ scf ;182a 37 7
+l182bh:
+ pop bc ;182b c1 .
+ pop hl ;182c e1 .
+ ret ;182d c9 .
+
+sub_182eh:
+ call skipbl ;182e cd bf 02 . . .
+ push bc ;1831 c5 .
+ push hl ;1832 e5 .
+ ld hl,t_BCDEHL_HL_A ;1833 21 96 1f ! . .
+ call sub_030ah ;1836 cd 0a 03 . . .
+ ld a,b ;1839 78 x
+ pop hl ;183a e1 .
+ pop bc ;183b c1 .
+ ret ;183c c9 .
+
+sub_183dh:
+ push hl ;183d e5 .
+ push bc ;183e c5 .
+ ld hl,t_IX.IY ;183f 21 c8 1f ! . .
+ call sub_030ah ;1842 cd 0a 03 . . .
+ jr nc,l1852h ;1845 30 0b 0 .
+ ld a,0ddh ;1847 3e dd > .
+ dec b ;1849 05 .
+ jr nz,l184eh ;184a 20 02 .
+ ld a,0fdh ;184c 3e fd > .
+l184eh:
+ ld (prefix_ixiy),a ;184e 32 cc 18 2 . .
+ scf ;1851 37 7
+l1852h:
+ pop bc ;1852 c1 .
+ pop hl ;1853 e1 .
+ ret ;1854 c9 .
+sub_1855h:
+ push hl ;1855 e5 .
+ push bc ;1856 c5 .
+ ld a,(de) ;1857 1a .
+ cp '(' ;1858 fe 28 . (
+ jr nz,l18a1h ;185a 20 45 E
+ push de ;185c d5 .
+ inc de ;185d 13 .
+ ld hl,t_IX.IY ;185e 21 c8 1f ! . .
+ call sub_030ah ;1861 cd 0a 03 . . .
+ jr nc,l18a0h ;1864 30 3a 0 :
+ pop af ;1866 f1 .
+ ld a,0ddh ;1867 3e dd > .
+ dec b ;1869 05 .
+ jr nz,l186eh ;186a 20 02 .
+ ld a,0fdh ;186c 3e fd > .
+l186eh:
+ ld (prefix_ixiy),a ;186e 32 cc 18 2 . .
+ ld a,(de) ;1871 1a .
+ cp '+' ;1872 fe 2b . +
+ jr z,l1882h ;1874 28 0c ( .
+ cp ')' ;1876 fe 29 . )
+ ld hl,0 ;1878 21 00 00 ! . .
+ jr z,l189ah ;187b 28 1d ( .
+ cp '-' ;187d fe 2d . -
+ jp nz,ERROR ;187f c2 07 01 . . .
+l1882h:
+ push af ;1882 f5 .
+ inc de ;1883 13 .
+ call sub_17ffh ;1884 cd ff 17 . . .
+ pop af ;1887 f1 .
+ cp '+' ;1888 fe 2b . +
+ jr z,l1894h ;188a 28 08 ( .
+ ld b,h ;188c 44 D
+ ld c,l ;188d 4d M
+ ld hl,0 ;188e 21 00 00 ! . .
+ and a ;1891 a7 .
+ sbc hl,bc ;1892 ed 42 . B
+l1894h:
+ ld a,(de) ;1894 1a .
+ cp ')' ;1895 fe 29 . )
+ jp nz,ERROR ;1897 c2 07 01 . . .
+l189ah:
+ inc de ;189a 13 .
+ pop bc ;189b c1 .
+ ld c,l ;189c 4d M
+ pop hl ;189d e1 .
+ scf ;189e 37 7
+ ret ;189f c9 .
+l18a0h:
+ pop de ;18a0 d1 .
+l18a1h:
+ pop bc ;18a1 c1 .
+ pop hl ;18a2 e1 .
+ and a ;18a3 a7 .
+ ret ;18a4 c9 .
+
+sub_18a5h:
+ ld hl,t_tstfl_ZCPS ;18a5 21 dc 1f ! . .
+ ld c,007h ;18a8 0e 07 . .
+ jr l18b1h ;18aa 18 05 . .
+
+sub_18ach:
+ ld hl,t_tstfl_ZC ;18ac 21 cd 1f ! . .
+ ld c,003h ;18af 0e 03 . .
+l18b1h:
+ push bc ;18b1 c5 .
+ call sub_030ah ;18b2 cd 0a 03 . . .
+ ld a,b ;18b5 78 x
+ pop bc ;18b6 c1 .
+ ret nc ;18b7 d0 .
+ and c ;18b8 a1 .
+ rlca ;18b9 07 .
+ rlca ;18ba 07 .
+ rlca ;18bb 07 .
+ scf ;18bc 37 7
+ ret ;18bd c9 .
+
+assert_comma:
+ call next_arg ;18be cd ca 02 . . .
+ ret z ;18c1 c8 .
+l18c2h:
+ jp ERROR ;18c2 c3 07 01 . . .
+
+test_paren_close:
+ ld a,(de) ;18c5 1a .
+ cp ')' ;18c6 fe 29 . )
+ jr nz,l18c2h ;18c8 20 f8 .
+ inc de ;18ca 13 .
+ ret ;18cb c9 .
+
+prefix_ixiy:
+ db 0 ;18cc 00 .
+
+cmd_L:
+ ld hl,cmd_L ;18cd 21 cd 18 ! . .
+ ld (cmd_rpt),hl ;18d0 22 68 00 " h .
+ call expr ;18d3 cd be 03 . . .
+ jr nc,l18dbh ;18d6 30 03 0 .
+ ld hl,(last_L) ;18d8 2a f9 1f * . .
+l18dbh:
+ push hl ;18db e5 .
+ pop iy ;18dc fd e1 . .
+ call next_arg ;18de cd ca 02 . . .
+ call sub_039ah ;18e1 cd 9a 03 . . .
+ jr nc,l1905h ;18e4 30 1f 0 .
+ call assert_eol ;18e6 cd d6 02 . . .
+ ld b,010h ;18e9 06 10 . .
+l18ebh:
+ push bc ;18eb c5 .
+ push iy ;18ec fd e5 . .
+ pop hl ;18ee e1 .
+ push hl ;18ef e5 .
+ call sub_192dh ;18f0 cd 2d 19 . - .
+ call crlf ;18f3 cd a3 02 . . .
+ pop iy ;18f6 fd e1 . .
+ ld c,b ;18f8 48 H
+ ld b,0 ;18f9 06 00 . .
+ add iy,bc ;18fb fd 09 . .
+ ld (last_L),iy ;18fd fd 22 f9 1f . " . .
+ pop bc ;1901 c1 .
+ djnz l18ebh ;1902 10 e7 . .
+ ret ;1904 c9 .
+l1905h:
+ call assert_eol ;1905 cd d6 02 . . .
+ ld h,b ;1908 60 `
+ ld l,c ;1909 69 i
+ ld a,b ;190a 78 x
+ or c ;190b b1 .
+ jr nz,l190fh ;190c 20 01 .
+ dec hl ;190e 2b +
+l190fh:
+ push hl ;190f e5 .
+ push iy ;1910 fd e5 . .
+ pop hl ;1912 e1 .
+ push hl ;1913 e5 .
+ call sub_192dh ;1914 cd 2d 19 . - .
+ call crlf ;1917 cd a3 02 . . .
+ pop iy ;191a fd e1 . .
+ ld e,b ;191c 58 X
+ ld d,000h ;191d 16 00 . .
+ add iy,de ;191f fd 19 . .
+ ld (last_L),iy ;1921 fd 22 f9 1f . " . .
+ pop hl ;1925 e1 .
+ and a ;1926 a7 .
+ sbc hl,de ;1927 ed 52 . R
+ ret z ;1929 c8 .
+ ret c ;192a d8 .
+ jr l190fh ;192b 18 e2 . .
+
+sub_192dh:
+ call out.hl.@ ;192d cd a4 01 . . .
+ call z,outbl ;1930 cc 9f 02 . . .
+ call outbl ;1933 cd 9f 02 . . .
+ sub a ;1936 97 .
+ ld (con_col),a ;1937 32 72 02 2 r .
+ call sub_1965h ;193a cd 65 19 . e .
+ and a ;193d a7 .
+ ret z ;193e c8 .
+
+l193fh:
+ call outbl ;193f cd 9f 02 . . .
+ ld a,(con_col) ;1942 3a 72 02 : r .
+ cp 16 ;1945 fe 10 . .
+ jr c,l193fh ;1947 38 f6 8 .
+
+prnt_offset:
+ ld de,(offs.@) ;1949 ed 5b 64 00 . [ d .
+ ld a,d ;194d 7a z
+ or e ;194e b3 .
+ ret z ;194f c8 .
+ ld a,'(' ;1950 3e 28 > (
+ call outchar ;1952 cd 5d 02 . ] .
+ ld a,'@' ;1955 3e 40 > @
+ call outchar ;1957 cd 5d 02 . ] .
+ and a ;195a a7 .
+ sbc hl,de ;195b ed 52 . R
+ call out_hl ;195d cd 13 02 . . .
+ ld a,')' ;1960 3e 29 > )
+ jp outchar ;1962 c3 5d 02 . ] .
+
+sub_1965h:
+ sub a ;1965 97 .
+ ld (l1ffdh),a ;1966 32 fd 1f 2 . .
+ call disas_get_instrlen ;1969 cd 8c 19 . . .
+ jr nc,l197fh ;196c 30 11 0 .
+ push bc ;196e c5 .
+ call prnt_mnemonic ;196f cd b9 1e . . .
+ ex de,hl ;1972 eb .
+ call sub_19c1h ;1973 cd c1 19 . . .
+ pop bc ;1976 c1 .
+ ld a,(l1ffdh) ;1977 3a fd 1f : . .
+ ld hl,(l1ffbh) ;197a 2a fb 1f * . .
+ scf ;197d 37 7
+ ret ;197e c9 .
+
+l197fh:
+ ld hl,msg_undef_opcode ;197f 21 89 19 ! . .
+ call pstr ;1982 cd 88 02 . . .
+ ld b,001h ;1985 06 01 . .
+ sub a ;1987 97 .
+ ret ;1988 c9 .
+
+msg_undef_opcode:
+ DC '???'
+
+disas_get_instrlen:
+ sub a ;198c 97 .
+ ld (isprefix_ixiy),a ;198d 32 f8 1f 2 . .
+ ld a,(iy+000h) ;1990 fd 7e 00 . ~ .
+ cp 0edh ;1993 fe ed . .
+ jp z,disas_pfx.ED ;1995 ca 19 1a . . .
+ cp 0ddh ;1998 fe dd . .
+ jr z,l19abh ;199a 28 0f ( .
+ cp 0fdh ;199c fe fd . .
+ jr z,l19afh ;199e 28 0f ( .
+sub_19a0h:
+ ld a,(iy+000h) ;19a0 fd 7e 00 . ~ .
+ cp 0cbh ;19a3 fe cb . .
+ jp z,disas_pfx.CB ;19a5 ca 36 1a . 6 .
+ jp disas_nopfx ;19a8 c3 4d 1a . M .
+l19abh:
+ ld a,1 ;19ab 3e 01 > .
+ jr l19b1h ;19ad 18 02 . .
+l19afh:
+ ld a,2 ;19af 3e 02 > .
+l19b1h:
+ ld (isprefix_ixiy),a ;19b1 32 f8 1f 2 . .
+ call disas_pfx.DDFD ;19b4 cd c2 19 . . .
+ ret nc ;19b7 d0 .
+ push bc ;19b8 c5 .
+ call sub_19a0h ;19b9 cd a0 19 . . .
+ pop af ;19bc f1 .
+ add a,b ;19bd 80 .
+ ld b,a ;19be 47 G
+ scf ;19bf 37 7
+ ret ;19c0 c9 .
+
+sub_19c1h:
+ jp (hl) ;19c1 e9 .
+
+disas_pfx.DDFD:
+ inc iy ;19c2 fd 23 . #
+ ld hl,b_19ef_start ;19c4 21 ef 19 ! . .
+ call test_DDFD ;19c7 cd 8c 1a . . .
+ ld b,002h ;19ca 06 02 . .
+ ret c ;19cc d8 .
+ ld hl,l1a0ah ;19cd 21 0a 1a ! . .
+ call test_DDFD ;19d0 cd 8c 1a . . .
+ ld b,001h ;19d3 06 01 . .
+ ret c ;19d5 d8 .
+ ld a,(iy+000h) ;19d6 fd 7e 00 . ~ .
+ cp 0cbh ;19d9 fe cb . .
+ jr nz,l19edh ;19db 20 10 .
+ ld a,(iy+002h) ;19dd fd 7e 02 . ~ .
+ cp 036h ;19e0 fe 36 . 6
+ ret z ;19e2 c8 .
+ and 007h ;19e3 e6 07 . .
+ cp 006h ;19e5 fe 06 . .
+ jr nz,l19edh ;19e7 20 04 .
+ ld b,002h ;19e9 06 02 . .
+ scf ;19eb 37 7
+ ret ;19ec c9 .
+l19edh:
+ and a ;19ed a7 .
+ ret ;19ee c9 .
+
+; DD/FD 4 byte (ix+d)
+b_19ef_start:
+ defb 034h ;19ef 34 4
+ defb 035h ;19f0 35 5
+ defb 036h ;19f1 36 6
+ defb 046h ;19f2 46 F
+ defb 04eh ;19f3 4e N
+ defb 056h ;19f4 56 V
+ defb 05eh ;19f5 5e ^
+ defb 066h ;19f6 66 f
+ defb 06eh ;19f7 6e n
+ defb 070h ;19f8 70 p
+ defb 071h ;19f9 71 q
+ defb 072h ;19fa 72 r
+ defb 073h ;19fb 73 s
+ defb 074h ;19fc 74 t
+ defb 075h ;19fd 75 u
+; ????
+ defb 076h ;19fe 76 v ????
+ defb 077h ;19ff 77 w
+ defb 07eh ;1a00 7e ~
+ defb 086h ;1a01 86 .
+ defb 08eh ;1a02 8e .
+ defb 096h ;1a03 96 .
+ defb 09eh ;1a04 9e .
+ defb 0a6h ;1a05 a6 .
+ defb 0aeh ;1a06 ae .
+ defb 0b6h ;1a07 b6 .
+ defb 0beh ;1a08 be .
+ defb 0 ;1a09 00 .
+
+; DD/DF 3 byte
+l1a0ah:
+ defb 009h ;1a0a 09 .
+ defb 019h ;1a0b 19 .
+ defb 021h ;1a0c 21 !
+ defb 022h ;1a0d 22 "
+ defb 023h ;1a0e 23 #
+ defb 029h ;1a0f 29 )
+ defb 02ah ;1a10 2a *
+ defb 02bh ;1a11 2b +
+ defb 039h ;1a12 39 9
+ defb 0e1h ;1a13 e1 .
+ defb 0e3h ;1a14 e3 .
+ defb 0e5h ;1a15 e5 .
+ defb 0e9h ;1a16 e9 .
+ defb 0f9h ;1a17 f9 .
+ defb 0 ;1a18 00 .
+
+disas_pfx.ED:
+ inc iy ;1a19 fd 23 . #
+ ld hl,b_1bc9_start ;1a1b 21 c9 1b ! . .
+ call sub_1a72h ;1a1e cd 72 1a . r .
+ ld b,2 ;1a21 06 02 . .
+ ret c ;1a23 d8 .
+ ld hl,b_1bf4_start ;1a24 21 f4 1b ! . .
+ call lookup_opc ;1a27 cd 97 1a . . .
+ ld b,2 ;1a2a 06 02 . .
+ ret c ;1a2c d8 .
+ ld hl,b_1c40_start ;1a2d 21 40 1c ! @ .
+ call lookup_opc ;1a30 cd 97 1a . . .
+ ld b,4 ;1a33 06 04 . .
+ ret ;1a35 c9 .
+
+disas_pfx.CB:
+ push iy ;1a36 fd e5 . .
+ inc iy ;1a38 fd 23 . #
+ ld a,(isprefix_ixiy) ;1a3a 3a f8 1f : . .
+ and a ;1a3d a7 .
+ jr z,l1a42h ;1a3e 28 02 ( .
+ inc iy ;1a40 fd 23 . #
+l1a42h:
+ ld hl,b_1c55_start ;1a42 21 55 1c ! U .
+ call lookup_opc ;1a45 cd 97 1a . . .
+ pop iy ;1a48 fd e1 . .
+ ld b,2 ;1a4a 06 02 . .
+ ret ;1a4c c9 .
+
+disas_nopfx:
+ ld hl,b_1b54_start ;1a4d 21 54 1b ! T .
+ call lookup_opc ;1a50 cd 97 1a . . .
+ ld b,2 ;1a53 06 02 . .
+ ret c ;1a55 d8 .
+ ld hl,b_1ab6_start ;1a56 21 b6 1a ! . .
+ call sub_1a72h ;1a59 cd 72 1a . r .
+ ld b,1 ;1a5c 06 01 . .
+ ret c ;1a5e d8 .
+ ld hl,b_1ad1_start ;1a5f 21 d1 1a ! . .
+ call lookup_opc ;1a62 cd 97 1a . . .
+ ld b,1 ;1a65 06 01 . .
+ ret c ;1a67 d8 .
+ ld hl,b_1b9b_start ;1a68 21 9b 1b ! . .
+ call lookup_opc ;1a6b cd 97 1a . . .
+ ret nc ;1a6e d0 .
+ ld b,3 ;1a6f 06 03 . .
+ ret ;1a71 c9 .
+
+sub_1a72h:
+ ld a,(hl) ;1a72 7e ~
+ cp 0ffh ;1a73 fe ff . .
+ ret z ;1a75 c8 .
+ cp (iy+000h) ;1a76 fd be 00 . . .
+ jr z,l1a7fh ;1a79 28 04 ( .
+ inc hl ;1a7b 23 #
+ inc hl ;1a7c 23 #
+ jr sub_1a72h ;1a7d 18 f3 . .
+l1a7fh:
+ inc hl ;1a7f 23 #
+ ld c,(hl) ;1a80 4e N
+ ld hl,t_MNEMONICS ;1a81 21 c6 1e ! . .
+ ld b,0 ;1a84 06 00 . .
+ add hl,bc ;1a86 09 .
+ ld de,l1c97h ;1a87 11 97 1c . . .
+ scf ;1a8a 37 7
+ ret ;1a8b c9 .
+
+test_DDFD:
+ ld a,(hl) ;1a8c 7e ~
+ and a ;1a8d a7 .
+ ret z ;1a8e c8 .
+ inc hl ;1a8f 23 #
+ cp (iy+000h) ;1a90 fd be 00 . . .
+ jr nz,test_DDFD ;1a93 20 f7 .
+ scf ;1a95 37 7
+ ret ;1a96 c9 .
+
+lookup_opc:
+ ld a,(iy+000h) ;1a97 fd 7e 00 . ~ .
+ and (hl) ;1a9a a6 .
+ inc hl ;1a9b 23 #
+ cp (hl) ;1a9c be .
+ jr z,l1aa8h ;1a9d 28 09 ( .
+ inc hl ;1a9f 23 #
+ inc hl ;1aa0 23 #
+ inc hl ;1aa1 23 #
+ inc hl ;1aa2 23 #
+ ld a,(hl) ;1aa3 7e ~
+ and a ;1aa4 a7 .
+ jr nz,lookup_opc ;1aa5 20 f0 .
+ ret ;1aa7 c9 .
+l1aa8h:
+ inc hl ;1aa8 23 #
+ ld c,(hl) ;1aa9 4e N
+ inc hl ;1aaa 23 #
+ ld e,(hl) ;1aab 5e ^
+ inc hl ;1aac 23 #
+ ld d,(hl) ;1aad 56 V
+ ld hl,t_MNEMONICS ;1aae 21 c6 1e ! . .
+ ld b,000h ;1ab1 06 00 . .
+ add hl,bc ;1ab3 09 .
+ scf ;1ab4 37 7
+ ret ;1ab5 c9 .
+
+; 1 byte opcodes (no parameters)
+b_1ab6_start:
+ defb 076h ;1ab6 76 v
+ defb 039h ;1ab7 39 9
+ defb 0d9h ;1ab8 d9 .
+ defb 036h ;1ab9 36 6
+ defb 0f3h ;1aba f3 .
+ defb 02ch ;1abb 2c ,
+ defb 0fbh ;1abc fb .
+ defb 032h ;1abd 32 2
+ defb 000h ;1abe 00 .
+ defb 069h ;1abf 69 i
+ defb 007h ;1ac0 07 .
+ defb 09eh ;1ac1 9e .
+ defb 00fh ;1ac2 0f .
+ defb 0adh ;1ac3 ad .
+ defb 017h ;1ac4 17 .
+ defb 098h ;1ac5 98 .
+ defb 01fh ;1ac6 1f .
+ defb 0a7h ;1ac7 a7 .
+ defb 027h ;1ac8 27 '
+ defb 026h ;1ac9 26 &
+ defb 02fh ;1aca 2f /
+ defb 023h ;1acb 23 #
+ defb 037h ;1acc 37 7
+ defb 0bah ;1acd ba .
+ defb 03fh ;1ace 3f ?
+ defb 010h ;1acf 10 .
+ defb 0ffh ;1ad0 ff .
+
+; 1 byte opcodes
+b_1ad1_start:
+ defb 0c0h ;1ad1 c0 .
+ defb 040h ;1ad2 40 @
+ defb 056h ;1ad3 56 V
+ defw l1c88h ;1ad4 88 1c . .
+
+ defb 0f8h ;1ad6 f8 .
+ defb 080h ;1ad7 80 .
+ defb 003h ;1ad8 03 .
+ defw l1c91h ;1ad9 91 1c . .
+
+ defb 0f8h ;1adb f8 .
+ defb 088h ;1adc 88 .
+ defb 000h ;1add 00 .
+ defw l1c91h ;1ade 91 1c . .
+
+ defb 0f8h ;1ae0 f8 .
+ defb 090h ;1ae1 90 .
+ defb 0c9h ;1ae2 c9 .
+ defw l1e30h ;1ae3 30 1e 0 .
+
+ defb 0f8h ;1ae5 f8 .
+ defb 098h ;1ae6 98 .
+ defb 0b7h ;1ae7 b7 .
+ defw l1c91h ;1ae8 91 1c . .
+
+ defb 0f8h ;1aea f8 .
+ defb 0a0h ;1aeb a0 .
+ defb 006h ;1aec 06 .
+ defw l1e30h ;1aed 30 1e 0 .
+
+ defb 0f8h ;1aef f8 .
+ defb 0a8h ;1af0 a8 .
+ defb 0cch ;1af1 cc .
+ defw l1e30h ;1af2 30 1e 0 .
+
+ defb 0f8h ;1af4 f8 .
+ defb 0b0h ;1af5 b0 .
+ defb 06ch ;1af6 6c l
+ defw l1e30h ;1af7 30 1e 0 .
+
+ defb 0f8h ;1af9 f8 .
+ defb 0b8h ;1afa b8 .
+ defb 013h ;1afb 13 .
+ defw l1e30h ;1afc 30 1e 0 .
+
+ defb 0c7h ;1afe c7 .
+ defb 0c0h ;1aff c0 .
+ defb 08bh ;1b00 8b .
+ defw l1e9dh ;1b01 9d 1e . .
+
+ defb 0c7h ;1b03 c7 .
+ defb 0c7h ;1b04 c7 .
+ defb 0b4h ;1b05 b4 .
+ defw l1c98h ;1b06 98 1c . .
+
+ defb 0ffh ;1b08 ff .
+ defb 0c9h ;1b09 c9 .
+ defb 08bh ;1b0a 8b .
+ defw l1c97h ;1b0b 97 1c . .
+
+ defb 0cfh ;1b0d cf .
+ defb 0c1h ;1b0e c1 .
+ defb 081h ;1b0f 81 .
+ defw l1e86h ;1b10 86 1e . .
+
+ defb 0cfh ;1b12 cf .
+ defb 0c5h ;1b13 c5 .
+ defb 084h ;1b14 84 .
+ defw l1e86h ;1b15 86 1e . .
+
+ defb 0ffh ;1b17 ff .
+ defb 0e3h ;1b18 e3 .
+ defb 034h ;1b19 34 4
+ defw l1ca0h ;1b1a a0 1c . .
+
+ defb 0ffh ;1b1c ff .
+ defb 0e9h ;1b1d e9 .
+ defb 052h ;1b1e 52 R
+ defw l1caeh ;1b1f ae 1c . .
+
+ defb 0ffh ;1b21 ff .
+ defb 0ebh ;1b22 eb .
+ defb 034h ;1b23 34 4
+ defw l1cbbh ;1b24 bb 1c . .
+
+ defb 0ffh ;1b26 ff .
+ defb 0f9h ;1b27 f9 .
+ defb 056h ;1b28 56 V
+ defw l1cc1h ;1b29 c1 1c . .
+
+ defb 0cfh ;1b2b cf .
+ defb 003h ;1b2c 03 .
+ defb 041h ;1b2d 41 A
+ defw l1e8bh ;1b2e 8b 1e . .
+
+ defb 0cfh ;1b30 cf .
+ defb 00bh ;1b31 0b .
+ defb 029h ;1b32 29 )
+ defw l1e8bh ;1b33 8b 1e . .
+
+ defb 0c7h ;1b35 c7 .
+ defb 004h ;1b36 04 .
+ defb 041h ;1b37 41 A
+ defw l1e28h ;1b38 28 1e ( .
+
+ defb 0c7h ;1b3a c7 .
+ defb 005h ;1b3b 05 .
+ defb 029h ;1b3c 29 )
+ defw l1e28h ;1b3d 28 1e ( .
+
+ defb 0ffh ;1b3f ff .
+ defb 008h ;1b40 08 .
+ defb 034h ;1b41 34 4
+ defw l1ccdh ;1b42 cd 1c . .
+
+ defb 0cfh ;1b44 cf .
+ defb 009h ;1b45 09 .
+ defb 003h ;1b46 03 .
+ defw l1cd3h ;1b47 d3 1c . .
+
+ defb 0efh ;1b49 ef .
+ defb 002h ;1b4a 02 .
+ defb 056h ;1b4b 56 V
+ defw l1cdch ;1b4c dc 1c . .
+
+ defb 0efh ;1b4e ef .
+ defb 00ah ;1b4f 0a .
+ defb 056h ;1b50 56 V
+ defw l1ce5h ;1b51 e5 1c . .
+
+ defb 000h ;1b53 00 .
+
+; 2 byte opdodes
+b_1b54_start:
+ defb 0c7h ;1b54 c7 .
+ defb 006h ;1b55 06 .
+ defb 056h ;1b56 56 V
+ defw l1cfah ;1b57 fa 1c . .
+
+ defb 0ffh ;1b59 ff .
+ defb 0c6h ;1b5a c6 .
+ defb 003h ;1b5b 03 .
+ defw l1cf5h ;1b5c f5 1c . .
+
+ defb 0ffh ;1b5e ff .
+ defb 0ceh ;1b5f ce .
+ defb 000h ;1b60 00 .
+ defw l1cf5h ;1b61 f5 1c . .
+
+ defb 0ffh ;1b63 ff .
+ defb 0d6h ;1b64 d6 .
+ defb 0c9h ;1b65 c9 .
+ defw l1d09h ;1b66 09 1d . .
+
+ defb 0ffh ;1b68 ff .
+ defb 0deh ;1b69 de .
+ defb 0b7h ;1b6a b7 .
+ defw l1cf5h ;1b6b f5 1c . .
+
+ defb 0ffh ;1b6d ff .
+ defb 0e6h ;1b6e e6 .
+ defb 006h ;1b6f 06 .
+ defw l1d09h ;1b70 09 1d . .
+
+ defb 0ffh ;1b72 ff .
+ defb 0eeh ;1b73 ee .
+ defb 0cch ;1b74 cc .
+ defw l1d09h ;1b75 09 1d . .
+
+ defb 0ffh ;1b77 ff .
+ defb 0f6h ;1b78 f6 .
+ defb 06ch ;1b79 6c l
+ defw l1d09h ;1b7a 09 1d . .
+
+ defb 0ffh ;1b7c ff .
+ defb 0feh ;1b7d fe .
+ defb 013h ;1b7e 13 .
+ defw l1d09h ;1b7f 09 1d . .
+
+ defb 0ffh ;1b81 ff .
+ defb 010h ;1b82 10 .
+ defb 02eh ;1b83 2e .
+ defw l1d1ah ;1b84 1a 1d . .
+
+ defb 0ffh ;1b86 ff .
+ defb 018h ;1b87 18 .
+ defb 054h ;1b88 54 T
+ defw l1d1ah ;1b89 1a 1d . .
+
+ defb 0e7h ;1b8b e7 .
+ defb 020h ;1b8c 20
+ defb 054h ;1b8d 54 T
+ defw l1d0fh ;1b8e 0f 1d . .
+
+ defb 0ffh ;1b90 ff .
+ defb 0d3h ;1b91 d3 .
+ defb 076h ;1b92 76 v
+ defw l1d37h ;1b93 37 1d 7 .
+
+ defb 0ffh ;1b95 ff .
+ defb 0dbh ;1b96 db .
+ defb 03fh ;1b97 3f ?
+ defw l1d29h ;1b98 29 1d ) .
+
+ defb 000h ;1b9a 00 .
+
+; 3 byte opcodes
+b_1b9b_start:
+ defb 0c7h ;1b9b c7 .
+ defb 0c2h ;1b9c c2 .
+ defb 052h ;1b9d 52 R
+ defw l1d42h ;1b9e 42 1d B .
+
+ defb 0c7h ;1ba0 c7 .
+ defb 0c4h ;1ba1 c4 .
+ defb 00ch ;1ba2 0c .
+ defw l1d42h ;1ba3 42 1d B .
+
+ defb 0cfh ;1ba5 cf .
+ defb 001h ;1ba6 01 .
+ defb 056h ;1ba7 56 V
+ defw l1d5ah ;1ba8 5a 1d Z .
+
+ defb 0ffh ;1baa ff .
+ defb 0c3h ;1bab c3 .
+ defb 052h ;1bac 52 R
+ defw l1d48h ;1bad 48 1d H .
+
+ defb 0ffh ;1baf ff .
+ defb 0cdh ;1bb0 cd .
+ defb 00ch ;1bb1 0c .
+ defw l1d48h ;1bb2 48 1d H .
+
+ defb 0ffh ;1bb4 ff .
+ defb 022h ;1bb5 22 "
+ defb 056h ;1bb6 56 V
+ defw l1d62h ;1bb7 62 1d b .
+
+ defb 0ffh ;1bb9 ff .
+ defb 02ah ;1bba 2a *
+ defb 056h ;1bbb 56 V
+ defw l1d6bh ;1bbc 6b 1d k .
+
+ defb 0ffh ;1bbe ff .
+ defb 032h ;1bbf 32 2
+ defb 056h ;1bc0 56 V
+ defw l1d74h ;1bc1 74 1d t .
+
+ defb 0ffh ;1bc3 ff .
+ defb 03ah ;1bc4 3a :
+ defb 056h ;1bc5 56 V
+ defw l1d7fh ;1bc6 7f 1d  .
+
+ defb 000h ;1bc8 00 .
+
+; prefix ED + 1 byte opcode
+b_1bc9_start:
+ defb 044h ;1bc9 44 D
+ defb 066h ;1bca 66 f
+ defb 045h ;1bcb 45 E
+ defb 092h ;1bcc 92 .
+ defb 04dh ;1bcd 4d M
+ defb 08eh ;1bce 8e .
+ defb 067h ;1bcf 67 g
+ defb 0b1h ;1bd0 b1 .
+ defb 06fh ;1bd1 6f o
+ defb 0a2h ;1bd2 a2 .
+ defb 0a0h ;1bd3 a0 .
+ defb 05fh ;1bd4 5f _
+ defb 0a1h ;1bd5 a1 .
+ defb 01ch ;1bd6 1c .
+ defb 0a2h ;1bd7 a2 .
+ defb 04bh ;1bd8 4b K
+ defb 0a3h ;1bd9 a3 .
+ defb 07dh ;1bda 7d }
+ defb 0a8h ;1bdb a8 .
+ defb 058h ;1bdc 58 X
+ defb 0a9h ;1bdd a9 .
+ defb 015h ;1bde 15 .
+ defb 0aah ;1bdf aa .
+ defb 044h ;1be0 44 D
+ defb 0abh ;1be1 ab .
+ defb 079h ;1be2 79 y
+ defb 0b0h ;1be3 b0 .
+ defb 062h ;1be4 62 b
+ defb 0b1h ;1be5 b1 .
+ defb 01fh ;1be6 1f .
+ defb 0b2h ;1be7 b2 .
+ defb 04eh ;1be8 4e N
+ defb 0b3h ;1be9 b3 .
+ defb 072h ;1bea 72 r
+ defb 0b8h ;1beb b8 .
+ defb 05bh ;1bec 5b [
+ defb 0b9h ;1bed b9 .
+ defb 018h ;1bee 18 .
+ defb 0bah ;1bef ba .
+ defb 047h ;1bf0 47 G
+ defb 0bbh ;1bf1 bb .
+ defb 06eh ;1bf2 6e n
+ defb 0ffh ;1bf3 ff .
+
+b_1bf4_start:
+ defb 0e7h ;1bf4 e7 .
+ defb 040h ;1bf5 40 @
+ defb 03fh ;1bf6 3f ?
+ defw l1db3h ;1bf7 b3 1d . .
+
+ defb 0f7h ;1bf9 f7 .
+ defb 060h ;1bfa 60 `
+ defb 03fh ;1bfb 3f ?
+ defw l1db3h ;1bfc b3 1d . .
+
+ defb 0ffh ;1bfe ff .
+ defb 078h ;1bff 78 x
+ defb 03fh ;1c00 3f ?
+ defw l1db3h ;1c01 b3 1d . .
+
+ defb 0e7h ;1c03 e7 .
+ defb 041h ;1c04 41 A
+ defb 076h ;1c05 76 v
+ defw l1dbfh ;1c06 bf 1d . .
+
+ defb 0f7h ;1c08 f7 .
+ defb 061h ;1c09 61 a
+ defb 076h ;1c0a 76 v
+ defw l1dbfh ;1c0b bf 1d . .
+
+ defb 0ffh ;1c0d ff .
+ defb 079h ;1c0e 79 y
+ defb 076h ;1c0f 76 v
+ defw l1dbfh ;1c10 bf 1d . .
+
+ defb 0cfh ;1c12 cf .
+ defb 042h ;1c13 42 B
+ defb 0b7h ;1c14 b7 .
+ defw l1dcah ;1c15 ca 1d . .
+
+ defb 0cfh ;1c17 cf .
+ defb 04ah ;1c18 4a J
+ defb 000h ;1c19 00 .
+ defw l1dcah ;1c1a ca 1d . .
+
+ defb 0ffh ;1c1c ff .
+ defb 046h ;1c1d 46 F
+ defb 03dh ;1c1e 3d =
+ defw l1d85h ;1c1f 85 1d . .
+
+ defb 0ffh ;1c21 ff .
+ defb 056h ;1c22 56 V
+ defb 03dh ;1c23 3d =
+ defw l1d89h ;1c24 89 1d . .
+
+ defb 0ffh ;1c26 ff .
+ defb 05eh ;1c27 5e ^
+ defb 03dh ;1c28 3d =
+ defw l1d8dh ;1c29 8d 1d . .
+
+ defb 0ffh ;1c2b ff .
+ defb 047h ;1c2c 47 G
+ defb 056h ;1c2d 56 V
+ defw l1d92h ;1c2e 92 1d . .
+
+ defb 0ffh ;1c30 ff .
+ defb 057h ;1c31 57 W
+ defb 056h ;1c32 56 V
+ defw l1d97h ;1c33 97 1d . .
+
+ defb 0ffh ;1c35 ff .
+ defb 04fh ;1c36 4f O
+ defb 056h ;1c37 56 V
+ defw l1d9ch ;1c38 9c 1d . .
+
+ defb 0ffh ;1c3a ff .
+ defb 05fh ;1c3b 5f _
+ defb 056h ;1c3c 56 V
+ defw l1da1h ;1c3d a1 1d . .
+
+ defb 000h ;1c3f 00 .
+
+b_1c40_start:
+ defb 0efh ;1c40 ef .
+ defb 043h ;1c41 43 C
+ defb 056h ;1c42 56 V
+ defw l1dd3h ;1c43 d3 1d . .
+
+ defb 0ffh ;1c45 ff .
+ defb 073h ;1c46 73 s
+ defb 056h ;1c47 56 V
+ defw l1dd3h ;1c48 d3 1d . .
+
+ defb 0efh ;1c4a ef .
+ defb 04bh ;1c4b 4b K
+ defb 056h ;1c4c 56 V
+ defw l1ddch ;1c4d dc 1d . .
+
+ defb 0ffh ;1c4f ff .
+ defb 07bh ;1c50 7b {
+ defb 056h ;1c51 56 V
+ defw l1ddch ;1c52 dc 1d . .
+
+ defb 000h ;1c54 00 .
+
+; DD/FD CB
+b_1c55_start:
+ defb 0f8h ;1c55 f8 .
+ defb 000h ;1c56 00 .
+ defb 09bh ;1c57 9b .
+ defw l1e03h ;1c58 03 1e . .
+
+ defb 0f8h ;1c5a f8 .
+ defb 008h ;1c5b 08 .
+ defb 0aah ;1c5c aa .
+ defw l1e03h ;1c5d 03 1e . .
+
+ defb 0f8h ;1c5f f8 .
+ defb 010h ;1c60 10 .
+ defb 096h ;1c61 96 .
+ defw l1e03h ;1c62 03 1e . .
+
+ defb 0f8h ;1c64 f8 .
+ defb 018h ;1c65 18 .
+ defb 0a5h ;1c66 a5 .
+ defw l1e03h ;1c67 03 1e . .
+
+ defb 0f8h ;1c69 f8 .
+ defb 020h ;1c6a 20
+ defb 0c0h ;1c6b c0 .
+ defw l1e03h ;1c6c 03 1e . .
+
+ defb 0f8h ;1c6e f8 .
+ defb 028h ;1c6f 28 (
+ defb 0c3h ;1c70 c3 .
+ defw l1e03h ;1c71 03 1e . .
+
+ defb 0f8h ;1c73 f8 .
+ defb 038h ;1c74 38 8
+ defb 0c6h ;1c75 c6 .
+ defw l1e03h ;1c76 03 1e . .
+
+ defb 0c0h ;1c78 c0 .
+ defb 040h ;1c79 40 @
+ defb 009h ;1c7a 09 .
+ defw l1de4h ;1c7b e4 1d . .
+
+ defb 0c0h ;1c7d c0 .
+ defb 080h ;1c7e 80 .
+ defb 088h ;1c7f 88 .
+ defw l1de4h ;1c80 e4 1d . .
+
+ defb 0c0h ;1c82 c0 .
+ defb 0c0h ;1c83 c0 .
+ defb 0bdh ;1c84 bd .
+ defw l1de4h ;1c85 e4 1d . .
+
+ defb 000h ;1c87 00 .
+
+l1c88h:
+ call l1e28h ;1c88 cd 28 1e . ( .
+ call prnt_char_comma ;1c8b cd b4 1e . . .
+ jp l1e30h ;1c8e c3 30 1e . 0 .
+l1c91h:
+ call prnt_A_comma ;1c91 cd b1 1e . . .
+ jp l1e30h ;1c94 c3 30 1e . 0 .
+l1c97h:
+ ret ;1c97 c9 .
+l1c98h:
+ ld a,(iy+000h) ;1c98 fd 7e 00 . ~ .
+ and 038h ;1c9b e6 38 . 8
+ jp out_hex ;1c9d c3 18 02 . . .
+l1ca0h:
+ ld hl,b_1ca9_start ;1ca0 21 a9 1c ! . .
+ call pstr ;1ca3 cd 88 02 . . .
+ jp l1e7eh ;1ca6 c3 7e 1e . ~ .
+
+b_1ca9_start:
+ DC '(SP),'
+l1caeh:
+ ld a,'(' ;1cae 3e 28 > (
+ call outchar ;1cb0 cd 5d 02 . ] .
+ call l1e7eh ;1cb3 cd 7e 1e . ~ .
+ ld a,')' ;1cb6 3e 29 > )
+ jp outchar ;1cb8 c3 5d 02 . ] .
+l1cbbh:
+ ld hl,l1773h ;1cbb 21 73 17 ! s .
+ jp pstr ;1cbe c3 88 02 . . .
+l1cc1h:
+ ld hl,b_1cca_start ;1cc1 21 ca 1c ! . .
+ call pstr ;1cc4 cd 88 02 . . .
+ jp l1e7eh ;1cc7 c3 7e 1e . ~ .
+
+b_1cca_start:
+ DC 'SP,'
+l1ccdh:
+ ld hl,b_176d_start ;1ccd 21 6d 17 ! m .
+ jp pstr ;1cd0 c3 88 02 . . .
+l1cd3h:
+ call l1e7eh ;1cd3 cd 7e 1e . ~ .
+ call prnt_char_comma ;1cd6 cd b4 1e . . .
+ jp l1e8bh ;1cd9 c3 8b 1e . . .
+l1cdch:
+ call sub_1ce8h ;1cdc cd e8 1c . . .
+ call prnt_char_comma ;1cdf cd b4 1e . . .
+ jp prnt_char_A ;1ce2 c3 3d 1d . = .
+
+l1ce5h:
+ call prnt_A_comma ;1ce5 cd b1 1e . . .
+sub_1ce8h:
+ ld a,'(' ;1ce8 3e 28 > (
+ call outchar ;1cea cd 5d 02 . ] .
+ call l1e8bh ;1ced cd 8b 1e . . .
+ ld a,')' ;1cf0 3e 29 > )
+ jp outchar ;1cf2 c3 5d 02 . ] .
+l1cf5h:
+ call prnt_A_comma ;1cf5 cd b1 1e . . .
+ jr l1d09h ;1cf8 18 0f . .
+l1cfah:
+ call l1e28h ;1cfa cd 28 1e . ( .
+ call prnt_char_comma ;1cfd cd b4 1e . . .
+ ld a,(isprefix_ixiy) ;1d00 3a f8 1f : . .
+ and a ;1d03 a7 .
+ ld a,(iy+002h) ;1d04 fd 7e 02 . ~ .
+ jr nz,l1d0ch ;1d07 20 03 .
+l1d09h:
+ ld a,(iy+001h) ;1d09 fd 7e 01 . ~ .
+l1d0ch:
+ jp out_hex ;1d0c c3 18 02 . . .
+l1d0fh:
+ ld a,(iy+000h) ;1d0f fd 7e 00 . ~ .
+ and 018h ;1d12 e6 18 . .
+ call sub_1ea0h ;1d14 cd a0 1e . . .
+ call prnt_char_comma ;1d17 cd b4 1e . . .
+l1d1ah:
+ ld c,(iy+001h) ;1d1a fd 4e 01 . N .
+ ld a,c ;1d1d 79 y
+ rla ;1d1e 17 .
+ sbc a,a ;1d1f 9f .
+ ld b,a ;1d20 47 G
+ push iy ;1d21 fd e5 . .
+ pop hl ;1d23 e1 .
+ add hl,bc ;1d24 09 .
+ inc hl ;1d25 23 #
+ inc hl ;1d26 23 #
+ jr l1d4eh ;1d27 18 25 . %
+l1d29h:
+ call prnt_A_comma ;1d29 cd b1 1e . . .
+sub_1d2ch:
+ ld a,'(' ;1d2c 3e 28 > (
+ call outchar ;1d2e cd 5d 02 . ] .
+ ld a,(iy+001h) ;1d31 fd 7e 01 . ~ .
+ jp l1e6bh ;1d34 c3 6b 1e . k .
+l1d37h:
+ call sub_1d2ch ;1d37 cd 2c 1d . , .
+ call prnt_char_comma ;1d3a cd b4 1e . . .
+prnt_char_A:
+ ld a,'A' ;1d3d 3e 41 > A
+ jp outchar ;1d3f c3 5d 02 . ] .
+
+l1d42h:
+ call l1e9dh ;1d42 cd 9d 1e . . .
+ call prnt_char_comma ;1d45 cd b4 1e . . .
+l1d48h:
+ ld l,(iy+001h) ;1d48 fd 6e 01 . n .
+ ld h,(iy+002h) ;1d4b fd 66 02 . f .
+l1d4eh:
+ ld a,002h ;1d4e 3e 02 > .
+sub_1d50h:
+ ld (l1ffdh),a ;1d50 32 fd 1f 2 . .
+ ld (l1ffbh),hl ;1d53 22 fb 1f " . .
+ call out_hl ;1d56 cd 13 02 . . .
+ ret ;1d59 c9 .
+l1d5ah:
+ call l1e8bh ;1d5a cd 8b 1e . . .
+ call prnt_char_comma ;1d5d cd b4 1e . . .
+ jr l1d48h ;1d60 18 e6 . .
+l1d62h:
+ call sub_1e13h ;1d62 cd 13 1e . . .
+ call prnt_char_comma ;1d65 cd b4 1e . . .
+ jp l1e7eh ;1d68 c3 7e 1e . ~ .
+l1d6bh:
+ call l1e7eh ;1d6b cd 7e 1e . ~ .
+ call prnt_char_comma ;1d6e cd b4 1e . . .
+ jp sub_1e13h ;1d71 c3 13 1e . . .
+l1d74h:
+ call sub_1e13h ;1d74 cd 13 1e . . .
+ call prnt_char_comma ;1d77 cd b4 1e . . .
+ ld a,'A' ;1d7a 3e 41 > A
+ jp outchar ;1d7c c3 5d 02 . ] .
+l1d7fh:
+ call prnt_A_comma ;1d7f cd b1 1e . . .
+ jp sub_1e13h ;1d82 c3 13 1e . . .
+l1d85h:
+ ld a,'0' ;1d85 3e 30 > 0
+ jr l1d8fh ;1d87 18 06 . .
+l1d89h:
+ ld a,'1' ;1d89 3e 31 > 1
+ jr l1d8fh ;1d8b 18 02 . .
+l1d8dh:
+ ld a,'2' ;1d8d 3e 32 > 2
+l1d8fh:
+ jp outchar ;1d8f c3 5d 02 . ] .
+l1d92h:
+ ld hl,b_1da7_start ;1d92 21 a7 1d ! . .
+ jr l1da4h ;1d95 18 0d . .
+l1d97h:
+ ld hl,l1daah ;1d97 21 aa 1d ! . .
+ jr l1da4h ;1d9a 18 08 . .
+l1d9ch:
+ ld hl,l1dadh ;1d9c 21 ad 1d ! . .
+ jr l1da4h ;1d9f 18 03 . .
+l1da1h:
+ ld hl,l1db0h ;1da1 21 b0 1d ! . .
+l1da4h:
+ jp pstr ;1da4 c3 88 02 . . .
+
+b_1da7_start:
+ DC 'I,A'
+l1daah:
+ DC 'A,I'
+l1dadh:
+ DC 'R,A'
+l1db0h:
+ DC 'A,R'
+
+l1db3h:
+ call l1e28h ;1db3 cd 28 1e . ( .
+ call prnt_char_comma ;1db6 cd b4 1e . . .
+ ld hl,t__C_ ;1db9 21 f4 1f ! . .
+ jp pstr ;1dbc c3 88 02 . . .
+l1dbfh:
+ ld hl,t__C_ ;1dbf 21 f4 1f ! . .
+ call pstr ;1dc2 cd 88 02 . . .
+ call prnt_char_comma ;1dc5 cd b4 1e . . .
+ jr l1e28h ;1dc8 18 5e . ^
+l1dcah:
+ call l1e7eh ;1dca cd 7e 1e . ~ .
+ call prnt_char_comma ;1dcd cd b4 1e . . .
+ jp l1e8bh ;1dd0 c3 8b 1e . . .
+l1dd3h:
+ call sub_1e13h ;1dd3 cd 13 1e . . .
+ call prnt_char_comma ;1dd6 cd b4 1e . . .
+ jp l1e8bh ;1dd9 c3 8b 1e . . .
+l1ddch:
+ call l1e8bh ;1ddc cd 8b 1e . . .
+ call prnt_char_comma ;1ddf cd b4 1e . . .
+ jr sub_1e13h ;1de2 18 2f . /
+l1de4h:
+ ld a,(isprefix_ixiy) ;1de4 3a f8 1f : . .
+ and a ;1de7 a7 .
+ jr nz,l1defh ;1de8 20 05 .
+ ld a,(iy+001h) ;1dea fd 7e 01 . ~ .
+ jr l1df2h ;1ded 18 03 . .
+l1defh:
+ ld a,(iy+002h) ;1def fd 7e 02 . ~ .
+l1df2h:
+ push af ;1df2 f5 .
+ rra ;1df3 1f .
+ rra ;1df4 1f .
+ rra ;1df5 1f .
+ and 007h ;1df6 e6 07 . .
+ add a,'0' ;1df8 c6 30 . 0
+ call outchar ;1dfa cd 5d 02 . ] .
+ call prnt_char_comma ;1dfd cd b4 1e . . .
+ pop af ;1e00 f1 .
+ jr l1e33h ;1e01 18 30 . 0
+l1e03h:
+ ld a,(isprefix_ixiy) ;1e03 3a f8 1f : . .
+ and a ;1e06 a7 .
+ jr nz,l1e0eh ;1e07 20 05 .
+ ld a,(iy+001h) ;1e09 fd 7e 01 . ~ .
+ jr l1e11h ;1e0c 18 03 . .
+l1e0eh:
+ ld a,(iy+002h) ;1e0e fd 7e 02 . ~ .
+l1e11h:
+ jr l1e33h ;1e11 18 20 .
+sub_1e13h:
+ ld a,'(' ;1e13 3e 28 > (
+ call outchar ;1e15 cd 5d 02 . ] .
+ ld l,(iy+001h) ;1e18 fd 6e 01 . n .
+ ld h,(iy+002h) ;1e1b fd 66 02 . f .
+ ld a,001h ;1e1e 3e 01 > .
+ call sub_1d50h ;1e20 cd 50 1d . P .
+ ld a,')' ;1e23 3e 29 > )
+ jp outchar ;1e25 c3 5d 02 . ] .
+l1e28h:
+ ld a,(iy+000h) ;1e28 fd 7e 00 . ~ .
+ rra ;1e2b 1f .
+ rra ;1e2c 1f .
+ rra ;1e2d 1f .
+ jr l1e33h ;1e2e 18 03 . .
+l1e30h:
+ ld a,(iy+000h) ;1e30 fd 7e 00 . ~ .
+l1e33h:
+ and 007h ;1e33 e6 07 . .
+ cp 006h ;1e35 fe 06 . .
+ jr nz,l1e73h ;1e37 20 3a :
+ ld a,(isprefix_ixiy) ;1e39 3a f8 1f : . .
+ and a ;1e3c a7 .
+ ld a,006h ;1e3d 3e 06 > .
+ jr z,l1e73h ;1e3f 28 32 ( 2
+ ld hl,b_1e78_start ;1e41 21 78 1e ! x .
+ ld a,(isprefix_ixiy) ;1e44 3a f8 1f : . .
+ dec a ;1e47 3d =
+ jr z,l1e4dh ;1e48 28 03 ( .
+ ld hl,l1e7bh ;1e4a 21 7b 1e ! { .
+l1e4dh:
+ call pstr ;1e4d cd 88 02 . . .
+ ld a,(iy+001h) ;1e50 fd 7e 01 . ~ .
+ and a ;1e53 a7 .
+ jp m,l1e61h ;1e54 fa 61 1e . a .
+ ld a,'+' ;1e57 3e 2b > +
+ call outchar ;1e59 cd 5d 02 . ] .
+ ld a,(iy+001h) ;1e5c fd 7e 01 . ~ .
+ jr l1e6bh ;1e5f 18 0a . .
+l1e61h:
+ ld a,'-' ;1e61 3e 2d > -
+ call outchar ;1e63 cd 5d 02 . ] .
+ ld a,(iy+001h) ;1e66 fd 7e 01 . ~ .
+ neg ;1e69 ed 44 . D
+l1e6bh:
+ call out_hex ;1e6b cd 18 02 . . .
+ ld a,')' ;1e6e 3e 29 > )
+ jp outchar ;1e70 c3 5d 02 . ] .
+l1e73h:
+ ld hl,t_BCDEHL_HL_A ;1e73 21 96 1f ! . .
+ jr l1eaah ;1e76 18 32 . 2
+
+b_1e78_start:
+ DC '(IX'
+l1e7bh:
+ DC '(IY'
+l1e7eh:
+ ld a,(isprefix_ixiy) ;1e7e 3a f8 1f : . .
+ ld hl,t_HL.IX.IY ;1e81 21 c6 1f ! . .
+ jr l1eaah ;1e84 18 24 . $
+l1e86h:
+ ld hl,t_BC.DE.HL.AF ;1e86 21 ab 1f ! . .
+ jr l1e8eh ;1e89 18 03 . .
+l1e8bh:
+ ld hl,t_BC.DE.HL.SP ;1e8b 21 a2 1f ! . .
+l1e8eh:
+ ld a,(iy+000h) ;1e8e fd 7e 00 . ~ .
+ rra ;1e91 1f .
+ rra ;1e92 1f .
+ rra ;1e93 1f .
+ rra ;1e94 1f .
+ and 003h ;1e95 e6 03 . .
+ cp 002h ;1e97 fe 02 . .
+ jr z,l1e7eh ;1e99 28 e3 ( .
+ jr l1eaah ;1e9b 18 0d . .
+l1e9dh:
+ ld a,(iy+000h) ;1e9d fd 7e 00 . ~ .
+sub_1ea0h:
+ rra ;1ea0 1f .
+ rra ;1ea1 1f .
+ rra ;1ea2 1f .
+ and 007h ;1ea3 e6 07 . .
+ ld hl,t_tstfl_ZCPS ;1ea5 21 dc 1f ! . .
+ jr l1eaah ;1ea8 18 00 . .
+l1eaah:
+ ld b,a ;1eaa 47 G
+ call sub_033dh ;1eab cd 3d 03 . = .
+ jp pstr ;1eae c3 88 02 . . .
+
+prnt_A_comma:
+ call prnt_char_A ;1eb1 cd 3d 1d . = .
+prnt_char_comma:
+ ld a,',' ;1eb4 3e 2c > ,
+ jp outchar ;1eb6 c3 5d 02 . ] .
+
+prnt_mnemonic:
+ call pstr ;1eb9 cd 88 02 . . .
+l1ebch:
+ call outbl ;1ebc cd 9f 02 . . .
+ inc c ;1ebf 0c .
+ ld a,c ;1ec0 79 y
+ cp 5 ;1ec1 fe 05 . .
+ jr nz,l1ebch ;1ec3 20 f7 .
+ ret ;1ec5 c9 .
+
+t_MNEMONICS:
+ DC 'ADC'
+ DC 'ADD'
+ DC 'AND'
+ DC 'BIT'
+ DC 'CALL'
+ DC 'CCF'
+ DC 'CP'
+ DC 'CPD'
+ DC 'CPDR'
+ DC 'CPI'
+ DC 'CPIR'
+ DC 'CPL'
+ DC 'DAA'
+ DC 'DEC'
+ DC 'DI'
+ DC 'DJNZ'
+ DC 'EI'
+ DC 'EX'
+ DC 'EXX'
+ DC 'HALT'
+ DC 'IM'
+ DC 'IN'
+ DC 'INC'
+ DC 'IND'
+ DC 'INDR'
+ DC 'INI'
+ DC 'INIR'
+ DC 'JP'
+ DC 'JR'
+ DC 'LD'
+ DC 'LDD'
+ DC 'LDDR'
+ DC 'LDI'
+ DC 'LDIR'
+ DC 'NEG'
+ DC 'NOP'
+ DC 'OR'
+ DC 'OTDR'
+ DC 'OTIR'
+ DC 'OUT'
+ DC 'OUTD'
+ DC 'OUTI'
+ DC 'POP'
+ DC 'PUSH'
+ DC 'RES'
+ DC 'RET'
+ DC 'RETI'
+ DC 'RETN'
+ DC 'RL'
+ DC 'RLA'
+ DC 'RLC'
+ DC 'RLCA'
+ DC 'RLD'
+ DC 'RR'
+ DC 'RRA'
+ DC 'RRC'
+ DC 'RRCA'
+ DC 'RRD'
+ DC 'RST'
+ DC 'SBC'
+ DC 'SCF'
+ DC 'SET'
+ DC 'SLA'
+ DC 'SRA'
+ DC 'SRL'
+ DC 'SUB'
+ DC 'XOR'
+ if 0
+ DC 'IN0'
+ DC 'MLT'
+ DC 'OTDM'
+ DC 'OTDMR'
+ DC 'OTIM'
+ DC 'OTIMR'
+ DC 'OUT0'
+ DC 'SLP'
+ DC 'TST'
+ DC 'TSTIO'
+ endif
+ DB 0
+
+t_BCDEHL_HL_A:
+ DC 'B'
+ DC 'C'
+ DC 'D'
+ DC 'E'
+ DC 'H'
+ DC 'L'
+ DC '(HL)'
+ DC 'A'
+ DB 0
+t_BC.DE.HL.SP:
+ DC 'BC'
+ DC 'DE'
+ DC 'HL'
+ DC 'SP'
+ DB 0
+t_BC.DE.HL.AF:
+ DC 'BC'
+ DC 'DE'
+t_HL.AF:
+ DC 'HL'
+ DC 'AF'
+ DB 0
+t_BC.DE.IY.SP:
+ DC 'BC'
+ DC 'DE'
+ DC 'IY'
+ DC 'SP'
+ DB 0
+t_BC.DE.IX.SP:
+ DC 'BC'
+ DC 'DE'
+ DC 'IX'
+ DC 'SP'
+ DB 0
+t_HL.IX.IY:
+ DC 'HL'
+t_IX.IY:
+ DC 'IX'
+ DC 'IY'
+ DB 0
+t_tstfl_ZC:
+ DC 'NZ'
+ DC 'Z'
+ DC 'NC'
+ DC 'C'
+ DC 'NE'
+ DC 'EQ'
+ DC 'GE'
+ DC 'LT'
+ DB 0
+t_tstfl_ZCPS:
+ DC 'NZ'
+ DC 'Z'
+ DC 'NC'
+ DC 'C'
+ DC 'PO'
+ DC 'PE'
+ DC 'P'
+ DC 'M'
+ DC 'NE'
+ DC 'EQ'
+ DC 'GE'
+ DC 'LT'
+ DC 'NV'
+ DC 'V'
+ DB 0
+t__C_:
+ DC '(C)'
+ DB 0
+
+isprefix_ixiy:
+ db 0 ;1ff8 00 .
+last_L:
+ dw TPA ;1ff9 00 01 .
+l1ffbh:
+ dw 0 ;1ffb 00 00 .
+l1ffdh:
+ db 0 ;1ffd 00 .
+
+sub_1ffeh:
+ ld hl,(REG.PC) ;1ffe 2a 60 00 * ` .
+ ld a,h ;2001 7c |
+ or l ;2002 b5 .
+ jr z,l2037h ;2003 28 32 ( 2
+ ld de,BDOS ;2005 11 05 00 . . .
+ and a ;2008 a7 .
+ sbc hl,de ;2009 ed 52 . R
+ ld hl,l20edh ;200b 21 ed 20 ! .
+ jr z,l2031h ;200e 28 21 ( !
+ ld iy,(REG.PC) ;2010 fd 2a 60 00 . * ` .
+ call disas_get_instrlen ;2014 cd 8c 19 . . .
+ jp nc,ERROR ;2017 d2 07 01 . . .
+ ld c,b ;201a 48 H
+ ld b,000h ;201b 06 00 . .
+ ld hl,(REG.PC) ;201d 2a 60 00 * ` .
+ add hl,bc ;2020 09 .
+ call sub_09cah ;2021 cd ca 09 . . .
+ ld iy,(REG.PC) ;2024 fd 2a 60 00 . * ` .
+ ld hl,b_2039_start ;2028 21 39 20 ! 9
+ call lookup_opc ;202b cd 97 1a . . .
+ ccf ;202e 3f ?
+ ret c ;202f d8 .
+ ex de,hl ;2030 eb .
+l2031h:
+ call CALL_HL ;2031 cd 0f 01 . . .
+ call c,sub_09cah ;2034 dc ca 09 . . .
+l2037h:
+ scf ;2037 37 7
+ ret ;2038 c9 .
+
+b_2039_start:
+ defb 0ffh ;2039 ff .
+ defb 0ddh ;203a dd .
+ defb 000h ;203b 00 .
+ defw l20a7h ;203c a7 20 .
+
+ defb 0ffh ;203e ff .
+ defb 0fdh ;203f fd .
+ defb 000h ;2040 00 .
+ defw l20ach ;2041 ac 20 .
+
+ defb 0ffh ;2043 ff .
+ defb 0edh ;2044 ed .
+ defb 000h ;2045 00 .
+ defw l20b8h ;2046 b8 20 .
+
+b_2048_start:
+ defb 0ffh ;2048 ff .
+ defb 0cdh ;2049 cd .
+ defb 000h ;204a 00 .
+ defw l2080h ;204b 80 20 .
+
+ defb 0ffh ;204d ff .
+ defb 0c3h ;204e c3 .
+ defb 000h ;204f 00 .
+ defw l208bh ;2050 8b 20 .
+
+ defb 0ffh ;2052 ff .
+ defb 0e9h ;2053 e9 .
+ defb 000h ;2054 00 .
+ defw l20a2h ;2055 a2 20 .
+
+ defb 0ffh ;2057 ff .
+ defb 0c9h ;2058 c9 .
+ defb 000h ;2059 00 .
+ defw l20dch ;205a dc 20 .
+
+ defb 0ffh ;205c ff .
+ defb 0cfh ;205d cf .
+ defb 000h ;205e 00 .
+ defw l2115h ;205f 15 21 . !
+
+ defb 0c7h ;2061 c7 .
+ defb 0c7h ;2062 c7 .
+ defb 000h ;2063 00 .
+ defw l20f9h ;2064 f9 20 .
+
+ defb 0c7h ;2066 c7 .
+ defb 0c4h ;2067 c4 .
+ defb 000h ;2068 00 .
+ defw l2080h ;2069 80 20 .
+
+ defb 0f7h ;206b f7 .
+ defb 010h ;206c 10 .
+ defb 000h ;206d 00 .
+ defw l2093h ;206e 93 20 .
+
+ defb 0e7h ;2070 e7 .
+ defb 020h ;2071 20
+ defb 000h ;2072 00 .
+ defw l2093h ;2073 93 20 .
+
+ defb 0c7h ;2075 c7 .
+ defb 0c2h ;2076 c2 .
+ defb 000h ;2077 00 .
+ defw l208bh ;2078 8b 20 .
+
+ defb 0c7h ;207a c7 .
+ defb 0c0h ;207b c0 .
+ defb 000h ;207c 00 .
+ defw l20c5h ;207d c5 20 .
+
+ defb 000h ;207f 00 .
+
+l2080h:
+ ld a,(b_21e2_start) ;2080 3a e2 21 : . !
+ and a ;2083 a7 .
+ jr nz,l208bh ;2084 20 05 .
+ ld a,(trace_call_flag) ;2086 3a e3 21 : . !
+ and a ;2089 a7 .
+ ret nz ;208a c0 .
+l208bh:
+ ld l,(iy+001h) ;208b fd 6e 01 . n .
+ ld h,(iy+002h) ;208e fd 66 02 . f .
+ scf ;2091 37 7
+ ret ;2092 c9 .
+l2093h:
+ ld c,(iy+001h) ;2093 fd 4e 01 . N .
+ ld a,c ;2096 79 y
+ rla ;2097 17 .
+ sbc a,a ;2098 9f .
+ ld b,a ;2099 47 G
+ ld hl,(REG.PC) ;209a 2a 60 00 * ` .
+ add hl,bc ;209d 09 .
+ inc hl ;209e 23 #
+ inc hl ;209f 23 #
+ scf ;20a0 37 7
+ ret ;20a1 c9 .
+l20a2h:
+ ld hl,(reg.l) ;20a2 2a 5a 00 * Z .
+ scf ;20a5 37 7
+ ret ;20a6 c9 .
+l20a7h:
+ ld hl,(reg.ix) ;20a7 2a 52 00 * R .
+ jr l20afh ;20aa 18 03 . .
+l20ach:
+ ld hl,(reg.iy) ;20ac 2a 50 00 * P .
+l20afh:
+ ld a,(iy+001h) ;20af fd 7e 01 . ~ .
+ cp 0e9h ;20b2 fe e9 . .
+ scf ;20b4 37 7
+ ret z ;20b5 c8 .
+ and a ;20b6 a7 .
+ ret ;20b7 c9 .
+l20b8h:
+ ld a,(iy+001h) ;20b8 fd 7e 01 . ~ .
+ cp 04dh ;20bb fe 4d . M
+ jr z,l20dch ;20bd 28 1d ( .
+ cp 045h ;20bf fe 45 . E
+ jr z,l20dch ;20c1 28 19 ( .
+ and a ;20c3 a7 .
+ ret ;20c4 c9 .
+l20c5h:
+ ld a,(iy+000h) ;20c5 fd 7e 00 . ~ .
+ ld (l20d7h),a ;20c8 32 d7 20 2 .
+ ld hl,(reg.f) ;20cb 2a 54 00 * T .
+ push hl ;20ce e5 .
+ pop af ;20cf f1 .
+ call l20d7h ;20d0 cd d7 20 . .
+ scf ;20d3 37 7
+ jr c,l20dch ;20d4 38 06 8 .
+ ret ;20d6 c9 .
+l20d7h:
+ nop ;20d7 00 .
+ and a ;20d8 a7 .
+ pop hl ;20d9 e1 .
+ inc hl ;20da 23 #
+ jp (hl) ;20db e9 .
+
+l20dch:
+ ld a,(b_21e2_start) ;20dc 3a e2 21 : . !
+ and a ;20df a7 .
+ jr nz,l20edh ;20e0 20 0b .
+ ld a,(trace_call_flag) ;20e2 3a e3 21 : . !
+ and a ;20e5 a7 .
+ jr z,l20edh ;20e6 28 05 ( .
+ call l20edh ;20e8 cd ed 20 . .
+ pop hl ;20eb e1 .
+ ret ;20ec c9 .
+l20edh:
+ ld hl,(reg_sp) ;20ed 2a 5c 00 * \ .
+ ld e,(hl) ;20f0 5e ^
+ inc hl ;20f1 23 #
+ ld d,(hl) ;20f2 56 V
+ ex de,hl ;20f3 eb .
+ call sub_09cah ;20f4 cd ca 09 . . .
+ and a ;20f7 a7 .
+ ret ;20f8 c9 .
+
+l20f9h:
+ ld a,(l0003h) ;20f9 3a 03 00 : . .
+ cp (iy+000h) ;20fc fd be 00 . . .
+ ret z ;20ff c8 .
+ ld a,(iy+000h) ;2100 fd 7e 00 . ~ .
+ and 038h ;2103 e6 38 . 8
+ ld l,a ;2105 6f o
+ ld h,000h ;2106 26 00 & .
+ ld a,(b_21e2_start) ;2108 3a e2 21 : . !
+ and a ;210b a7 .
+ jr nz,l2113h ;210c 20 05 .
+ ld a,(trace_call_flag) ;210e 3a e3 21 : . !
+ and a ;2111 a7 .
+ ret nz ;2112 c0 .
+l2113h:
+ scf ;2113 37 7
+ ret ;2114 c9 .
+l2115h:
+ and a ;2115 a7 .
+ ret ;2116 c9 .
+cmd_C:
+ ld hl,cmd_C ;2117 21 17 21 ! . !
+ ld a,001h ;211a 3e 01 > .
+ jr l2122h ;211c 18 04 . .
+cmd_T:
+ xor a ;211e af .
+ ld hl,cmd_T ;211f 21 1e 21 ! . !
+l2122h:
+ ld (cmd_rpt),hl ;2122 22 68 00 " h .
+ ld (trace_call_flag),a ;2125 32 e3 21 2 . !
+ ld a,(de) ;2128 1a .
+ sub 'N' ;2129 d6 4e . N
+ jr nz,l212eh ;212b 20 01 .
+ inc de ;212d 13 .
+l212eh:
+ ld (trace_N_flag),a ;212e 32 e7 21 2 . !
+ ld a,(de) ;2131 1a .
+ sub 'J' ;2132 d6 4a . J
+ jr nz,l2137h ;2134 20 01 .
+ inc de ;2136 13 .
+l2137h:
+ ld (trace_J_flag),a ;2137 32 e8 21 2 . !
+ call sub_21a6h ;213a cd a6 21 . . !
+ jr z,l2145h ;213d 28 06 ( .
+ ld hl,1 ;213f 21 01 00 ! . .
+ call get_lastarg_def ;2142 cd 69 03 . i .
+l2145h:
+ ld (trace_count),hl ;2145 22 e5 21 " . !
+ sub a ;2148 97 .
+ ld (l0941h),a ;2149 32 41 09 2 A .
+l214ch:
+ call sub_1ffeh ;214c cd fe 1f . . .
+ jr l21a3h ;214f 18 52 . R
+
+l2151h:
+ call bp_clr_temporary ;2151 cd 54 07 . T .
+ ld a,(trace_J_flag) ;2154 3a e8 21 : . !
+ and a ;2157 a7 .
+ jr nz,l216bh ;2158 20 11 .
+ ld iy,(REG.PC) ;215a fd 2a 60 00 . * ` .
+ call sub_21c8h ;215e cd c8 21 . . !
+ jr z,l216bh ;2161 28 08 ( .
+ ld hl,b_2048_start ;2163 21 48 20 ! H
+ call lookup_opc ;2166 cd 97 1a . . .
+ jr nc,l214ch ;2169 30 e1 0 .
+l216bh:
+ ld a,(trace_UW_flag) ;216b 3a e4 21 : . !
+ and a ;216e a7 .
+ jr z,l2188h ;216f 28 17 ( .
+ ld de,(trace_count) ;2171 ed 5b e5 21 . [ . !
+ call expr ;2175 cd be 03 . . .
+ ld a,h ;2178 7c |
+ or l ;2179 b5 .
+ add a,0ffh ;217a c6 ff . .
+ sbc a,a ;217c 9f .
+ ld hl,trace_UW_flag ;217d 21 e4 21 ! . !
+ xor (hl) ;2180 ae .
+ bit 1,a ;2181 cb 4f . O
+ jr z,l2193h ;2183 28 0e ( .
+l2185h:
+ jp l0902h ;2185 c3 02 09 . . .
+l2188h:
+ ld hl,(trace_count) ;2188 2a e5 21 * . !
+ dec hl ;218b 2b +
+ ld (trace_count),hl ;218c 22 e5 21 " . !
+ ld a,h ;218f 7c |
+ or l ;2190 b5 .
+ jr z,l2185h ;2191 28 f2 ( .
+l2193h:
+ call sub_1ffeh ;2193 cd fe 1f . . .
+ jr nc,l2185h ;2196 30 ed 0 .
+ ld a,(trace_N_flag) ;2198 3a e7 21 : . !
+ ld b,a ;219b 47 G
+ ld a,(l0941h) ;219c 3a 41 09 : A .
+ or b ;219f b0 .
+ ld (l0941h),a ;21a0 32 41 09 2 A .
+l21a3h:
+ jp user_go ;21a3 c3 25 0a . % .
+
+sub_21a6h:
+ call skipbl ;21a6 cd bf 02 . . .
+ xor a ;21a9 af .
+ ld (trace_UW_flag),a ;21aa 32 e4 21 2 . !
+ ld a,(de) ;21ad 1a .
+ cp 'U' ;21ae fe 55 . U
+ jr z,l21b5h ;21b0 28 03 ( .
+ cp 'W' ;21b2 fe 57 . W
+ ret nz ;21b4 c0 .
+l21b5h:
+ inc de ;21b5 13 .
+ push af ;21b6 f5 .
+ push de ;21b7 d5 .
+ call expr ;21b8 cd be 03 . . .
+ jp c,ERROR ;21bb da 07 01 . . .
+ call assert_eol ;21be cd d6 02 . . .
+ pop hl ;21c1 e1 .
+ pop af ;21c2 f1 .
+ ld (trace_UW_flag),a ;21c3 32 e4 21 2 . !
+ sub a ;21c6 97 .
+ ret ;21c7 c9 .
+
+sub_21c8h:
+ ld a,(iy+000h) ;21c8 fd 7e 00 . ~ .
+ cp 0edh ;21cb fe ed . .
+ jr z,l21dah ;21cd 28 0b ( .
+ and 0dfh ;21cf e6 df . .
+ cp 0ddh ;21d1 fe dd . .
+ ret nz ;21d3 c0 .
+ ld a,(iy+001h) ;21d4 fd 7e 01 . ~ .
+ cp 0e9h ;21d7 fe e9 . .
+ ret ;21d9 c9 .
+l21dah:
+ ld a,(iy+001h) ;21da fd 7e 01 . ~ .
+ and 0f7h ;21dd e6 f7 . .
+ cp 045h ;21df fe 45 . E
+ ret ;21e1 c9 .
+
+b_21e2_start:
+ db 0 ;21e2 00 .
+trace_call_flag:
+ db 0 ;1=call, 0=trace 21e3 00 .
+trace_UW_flag:
+ db 0 ;0 or 'U' or 'W' 21e4 00 .
+trace_count:
+ dw 0 ;21e5 00 00 .
+trace_N_flag:
+ db 0 ;0 if 'N' 21e7 00 .
+trace_J_flag:
+ db 0 ;0 if 'J' 21e8 00 .
+
+ddtz_size equ $-ddtz_base
+ddtz_end:
+
+;-------------------------------------------------------------------------------
+ .dephase
+bitmap:
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,001H,044H,040H,000H
+ db 000H,010H,084H,090H,080H,010H,000H,001H
+ db 024H,092H,049H,009H,024H,084H,080H,004H
+ db 080H,048H,055H,055H,055H,055H,055H,055H
+ db 054H,024H,042H,048H,000H,010H,000H,000H
+ db 000H,080H,000H,080H,002H,008H,010H,082H
+ db 004H,000H,080H,084H,044H,008H,024H,000H
+ db 084H,004H,082H,001H,000H,000H,041H,000H
+ db 008H,021H,002H,000H,000H,090H,000H,020H
+ db 020H,001H,000H,092H,004H,021H,009H,000H
+ db 000H,008H,010H,088H,004H,080H,000H,000H
+ db 004H,000H,020H,000H,000H,001H,000H,080H
+ db 020H,000H,084H,081H,004H,090H,040H,040H
+ db 010H,001H,001H,008H,002H,000H,000H,000H
+ db 091H,004H,000H,000H,000H,000H,024H,000H
+ db 000H,000H,010H,080H,00AH,0AAH,044H,020H
+ db 002H,000H,000H,000H,000H,008H,040H,000H
+ db 000H,000H,000H,000H,000H,000H,048H,088H
+ db 000H,00AH,0AAH,0A1H,012H,042H,008H,020H
+ db 002H,008H,000H,000H,000H,008H,002H,042H
+ db 040H,000H,000H,000H,001H,000H,001H,000H
+ db 021H,000H,000H,001H,000H,048H,020H,000H
+ db 010H,008H,000H,020H,040H,090H,004H,000H
+ db 010H,010H,000H,000H,000H,001H,024H,090H
+ db 080H,090H,092H,004H,001H,024H,092H,010H
+ db 092H,041H,008H,010H,021H,002H,042H,010H
+ db 000H,000H,012H,010H,048H,000H,000H,000H
+ db 000H,024H,092H,049H,024H,092H,009H,021H
+ db 024H,020H,090H,040H,008H,001H,000H,009H
+ db 009H,011H,000H,080H,008H,004H,000H,008H
+ db 000H,001H,020H,012H,010H,008H,000H,042H
+ db 049H,000H,010H,001H,020H,011H,000H,040H
+ db 020H,010H,000H,040H,000H,012H,000H,091H
+ db 000H,044H,080H,021H,024H,040H,009H,010H
+ db 089H,000H,010H,008H,040H,024H,010H,088H
+ db 049H,024H,020H,041H,000H,001H,022H,000H
+ db 000H,000H,010H,000H,000H,000H,020H,001H
+ db 000H,000H,020H,000H,000H,010H,000H,012H
+ db 000H,008H,000H,000H,004H,000H,002H,000H
+ db 000H,004H,000H,040H,000H,091H,020H,012H
+ db 012H,000H,000H,012H,000H,000H,000H,000H
+ db 048H,020H,002H,008H,002H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,050H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,008H,011H
+ db 024H,024H,004H,000H,010H,080H,092H,048H
+ db 000H,022H,049H,009H,008H,000H,002H,010H
+ db 040H,012H,042H,024H,044H,081H,024H,082H
+ db 048H,000H,020H,020H,080H,000H,081H,020H
+ db 000H,000H,000H,000H,000H,000H,000H,009H
+ db 024H,092H,049H,024H,092H,049H,024H,092H
+ db 049H,024H,092H,049H,024H,089H,024H,001H
+ db 000H,004H,009H,021H,004H,092H,040H,048H
+ db 090H,049H,022H,024H,090H,008H,002H,044H
+ db 089H,011H,000H,000H,020H,080H,000H,001H
+ db 024H,044H,000H,080H,092H,049H,024H,091H
+ db 020H,041H,008H,081H,000H,004H,000H,008H
+ db 040H,010H,000H,000H,000H,092H,002H,008H
+ db 004H,000H,004H,000H,000H,000H,000H,001H
+ db 002H,024H,082H,002H,048H,009H,000H,010H
+ db 020H,048H,002H,020H,000H,000H,000H,000H
+ db 000H,041H,000H,000H,000H,042H,008H,000H
+ db 004H,000H,000H,002H,000H,000H,010H,000H
+ db 000H,000H,000H,004H,001H,002H,042H,020H
+ db 084H,000H,088H,004H,000H,004H,080H,011H
+ db 010H,012H,004H,008H,041H,020H,020H,010H
+ db 089H,002H,008H,000H,000H,010H,040H,004H
+ db 081H,022H,042H,024H,020H,000H,049H,024H
+ db 092H,048H,000H,000H,024H,000H,000H,020H
+ db 082H,000H,000H,020H,000H,008H,024H,004H
+ db 090H,048H,082H,044H,008H,001H,020H,044H
+ db 000H,082H,020H,011H,000H,024H,092H,004H
+ db 080H,024H,092H,049H,024H,092H,049H,024H
+ db 092H,049H,024H,092H,049H,024H,092H,049H
+ db 024H,092H,049H,024H,092H,049H,024H,092H
+ db 049H,024H,088H,049H,024H,082H,010H,089H
+ db 024H,090H,081H,020H,000H,001H,004H,000H
+ db 000H,010H,001H,020H,000H,011H,020H,001H
+ db 010H,008H,000H,000H,040H,010H,040H,080H
+ db 020H,000H,024H,008H,024H,090H,092H,004H
+ db 024H,090H,000H,001H,024H,020H,002H,040H
+ db 000H,000H,009H,000H,021H,024H,009H,000H
+ db 090H,090H,088H,008H,001H,000H,048H,004H
+ db 002H,000H,012H,012H,040H,000H,012H,010H
+ db 092H,004H,090H,049H,021H,000H,040H,021H
+ db 008H,022H,009H,009H,002H,040H,000H,002H
+ db 000H,012H,042H,040H,000H,000H,081H,000H
+ db 049H,000H,022H,009H,000H,020H,092H,001H
+ db 000H,010H,000H,010H,020H,004H,092H,000H
+ db 000H,048H,000H,090H,082H,009H,000H,000H
+ db 048H,042H,049H,024H,090H,090H,000H,092H
+ db 000H,092H,044H,020H,000H,000H,000H,000H
+ db 000H,000H,000H,021H,008H,048H,020H,002H
+ db 000H,000H,024H,002H,000H,010H,000H,012H
+ db 040H,008H,044H,002H,020H,000H,084H,080H
+ db 048H,000H,080H,000H,090H,000H,080H,000H
+ db 042H,000H,000H,040H,001H,002H,008H,000H
+ db 088H,001H,024H,020H,090H,080H,024H,000H
+ db 081H,000H,002H,040H,008H,001H,024H,048H
+ db 048H,008H,008H,041H,008H,090H,044H,048H
+ db 048H,001H,001H,000H,001H,020H,012H,010H
+ db 002H,041H,020H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,004H,082H,041H,020H,008H
+ db 009H,001H,020H,090H,048H,024H,000H,000H
+ db 010H,040H,000H,000H,000H,000H,080H,000H
+ db 000H,000H,004H,021H,008H,042H,010H,084H
+ db 021H,008H,042H,010H,084H,021H,008H,042H
+ db 010H,084H,020H,084H,021H,008H,042H,010H
+ db 084H,021H,008H,041H,008H,042H,010H,084H
+ db 021H,000H,000H,000H,000H,000H,000H,084H
+ db 021H,008H,042H,010H,084H,021H,008H,042H
+ db 008H,042H,010H,042H,010H,084H,021H,008H
+ db 042H,024H,092H,001H,024H,080H,024H,024H
+ db 092H,041H,024H,092H,049H,009H,009H,009H
+ db 020H,002H,002H,040H,000H,010H,082H,048H
+ db 049H,000H,024H,089H,009H,024H,092H,042H
+ db 048H,000H,048H,042H,012H,000H,004H,092H
+ db 049H,009H,024H,092H,042H,000H,000H,009H
+ db 004H,000H,001H,000H,021H,000H,000H,010H
+ db 012H,009H,002H,010H,004H,004H,024H,000H
+ db 090H,084H,000H,000H,001H,004H,090H,092H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 080H,004H,012H,041H,011H,024H,012H,004H
+ db 021H,008H,042H,010H,084H,021H,008H,042H
+ db 020H,080H,000H,008H,008H,042H,000H,000H
+ db 000H,024H,020H,002H,008H,021H,002H,010H
+ db 000H,020H,080H,040H,049H,000H,080H,048H
+ db 009H,012H,012H,004H,084H,084H,009H,001H
+ db 001H,022H,004H,022H,024H,088H,000H,024H
+ db 084H,000H,000H,000H,000H,000H,000H,01AH
+ db 004H,000H,001H,000H,021H,000H,000H,010H
+ db 012H,009H,002H,010H,004H,004H,024H,000H
+ db 090H,084H,000H,000H,001H,004H,090H,092H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 000H,000H,000H,000H,000H,000H,000H,000H
+ db 080H,004H,012H,041H,011H,024H,012H,004H
+ db 021H,008H,042H,010H,084H,021H,008H,042H
+ db 020H,080H,000H,008H,008H,042H,000H,000H
+ db 000H,024H,020H,002H,008H,021H,002H,010H
+ db 000H,020H,080H,040H,049H,000H,080H,048H
+ db 009H,012H,012H,004H,084H,084H,009H,001H
+ db 001H,022H,004H,022H,024H,088H,000H,024H
+ db 084H,000H,000H,000H,000H,000H,000H
+
+ end
diff --git a/doc/ddtz-de.txt b/doc/ddtz-de.txt
new file mode 100644
index 0000000..57a5271
--- /dev/null
+++ b/doc/ddtz-de.txt
@@ -0,0 +1,1141 @@
+
+
+
+ ***************************************
+ ***** *****
+ ***** DDTZ *****
+ ***** *****
+ ***************************************
+
+ Ein Programmentwicklungs- und Fehlersuch-Werkzeug fuer Z80-
+ Mikrocomputer
+
+
+ Einfuehrung
+ ===========
+
+ Das DDTZ ist ein komfortables Werkzeug zum Entwickeln und
+ Austesten von Z80-Programmen, sowie zum Ueberpruefen des Zusam-
+ menwirkens zwischen Programm und Hardware-System.
+
+ Folgende Komponenten sind im DDTZ enthalten:
+
+ - Assembler zum Direkt-Eingeben von Programmaenderungen oder
+ kleineren vollstaendigen Programmen in Z80-Assemblersprache.
+ - Disassembler zum Rueck-Uebersetzen von Maschinenprogrammen.
+ - Tracer zum Ausfuehren von Programmen in Einzelschritten und
+ zur Programmausfuehrung mit vorgebbaren Abbruchbedingungen.
+ - Disk Ein/Ausgaberoutinen erlauben das Lesen und Schreiben von
+ Files.
+ - Ausdruck-Interpreter erlaubt bei allen Kommandos die Verwen-
+ dung von arithmetischen und logischen Ausdruecken mit HEX-,
+ Dezimal-, Binaer- und ASCII-Werten, sowie Speicher- und
+ Registerinhalten und Variablen.
+
+ Das DDTZ laeuft unter dem CP/M-Betriebssystem (Digital
+ Research, ab Version 1.4) und anderen dazu kompatiblen Sys-
+ temen. Es benoetigt eine Z80-CPU und belegt 8,5 KBytes Spei-
+ cher.
+ Da Konsol-Eingaben nur ueber die CP/M-Stringeingabefunktion
+ erfolgen, ist das DDTZ auch mit dem CP/M-Hilfsprogramm XSUB
+ lauffaehig.
+
+ Der Gebrauch des DDTZ
+ =====================
+
+ Der Aufruf
+ ----------
+
+ Auf Ihrer DDTZ-Originaldiskette befindet sich die File
+ DDTZ.COM. Bevor Sie diese das erste Mal aufrufen, kopieren Sie
+ bitte die File auf eine andere Diskette, die Sie dann zum
+ Arbeiten benutzen. Bewahren Sie die Originaldiskette an einem
+ sicheren Ort auf und benutzen Sie sie nur zum Anfertigen
+ weiterer Arbeitsdisketten. Verwenden Sie also nie das Original
+ als Arbeitsdiskette.
+
+ Das DDTZ wird entsprechend den CP/M-Regeln folgendermassen
+ aufgerufen:
+
+ DDTZ
+ oder
+ DDTZ d:filename.ext
+
+ Bei beiden Aufrufen laedt das Disk Operating System das DDTZ
+ bei Adresse 100H beginnened in den Speicher. Das DDTZ verlagert
+ sich danach automatisch direkt vor das BDOS und ueberschreibt
+ dabei den CCP. Dadurch wird der Speicher ab 100H fuer das zu
+ untersuchende Programm frei. Der Adressteil des Befehls JP BDOS
+ auf Adresse 5 wird erniedrigt, um den Anwenderprogramm die
+ durch das DDTZ verringerte Speichergroesse mitzuteilen. Der
+ urspruenglich vom DDTZ belegte Speicher wird daraufhin mit
+ Nullen geloescht.
+ Wurde im Aufruf ein Filename angegeben, so laedt das DDTZ die
+ File in den Speicher.
+ Nach Ausgabe des Prompt-Zeichens '>' ist das DDTZ betriebs-
+ bereit.
+
+ Die Kommandos
+ -------------
+
+ Jede Taetigkeit des DDTZ, z.B. Lesen einer File, Disassemblie-
+ ren eines Programm-Abschnittes usw. wird mit einem Kommando
+ eingelei-tet. Kommandos koennen immer dann eingegeben werden,
+ wenn das DDTZ mit dem Prompt-Zeichen '> ' oder '>>' seine
+ Bereitschaft anzeigt.
+
+ Kommandos beginnen mit einem der Zeichen '@' bis 'Z', eventuell
+ gefolgt von weiteren optionalen Buchstaben, sowie Argumenten.
+ Bei einigen Kommandos sind alle Argumente obligat, d.h. alle
+ Argumente muessen angegebnenwerden. Bei anderen Kommandos sind
+ jedoch die Argumente alle oder zum Teil optional, d.h. sie
+ koennen entweder explizit angegeben werden, duerfen aber auch
+ weggelassen werden. Wird eine optionale Anfangsadresse wegge-
+ lassen, so wird die Adresse benutzt, bei der das Kommando
+ zuletzt beendet wurde. Wird eine optionale Endadresse weggelas-
+ sen, so wird das Kommando (z.B. L oder D) so lange ausgefuehrt,
+ bis etwa ein Bildschirm vollgeschrieben ist. Ein weggelassenes
+ optionales Argument, hinter dem weitere Argumente angegeben
+ werden sollen, muss durch ein Komma ersetzt werden. Optionale
+ Elemente sind in den folgenden Kommando-Beschreibungen durch
+ eckige Klammern gekennzeichnet (die Klammern sind also nicht
+ mit einzugeben). Zwischen zwei Argumenten muss ein Blank, ein
+ Tab (^I) oder ein Komma stehen.
+
+ Argumente werden im allgemeinen als HEX-Zahlen eingegeben,
+ duerfen aber auch als Dezimal- und Binaerzahlen, als ASCII-
+ Werte, Variablen oder in Form arithmetischer Ausdruecke einge-
+ geben werden. HEX-Zahlen sind im DDTZ Zahlen, die aus den
+ Ziffern 0 bis 9 und den Buchstaben A bis F (oder a bis f)
+ bestehen und nicht durch weitere Zusaetze (z.B. Buchstabe H)
+ als HEX-Zahl gekennzeichnet sein muessen. Im Gegensatz zu den
+ meisten Assemblern sind HEX-Zahlen, deren erstes Zeichen ein
+ Buchstabe ist, im DDTZ erlaubt. Dezimal-Zahlen werden zur
+ Unterscheidung mit einem Punkt abgeschlossen und Binaerzahlen
+ tragen am Ende ein doppeltes Anfuehrungszeichen. Naeheres zur
+ Eingabe von Zahlen, Variablen und Ausdruecken finden Sie bei
+ der Beschreibung des H-Kommandos und im Anhang.
+
+ Bei Kommandos, die eine Start- und eine Endadresse erfordern,
+ kann anstelle der Endadresse auch der Buchstabe 'S', gefolgt
+ von einer Laengenangabe verwendet werden.
+ z.B. bedeutet D 1000 S 100 oder D1000s100
+ das selbe wie D 1000 10FF oder d1000,10ff
+
+ Bei allen Eingaben ist es einerlei, ob Gross- oder Kleinbuch-
+ staben verwendet werden. Die einzige Ausnahme ist die Eingabe
+ von ASCII-Zeichen und Zeichenketten.
+
+ Die Wiederhol-Funktion
+ ----------------------
+
+ Beim Gebrauch des DDTZ kommt es oefters vor, dass man einen
+ Befehl nicht nur einmal benutzt und danach einen anderen Befehl
+ anwendet, sondern das man ein und denselben Befehl mehrmals
+ wiederholen will. Moechte man z.B. ein Programm in Einzel-
+ schritten ausfuehren lassen, um nach jedem Schritt die Register
+ zu inspizieren, so waere fuer jeden Schritt die Eingabe eines
+ Trace-Kommandos ohne Argumente notwendig (also der Buchstabe
+ 'T' und die Return-Taste). Ein weiteres Beispiel ist das Ueber-
+ pruefen der Hardware eines Ausgabeports: Will man mit einem
+ Oszilloskop Signale eines Ausgabeports ueberpruefen, so waere
+ es sehr laestig, zur wiederholten Ausgabe eines Testbytes an
+ den Port waehrend der Beobachtung des Oszilloskops immer wieder
+ das 'O'-Kommando eingeben zu muessen.
+ Aus diesen Gruenden besitzt das DDTZ die Wiederholfunktion.
+ Diese bewirkt, dass bei einer leeren Eingabe (nur Return-Taste)
+ das letzte Kommando ohne Argumente wiederholt wird. Die Bereit-
+ schaft der Wiederhol-Funktion wird durch einen doppelten Prompt
+ '>>' anstelle des einfachen '> ' angezeigt.
+
+ Die Kommandos des DDTZ
+ ======================
+
+ Im Folgenden werden alle Kommandos des DDTZ erklaert und mit
+ Beispielen verdeutlicht. Im Bereich der Computertechnik hat es
+ sich international eingebuergert, englische Bezeichnungnen zu
+ benutzen. Deshalb sind auch beim DDTZ die Kommandos Abkuer-
+ zungen englischer Woerter. Diese sind neben einer deutschen
+ Bezeichnung am Anfang jeder Kommando-Erklaerung mit angegeben.
+ Zur Einarbeitung empfiehlt es sich, an dieser Stelle des DDTZ
+ schon einmal zu starten und die im kommenden Abschnitt erklaer-
+ ten Kommandos der Reihe nach auszuprobieren. Assemblieren Sie
+ ein simples Testprogramm mit dem A-Kommando,
+
+ z.B.: > A100
+ 0100 NOP ld a,0
+ 0102 NOP dec a
+ 0103 NOP jp nz,102
+ 0106 NOP jp 0
+ 0109 NOP .
+
+ Listen Sie das Programm dann mit dem L-Kommando in disassem-
+ blierter Form aus, setzen Sie einen Breakpoint auf Adresse 0
+ mit dem B-Kommando und starten Sie es mit dem G-Kommando usw.
+ Nach einigem Ausprobieren und Spielen mit dem DDTZ werden Sie
+ sicher schnell die vielen Moeglichkeiten dieses komfortablen
+ Werkzeugs kennen und nutzen koennen.
+
+ @
+ -
+
+ Anzeigen und eventuell Aendern des Displacement-Registers.
+ (examin [substitude] displacement register @)
+
+ Der derzeitige Wert wird angezeigt und ein neuer - angefor-
+ dert. Eine leere Eingabe (nur Return-Taste) belaesst den alten
+ Wert.
+
+ Ein mit dem DDTZ zu bearbeitendes Programm kann natuerlich nur
+ innerhalb des verfuegbaren Adressraums in den Speicher geladen
+ werden, muss also mindestens bei Adresse 100H beginnen und darf
+ sich nicht mit dem DDTZ oder dem System ueberlappen. Um ein
+ Programm, das beispielsweise bei Adresse 0 oder F000H beginnt,
+ zu bearbeiten, muss dieses entsprechend verschoben in den Spei-
+ cher geladen werden. Damit beim Disassemblieren, Modifizieren
+ mit Hilfe des eingebauten Assemblers, Auslisten in HEX/ASCII
+ usw. trotzdem die korrekten Adressen angezeigt werden, ist ein
+ Displacement-Register @ (Verschiebungsregister) vorhanden,
+ dessen Wert auf die Differenz Solladresse minus Ladeadresse
+ gesetzt werden kann. Ist @ ungleich Null, so zeigt das DDTZ
+ ueberall, wo Adressen ausgelistet werden, die Adressen auch in
+ der Form @xxxx an, wobei xxxx die Solladresse des verschobenen
+ Programms ist.
+ Eine andere Anwendungsmoeglichkeit des Displacement-Registers
+ ist das Bearbeiten von Subroutinen, die mit Hilfe eines Linkers
+ in ein Programm eingebunden wurden, und zu denen im Allgemeinen
+ nur ein Listing beginnend ab Adresse 0 vorhanden ist. In diesem
+ Fall wird das @-Register auf die aus der Symboltabelle des
+ Linkers zu entnehmende Anfangsadresse der Routine gesetzt.
+ Jeder Adresse xxxx im Listing entspricht dann die Adresse @xxxx
+ im Speicher.
+ Achtung: Programme, die (ohne Linker) im Speicher verschoben
+ wurden, koennen zwar z.B. disassembliert oder modifiziert,
+ jedoch nicht ausgefuehrt werden.
+
+ A
+ -
+ Assemblieren von Z80-Befehlen.
+ (Assemble Zilog Z80 mnemonics)
+
+ Beginnend bei der optionalen Anfangsadresse werden als Z80-
+ Mnemonics eingegebene Befehle direkt in den Speicher assem-
+ bliert. Das DDTZ zeigt jeweils den an dem betreffenden Spei-
+ cherplatz bereits stehenden Befehl zur Kontrolle an, worauf ein
+ neuer Z80-Befehl eingegeben werden oder mit einer leeren Ein-
+ gabe zum naechsten Befehl uebergegangen werden kann. Die Ein-
+ gabe eines Minuszeichens bewirkt ein Ruecksetzen auf den vor-
+ letzten Befehl zur Kontrolle oder Korrektur, ein Punkt beendet
+ das Assemblieren. Die Form der Befehle ist Zilog-kompatibel mit
+ einigen Erweiterungen:
+ Statt ADD A,... SBC A,... usw. koennen auch Kurzformen ADD ...
+ SBC ... usw. benutzt werden. Bei den Befehlen IN A,(ausdruck)
+ und OUT (ausdruck),A koennen die Klammern weggelassen werden.
+ Der Opcode ist von dem Argument durch Tabs oder Blanks ge-
+ trennt.
+ Auf die Adresse des Z80-Befehls kann - wie bei Assemblern
+ ueblich - mittels des $-Zeichens Bezug genommen werden, z.B.
+ ist der Befehl JR Z,$+4 identisch mit JR 204, wenn der Befehl
+ bei Adresse 200 steht.
+ Achtung: Da beim DDTZ HEX-Zahleneingaben ohne fuehrende Dezi-
+ malziffer zulaessig sind, koennen beim Assemblieren Zweideut-
+ igkeiten entstehen oder Fehler unerkannt bleiben, z.B. soll das
+ Register A mit dem Hex-Wert 0B geladen werden, so ist LD A,0B
+ einzugeben, da mit LD A,B das Register B angesprochen wird. Der
+ Befehl LD BC,DE wird als LD BC,0DE interpretiert, da es einen
+ Z80-Befehl, der das BC-Register aus dem DE-Register laedt,
+ nicht gibt.
+
+ B
+ -
+
+ Anzeigen aller Breakpoints.
+ (display all breakpoints)
+
+ Die Adressen, Wiederholungszaehler und Bedingungen aller ge-
+ setzten Breakpoints werden aufgelistet.
+
+
+ B breakp [breakp..]
+ -------------------
+
+ Breakpoints setzen.
+ (set breakpoints)
+
+ Zum Austesten eines Programms ist es erforderlich, das Programm
+ nicht nur starten zu koennen, sondern der Ablauf des Programms
+ muss sich auch bequem verfolgen und beobachten lassen. Neben
+ den Tracen (siehe Kommandos T und C) ist das Setzen von Break-
+ points (Unterbrechungspunkten) eine sehr komfortable Moeglich-
+ keit, den Programmablauf zu verfolgen.
+ Ein Breakpoint wird auf das erste Byte (den Opcode) eines
+ Maschinenbefehls gesetzt und bewirkt, dass der Programmablauf
+ unterbrochen wird, sobald der Programmzaehler bei dieser Adres-
+ se angekommen ist. Man kann dann die Registerinhalte inspizie-
+ ren, Speicherinhalte kontrollieren usw., um danach den Pro-
+ grammablauf fortzusetzen oder an einer anderen Stelle fortzu-
+ fahren.
+ Neben der Adresse, die bestimmt, wo der Breakpoint zu setzen
+ ist, koennen noch zusaetzliche Optionen gewaehlt werden.
+
+ Ein Breakpoint wird in folgender Form definiert:
+ [R] adresse [:zaehler] [I bedingung]
+ Der optionale Buchstabe R bedeutet, dass jedesmal beim Errei-
+ chen des Breakpoints die CPU-Registerinhalte ausgelistet werden
+ sollen, auch dann, wenn wegen eines Zaehlers oder einer Bedin-
+ gung der Breakpoint keinen Programmstopp bewirkt.
+ Die Adresse ist ein beliebiger Ausdruck, der auf einen Opcode
+ zeigen muss.
+ Der Zaehler kann auf einen Wert n<>1 gesetzt werden und be-
+ wirkt, dass jedesmal, wenn die Breakpointadresse durchlaufen
+ wird, der Zaehler um Eins erniedrigt wird und erst beim n-ten
+ Mal ein Programmstop erfolgt. Er steht dann auf 1.
+ Eine Bedingung (der Buchstabe I fuer 'if'='wenn', gefolgt von
+ einem Ausdruck) bestimmt, ob ein Programmstop bzw. ein Dekre-
+ mentieren des Wiederholungs-Zaehlers erfolgen soll.
+ z.B.: > B R 200 I ^A=0
+ listet jedesmal, wenn Adresse 200 angelaufen wird, die
+ Register aus und unterbricht den Programmlauf, falls das
+ A-Register den Wert 0 hat.
+ > B Y0:16., R $ I0
+ setzt zwei Breakpoints:
+ 1. Wird 16 mal die Adresse, die in der Variablen Y0
+ steht, angelaufen, so wird das Programm unterbrochen.
+ 2. Wird die Adresse, auf der der Programmzaehler zum
+ Zeitpunkt der Breakpoint-Eingabe stand, durchlaufen,
+ so werden die Register ausgelistet, aber nicht unter-
+ brochen (Bedingung immer 'falsch').
+
+ Um den Benutzer zusaetzliche Eingriffsmoeglichkeiten zu geben,
+ werden alle Breakpoints, auch mit Zaehlern ungleich Null oder
+ unerfuellten Bedingungen, trotzdem aktiv, wenn eine beliebige
+ Taste an der Konsole gedrueckt wird.
+ Wird ein Breakpoint auf eine Adresse gesetzt, auf der sich
+ bereits ein Breakpoint befindet, so wird der bereits vorhandene
+ automatisch geloescht.
+ Achtung: Breakpoints koennen nur im RAM gesetzt werden; in
+ Programmen die in ROM's oder EPROM's enthalten sind, sind
+ Breakpoints nicht moeglich (Siehe folgenden Abschnitt).
+
+ Interne Breakpointbehandlung des DDTZ:
+
+ Wird ein Programm mit dem G-Kommando gestartet, so ersetzt das
+ DDTZ alle Opcodes, auf die eine Breakpoint-Adresse zeigt, durch
+ einen Restart-Befehl RST n und bewahrt die Opcodes auf. In die
+ Adresse n, auf die der RST-Befehl springt, wird ein Sprungbe-
+ fehl eingesetzt, der in den Breakpoint-Handler des DDTZ fuehrt.
+ Nach einem Programmstop werden die Opcodes wieder eingesetzt,
+ sodass das Programm immer dann, wenn es dem Benutzer zugaeng-
+ lich ist, unmodifiziert ist. Als RST-Adresse ist 38H voreinge-
+ stellt. Ist die Adresse 38H jedoch fuer andere Zwecke bereits
+ vergeben, so kann der RST-Befehl geaendert werden, z.B. auf
+ 30H:
+ > AT4
+ xxx9 RST 38 rst 30
+ xxxA xxx .
+
+
+ BX
+ --
+
+ Loeschen aller Breakpoints.
+ (clear all breakpoints)
+
+ BX adresse [adresse..]
+ ----------------------
+
+ Loeschen der Breakpoints an den angegebenen Adressen.
+ (clear breakpoints)
+
+ C[N][J] ]befehlsanzahl]
+ C[N][J] W ausdruck
+ C[N][J] U ausdruck
+ ------------------
+
+ Tracen ueber CALLs [ohne Ausgabe] [nue Sprungbefehle]
+ / ..solange.. / ..bis..
+ (trace over CALLs [No list] [Jumps only] /..While../..Until..
+
+ Tracen wie mit dem T-Kommando, nur mit dem Unterschied, dass
+ eine Subroutine wie ein einzelner Maschinenbefehl gehandhabt
+ wird. Bei jedem CALL-Befehl wird also die aufgerufene Routine
+ in Echtzeit abgearbeitet und erst bei Erreichen des auf den
+ CALL-Befehl folgenden Befehls wird wieder in den Trace-Modus
+ zurueckgekehrt. (siehe T-Kommando).
+ Achtung: Das C-Kommando funktioniert nur dann, wenn die Subrou-
+ tine nach ihrer Beendigung zu der auf den CALL-Befehl folgenden
+ Adresse zurueckkehrt. Ein Programm der Form
+ CALL SUBR
+ DB ARG
+ mit einer Routine SUBR, die nach Abarbeitung hinter dem Argu-
+ ment ankommt, kann nicht mit C bearbeitet werden.
+
+
+ D [startadr] [endadr]
+ ---------------------
+
+ Auslisten des Speichers in HEX und ASCII
+ (Display memory in hex and ASCII)
+
+ Der Speicher-Inhalt wird beginnend bei der Startadresse bis zur
+ Endadresse in HEX und ASCII auf der Konsole ausgelistet. Die
+ ASCII-Anzeige ignoriert das Bit 7 des jeweiligen Bytes. Ist der
+ Wert eines Bytes nicht als ASCII-Zeichen druckbar, so wird
+ statt dessen ein Punkt ausgegeben.
+
+ F-Kommandozeile
+ ---------------
+
+ File-Cointrolblock und CP/M-Kommandozeile spezifizieren.
+ (specify Filename and command line)
+
+ Dieses Kommando hat zwei Anwendungen:
+
+ 1. Vor einem Einlesen oder Ausschreiben einer File vom DDTZ aus
+ wird mit dem F-Kommando der Filename angegeben.
+ z.B. Einlesen eines zu testenden Kopier-Programms mit dem
+ Namen 'COPY.COM' von der Diskette A:
+ > Fa:copy.com
+ > R
+ 2. Soll ein Programm ausgetestet werden, das beim Aufruf vom
+ CP/M aus eine Kommandozeile im Kommandopuffer bei 80H und
+ File-Control-Blocks bei 5CH und 6CH erwartet, so kann mit
+ dem F-Kommando des DDTZ der CP/M-Aufruf simuliert werden.
+ z.B. Das im obigen Beispiel eingelesene Programm soll so ab-
+ laufen als sei es vom CP/M aus mit dem Aufruf
+ A>COPY A:DESTIN.*=B:SOURCE.*
+ gestartet worden. Die Kommandozeile wird deshalb vor
+ dem Programmablauf mit
+ > FA:DESTIN.*=B:SOURCE.*
+ eingegeben.
+
+
+ G [startadr] [;breakp..]
+ ------------------------
+
+ Starte ein geladenes Programm, eventuell mit temporaeren Breakpoints.
+ (Go [to start] [with temporary breakpoints])
+
+ Wird eine Startadresse angegeben, so wird der Programmzaehler
+ des Z80 auf diese Adresse gesetzt, andernfalls wird bei dem
+ letzten Programmzaehlerstand fortgefahren. Im G-Kommando koen-
+ nen temporaere Breakpoints angegeben werden. Sie werden in der
+ gleichen Form wie die permanenten Breakpoints beim B-Kommando
+ spezifiziert und haben auch die gleiche Wirkung mit dem Unter-
+ schied, dass bei einem Programmstop an einem der temporaeren
+ oder permanenten Breakpoints die temporaeren automatisch ge-
+ loescht werden.
+ z.B. Vollstaendiges Abarbeiten eines CP/M-Programms, das mit
+ JP 0 endet:
+ > GL;0
+
+ H
+ -
+
+ Groesse und maximale Groesse von Files anzeigen.
+ (display High and maximal size of files)
+
+ Die hoechste von der zuletzt eingelesenen File belegte Adresse
+ wird angezeigt, sowie die hoechste von irgendeiner der einge-
+ lesenen Files belegte Adresse. Erstere ist auch in der Varia-
+ blen H, letztere in der Variablen M enthalten. (Siehe auch W-
+ und R-Kommando)
+
+ H ausdruck
+ H ausdruck ausdruck
+ -------------------
+
+ Berechnen eines Ausdrucks / Summe und Differenz zweier Ausdrucke.
+ (compute expressions / Hex and other sum and difference)
+
+ Wird ein Ausdruck angegeben, so zeigt das DDTZ dessen Ergebnis
+ an, werden zwei Ausdruecke angegeben, so werden deren Summe und
+ Differenz angezeigt. Ergebnisse werden in HEX, als negative
+ HEX-Zahl, in Dezimal, als negative Dezimalzahl, in Binaer und
+ das niederwertige Byte zusaetzlich als ASCII-Zeichen darge-
+ stellt. Nicht druckbare ASCII-Zeichen werden dabei als Control-
+ Zeichen in der Form Buchstabe minus '@' angezeigt.
+
+ Wie Ausdruecke formuliert werden, ist der Uebersichtlichkeit
+ halber im Anhang angegeben.
+
+ z.B.: Was ist die Endadresse eines 17 KByte langen Programms,
+ das bei Adresse 100H beginnt?
+ > H17.*1024.+100
+ 4500 -BB00 17664. -47872. 01000101"00000000" '@'-'@'
+ Der freie Speicher beginnt also bei 4500H.
+ z.B.: Beim Disassemblieren eines unbekannten Programms wird
+ eine Subroutine gefunden, die nacheinander mit den Werten
+ D8F0H, FC18H, FF9CH usw. in den Registern aufgerufen
+ wird. Was kann das fuer eine Routine sein?
+ > HD8F0
+ D8F0 -2710 55536. -10000. 11011000"11110000" 'p'.
+ > H fc18
+ FC18 -03E8 64536. -1000 11111100"00011000" 'X'-'@'
+ > H FF9CH
+ FF9C -0064 65436. -100 ...
+ Bei den Werten handelt es sich offenbar um dezimal -
+ 10000, -1000 usw.; die Routine hat also wahrscheinlich
+ etwas mit einer Binaer-zu-Dezimal-Umrechnung zu tun.
+
+ I [port]
+ --------
+
+ Einlesen eines Daten-Bytes von einem Port.
+ (input a byte from port)
+
+ Zum Austesten der Computer-Hardware koennen mit diesem Kommando
+ Bytes von Ports eingelesen und in HEX und binaer angezeigt
+ werden. Wird die Portadresse nicht angegeben, so wird der
+
+ zuletzt in einem frueheren I-Kommando angegebene Port ange-
+ sprochen. Die Moeglichkeit, bei Z80-I/O-Befehlen hardwareseitig
+ auch die Adressleitungen A15 bis A8 zur Informationsuebertra-
+ gung mitzuverwenden, ist im DDTZ realisiert. DDTZ-intern wird
+ die Portadresse als Zwei-Byte-Wort in das BC-Register
+ geladen und mit IN A,(C) der Port gelesen.
+ Bei diesem Kommando zeigt zeigt sich besonders der Vorteil der
+ Wiederholungsfunktion des DDTZ: Nachdem einmal das I-Kommando
+ explizit gegeben wurde, kann man, waehrend man verschiedene
+ Pegel an die Anschluesse des Ports anlegt, durch einfaches
+ Druecken der Return-Taste die Portabfrage wiederholen.
+
+ L [startadr] [endadr]
+ ---------------------
+
+ Listen eines Speicherbereichs in Z80-Mnemonics.
+ (List disassembled code)
+
+ Dieses Kommando disassembliert im Speicher stehende Programme.
+ (Beispiel: siehe Q-Kommando)
+
+
+ M[V] startadr endadr zieladr
+ ----------------------------
+
+ Umladen eines Speicherbereichs in einen anderen, eventuell vergleichen.
+ (Move memory [and verify])
+
+ Der Speicherinhalt beginnend bei der angegebenen Startadresse
+ bis (einschliesslich) zur angegebenen Endadresse wird in einen
+ anderen Bereich, beginnend bei der angegebenen Zieladresse,
+ kopiert. Wird der optionale Buchstabe V gegeben, so wird die
+ Kopie mit dem Original verglichen und etwaige Diffrenzen in HEX
+ ausgelistet. Differenzen koennen bei defektem Speicher ent-
+ stehen oder dann, wenn versehentlich in Bereiche kopiert wird,
+ die kein RAM enthalten. Das M-Kommando wird auch dann korrekt
+ ausgefuehrt, wenn der Quell- und der Zielbereich gegenseitig
+ ueberlappen. In diesem Fall ist ein Vergleichen allerdings
+ nicht moeglich, da beim Kopieren ja ein Teil des Quellbereichs
+ ueberschrieben wird.
+ Achten Sie bei diesem Kommando besonders darauf, dass Sie nicht
+ das DDTZ oder das Disk Operating System versehentlich ueber-
+ schreiben.
+
+ O [byte] [port]
+ ---------------
+
+ Ausgeben eines Datenbytes an einen Ausgabeport.
+ (Output a byte to a port)
+
+ Zum Austesten der Computer-Hardware koennen mit diesem Kommando
+ Bytes an Ports des Computersystems ausgegeben werden.
+ Achtung: Im Gegensatz zu dem Z80-Befehl OUT port,byte ist hier
+ aus folgendem Grund erst das Datenbyte und dann die Portadresse
+ anzugeben:
+ Die Portadresse kann weggelassen werden, falls ein Datenbyte an
+ den selben Port, wie in einem vorherigen O-Kommando spezifi-
+ ziert, ausgegeben werden soll.
+ Die Moeglichkeit, bei Z80-I/O-Befehlen hardwareseitig auch die
+ Adressleitungen A15 bis A8 zur Informationsuebertragung mitzu-
+ verwenden, ist im DDTZ realisiert. DDTZ-intern wird die Port-
+ adresse als Zwei-Byte-Wort in das BC-Register geladen und mit
+ OUT (C),A das Byte an den Port ausgegeben.
+
+ Q[J] startadr endadr bytes
+ --------------------------
+
+ Durchsuchen des Speichers nach einer gegebenen Folge von Bytes.
+ (Query memory for a byte string [justified])
+
+ Der Speicher wird beginnend bei der angegebnen Startadresse und
+ endet (einschliesslich) bei der angegebenen Endadresse auf eine
+ angegebene Byte-Folge hin durchsucht. Fundstellen werden wie
+ beim D-Kommando in HEX und ASCII ausgelistet. Das erste ge-
+ suchte Byte steht dabei jeweils am linken Bildrand. Wird der
+ optionale Buchstabe J gegeben, so werden jeweils noch 8 vorher-
+ gehende Bytes mit ausgelistet, sodass die gesuchte Byte-Folge
+ in der Bildmitte beginnt. Die Byte-Folge kann wie beim S-
+ Kommando eine Folge von HEX-Zahlen, Ausdruecken, Worten und
+ Text-Strings sein.
+
+ z.B. Ein zu untersuchendes Programm gibt an einem bestimmten
+ Punkt seines Ablaufes aus unbekannter Ursache die Meldung
+ "Hardware error" auf die Konsole aus und stoppt. Woher
+ kommt diese Meldung ?
+ > QJ l h 'Hardwar'
+ 1502 73 74 65 64 24 4E 6F 20 48 61 72 64 77 61 ...
+ Der Text "Hardware error beginnt also bei Adresse 150A. Wo
+ wird er ausgegeben ?
+ > QJ l h w150a
+ >
+ (Keine Meldung) Auf die Adresse wird also nicht direkt
+ zugegriffen. Vielleicht haben wir Glueck, indem wir
+ suchen, wo 'No Hardware error" ausgegeben wird. Dieser
+ Text beginnt bei 1507H.
+ > QJ l h w1507
+ 08FE 00 00 00 00 00 AF C9 21 07 15 CD 65 07 30 ...
+ > L8FE+7
+ 0905 LD HL,1507
+ 0908 CALL 0765
+ 090B JR NC,0910
+ 090D INC HL
+ 090E INC HL
+ 090F INC HL
+ 0910 CALL 0654
+ Die Subroutine, die bei Adresse 908 aufgerufen wird,
+ fuehrt also offenbar einen Test durch und meldet einen
+ Fehler im Carry-Flag. Der Text wird dann bei Adresse 910
+ ausgegeben.
+
+ R [displacement]
+ ----------------
+
+ Einlesen einer Binaer- oder HEX-File in den Speicher, eventuell
+ verschoben.
+ (Read a binary or hex file [add displacement])
+
+ Eine File, deren Name mit dem F-Kommando spezifiziert worden
+ sein muss, wird von der Diskette in den Speicher eingelesen.
+ Eine File, deren Name mit ".HEX" endet, wird als Intel-HEX-File
+ interpretiert; die Daten werden bei den in der File enthaltenen
+ Adressen im Speicher abgelegt. Jede andere File wird ohne jede
+ weitere Interpretation bei Adresse 100H beginnend in den Spei-
+ cher geladen.
+
+ Wird im R-Kommando ein Displacement angegeben, so wird eine
+ HEX-File bei der entsprechenden Adresse erhoeht um das Dis-
+ placement abgelegt, andere Files bei 100H+Displacement. Nach
+ dem Einlesen der File wird erst die hoechste von dieser File
+ belgte Speicheradresse ausgelistet und dann die hoechste von
+ irgendeiner File seit Starten des DDTZ belegte Adresse. Falls
+ das DDTZ statt dessen ein Fragezeichen ausgibt, konnte entweder
+ die File nicht gefunden werden, beim Lesen einer HEX-File wurde
+ ein Checksummenfehler entdeckt, oder die File belegt Speicher-
+ plaetze ausserhalb des Bereichs L bis T.
+ z.B.: Eine File TEST.BIN soll bei Adresse 2000H beginnend in
+ den Speicher geladen werden:
+ > Ftest.bin
+ > R2000-l
+ High = 277F Max = 277F
+
+ S [startadr]
+ ------------
+
+ Anzeigen und Aendern von Daten im Speicher
+ (Substitute memory)
+
+ Die Startadresse, oder wenn diese nicht angegeben wurde, die
+ Adresse bei der das letzte S-Kommando beendet wurde, wird auf
+ der Konsole ausgegeben, und danach wird das an dieser Stelle im
+ Speicher befindliche Byte in HEX angezeigt. Anschliessend
+ erwartet das DDTZ eine Eingabe, und zwar gibt es folgende
+ Moeglichkeiten:
+ - Eine leere Eingabe (nur Return-Taste) schreitet ohne Spei-
+ cheraenderung zur naechsten Adresse weiter.
+ - Ein Minus-Zeichen geht ohne Speicheraenderung einen
+ AdressSchritt zurueck.
+ - Ein Punkt (alleine in einer Zeile) beendet das Kommando.
+ - Ein Datenbyte oder eine Folge von von Datenbytes wird in
+ den Speicher eingetragen.
+
+ Datenbytes koennen folgendermassen eingegeben werden:
+ - Ausdruecke (im einfachsten Fall HEX-Zahlen) werden der
+ Reihe nach berechnet und eingetragen.
+ - W ausdruck berechnet den Ausdruck als Zwei-Byte-Wort und
+ traegt ihn in zwei Speicher-Bytes ein; erst das niederwer-
+ tige, dann das hoeherwertige Byte.
+ - Ein Apostroph, gefolgt von ASCII-Zeichen und einem
+ weiteren Apostroph bewirkt ein Eintragen einer ASCII-
+ Zeichenfolge. Kommt der Apostroph selbst in der Zeichen-
+ folge vor, so muss er zweimal gegeben werden. Folgt
+ auf den abschliessenden Apostroph ein Punkt, so wird das
+ Bit 7 des letzten Zeichens auf Eins gesetzt.
+ z.B. der Programmteil
+ 0200 CALL 1234H
+ 0203 DM 'Test ''1''' ; Test '1'
+ kann mit dem S-Kommando folgendermassen eingegeben werden:
+ > S200
+ 0200 00 cdW1234
+ 0203 00 'Test ''1'''.
+ 020B 00 -
+ 020A A7 .
+
+ T[N][J] ]befehlsanzahl]
+ T[N][J] W ausdruck
+ T[N][J] U ausdruck
+ ------------------
+
+ Tracen [ohne Ausgabe] [nur Sprungbefehle] / ..solange.. / ..bis..
+ (Trace [no list] [Jumps only] / ..While.. / ..Until..)
+
+ Im Gegensatz zum Starten eines Programms mit dem G-Kommando,
+ bei dem die Kontrolle voll dem auszufuehrenden Programm ueber-
+ geben wird und erst bei einem Breakpoint dem DDTZ zurueckge-
+ geben wird, behaelt beim Tracen das DDTZ die ganze Zeit die
+ Kontrolle. Das wird dadurch erreicht, dass das DDTZ automatisch
+ hinter jedem Befehl, bevor er ausgefuehrt wird, einen Break-
+ point einsetzt und nach Ausfuehrung des Befehls wieder loescht.
+ Bei bedingten Spruengen werden sogar zwei Breakpoints gesetzt,
+ einer hinter dem Sprungbefehl, der andere am Sprungziel. Das
+ Programm wird also in Einzelschritten ausgefuehrt. Nach jedem
+ Schritt legt das DDTZ die aktuellen Werte aller Register in
+ Speicherplaetze innerhalb des DDTZ ab, sodass die Register-
+ inhalte jederzeit ueberwacht werden koennen.
+ Das Tracen beginnt jeweils beim derzeitigen Stand des Programm-
+ zaehlers. Soll an einer anderen Stelle mit dem Tracen begonnen
+ werden, so muss der Programmzaehler mit dem X-Kommando neu
+ gesetzt werden.
+ Nach jedem Schritt werden alle Registerinhalte und der naechste
+ Z80-Befehl wie beim X-Kommando angezeigt.
+ Die einfachste Form des T-Kommandos ist nur der Buchstabe T
+ (gefolgt von der Return-Taste), worauf ein Einzelschritt ausge-
+ fuehrt wird. Falls das letzte Kommando bereits ein T-Kommando
+ war, genuegt wegen der Wiederholfunktion des DDTZ auch die
+ Return-Taste alleine, was das Einzelschritt-Tracen sehr er-
+ leichtert.
+ Wird im T-Kommando eine Befehlsanzahl angegeben, so werden
+ entsprechend viele Schritte hintereinander ausgefuehrt. In
+ diesem Fall kann, wie auch bei dem im Folgenden erlaeuterten
+ Tracen mit Abbruchkriterium, der Trace-Vorgang durch Druecken
+ einer beliebigen Taste der Konsole vorzeitig abgebrochen
+ werden. Das Tracen wird unabhaengig von einer angegebenen
+ Befehlsanzahl oder Bedingung abgebrochen, wenn ein Breakpoint
+ erreicht wird.
+ Wird der Buchstabe W, gefolgt von einem Ausdruck angegeben, so
+ wird das Programm solange im Trace-Modus abgearbeitet, wie der
+ Ausdruck 'wahr' ist, d.h. vor jedem Schritt wird der Ausdruck
+ berechnet und nur dann fortgefahren, wenn er ein von Null ver-
+ schiedenes Ergebnis hat.
+ Wird der Buchstabe U, gefolgt von einem Ausdruck angegeben, so
+ wird das Tracen dann abgebrochen, wenn der Ausdruck ein von
+ Null verschiedenes Ergebnis hat.
+ Bei allen Formen des T-Kommandos kann man durch Angabe des
+ Buchstaben N das Auslisten der Register abschalten, was die
+ Ausfuehrungszeit erheblich verkuerzt. In diesem Fall werden nur
+ beim Beenden des Trace die Registerinhalte angezeigt.
+ Die Angabe des Buchstabens J veranlasst das DDTZ, nur hinter
+ Befehle, die den Programmzaehler beeinflussen, Breakpoints zu
+ setzen, also bei den Befehlen JP,JR,CALL,RET. Es werden dann
+ auch nur bei diesen Befehlen die Registerinhalte angezeigt und
+ ein Abbruchkriterium geprueft.
+
+ Achtung: Da die Einzelschritt-Abarbeitung durch automatisches
+ Setzen von Breakpoints erreicht wird, ist es unmoeglich, Pro-
+ gramme in ROMs zu tracen. Subroutinen in ROMs koennen mit dem
+ G-Kommando und geeigneten Breakpoints oder mit dem C-Kommando
+ uebersprungen werden. Falls Teile des BIOS in ROMs stehen,
+ stoert dies nicht, solange das zu untersuchende Programm nur
+ BDOS-Aufrufe enthaelt. Bei BDOS-Aufrufen wird der Trace-Modus
+ verlassen und erst nach der Rueckkehr aus dem BDOS wieder
+ aufgenommen.
+ z.B.: > TNU(1234)='A'
+ traced das Programm ohne Registeranzeige, bis der Spei-
+ cherplatz 1234H das ASCII-Zeichen A enthaelt.
+ > TJW[^hl=0]&[^a<80]
+ traced die Sprungbefehle, solange das HL-Register Null
+ ist und das A-Register kleiner als 80H ist.
+
+
+ V startadr endadr zieladr
+ -------------------------
+ Vergleichen zweier Speicherbereiche.
+ (Verify (compare) two memory areas)
+
+ Der Inhalt des Speichers beginnend bei der angegebenen Start-
+ adresse bis (einschliesslich) zur angegebenen Endadresse wird
+ mit dem Inhalt eines gleich langen Bereichs beginnend bei der
+ angegebenen Zieladresse verglichen. Unterschiede werden in HEX
+ ausgelistet. Das Auslisten kann durch Druecken einer beliebigen
+ Taste der Konsole abgebrochen werden.
+
+
+ W startadr endadr
+ -----------------
+
+ Ausschreiben eines Speicherbereichs in eine File.
+ (Write a file to disk)
+
+ Der Inhalt des Speichers beginnend bei der angegebenen Start-
+ adresse bis (einschliesslich) zur angegebenen Endadresse wird
+ in eine File auf der Diskette geschrieben. Der Filename muss
+ vorher mit dem F-Kommando spezifiziert werden. Die Laenge des
+ abgespeicherten Bereiches wird vom DDTZ auf volle Saetze aufge-
+ rundet.
+ z.B.: In ein Programm namens PROG-ALT.COM sollen Aenderungen,
+ die in einer File PATCH.HEX enthalten sind, eingefuegt
+ werden, und das modifizierte Programm soll in einer File
+ namens PROG-NEU.COM auf Diskette B: abgelegt werden:
+ > Fprog-alt.com
+ > R
+ High = 257F Max = 257F
+ > Fpatch.hex
+ > R
+ High = 2345 Max = 257F
+ > Fb:prog-neu.com
+ > Wl m
+
+ X
+ -
+
+ Anzeigen aller Register und des Befehls, auf den der Programm-
+ zaehler zeigt.
+ (eXamine all cpu registers)
+
+ Jedesmal, wenn ein Breakpoint angelaufen wird oder ein Pro-
+ grammschritt getraced wird, legt das DDTZ die Registerinhalte
+ in einem innerhalb des DDTZ befindlichen Speicherbereich ab.
+ Wird mit G oder T die Ausfuehrung des Programms fortgesetzt, so
+ laedt das DDTZ vorher diese Daten wieder in die Register. Mit
+ dem X-Kommando koennen diese abgespeicherten Registerinhalte
+ jederzeit kontrolliert werden. Die Anzeige erfolgt, wie immer
+ im DDTZ, in HEX.
+ Die sechs gueltigen Bits des F- und des F'-Registers werden als
+ Buchstaben dargestellt. Das Interrupt-Flag wird wie ein Bit des
+ F-Registers angezeigt.
+ Der Z80-Befehl, auf den der Programmzaehler zeigt, wird in dis-
+ assemblierter Form ausgegeben. Falls das Displacement-Register
+ @ von Null verschieden ist, wird der Programmzaehler auch
+ relativ dazu angezeigt.
+ z.B. Das Displacement-Register enthalte den Wert F00H, alle
+ Flags seien gesetzt, der Interrupt sei eingeschaltet und
+ die Register enthalten willkuerliche Werte:
+ > X
+ SZHVNCE A =12 BC =3456 DE =789A HL =BCDE SP=F012 PC=3456..
+ SZHVNC A'=78 BC'=9ABC DE'=DEF0 HL'=1234 IX=5678 IY=9ABC..
+ Nach einem Neustart des DDTZ enthalten die Register
+ folgende Werte:
+ E A =00 BC =0000 DE =0000 HL =0000 SP=AC00 PC=0100..
+ A'=00 BC'=0000 DE'=0000 HL'=0000 IX=0000 IY=0000..
+ Das Interrupt-Enabled-Flag ist gesetzt, falls beim Start des
+ DDTZ der Interrupt eingeschaltet war. Das I-Register enthaelt
+ den Wert, den es beim Start des DDTZ enthielt. Der Programm-
+ zaehler steht auf 100H, zeigt also auf den Anfang des Benutzer-
+ speichers. Der Stackpointer zeigt auf das obere Ende des Be-
+ nutzerspeichers, abgerundet auf volle 100H. Alle anderen Re-
+ gister enthalten Nullen.
+
+ X register
+ ----------
+
+ Anzeigen und eventuell modifizieren eines Registers.
+ (eXamine [and substitute] a register)
+
+ Nach Eingabe des Buchstabens X, gefolgt von einem Register-
+ namen, wird der betreffende Registerinhalt ausgegeben und ein
+ neuer Wert angefordert. Eine leere Eingabe (nur Return-Taste)
+ laesst den Registerinhalt unveraendert; ein eingegebener Wert
+ oder Ausdruck wird in das Register eingetragen. Ist das ange-
+ waehlte Register das F- oder F'-Register, so werden die Flags
+ als Buchstaben angezeigt. Daraufhin koennen durch Eingabe neuer
+ Buchstaben in beliebiger Reihenfolge die entsprechenden Flags
+ gesetzt werden, wobei nicht gegebene Flags zurueckgesetzt
+ werden. Das Interrupt-Flag wird im DDTZ wie ein Flag des F-
+ Registers behandelt.
+
+ Die Namen der Register und der Flags der F-Register sind im
+ Anhang aufgelistet.
+
+ z.B. Setzen des HL-Registers auf ABCDH, des C-Registers auf den
+ ASCII-Wert 'A', und Setzen des Carryflags des F-Registers
+ und des Interrupt-Flags:
+ > Xhl
+ HL=1234 abcd
+ > Xc
+ C=40 'A'
+ > Xf
+ S VNCE ce
+
+
+ Y
+ -
+
+ Anzeigen aller Y-Variablen.
+ (examine all Y variables)
+
+ Beim Untersuchen eines Programms ist es vielfach von Vorteil,
+ wenn man bestimmte Adressen, Registerstaende, Zwischenergebnis-
+ se bei Berechnungen usw. festhalten kann und bei weiteren
+ Berechnungen oder DDTZ-Kommandos als Argumente einsetzen kann.
+ Fuer diesen Zweck haelt das DDTZ zehn frei verfuegbare Varia-
+ blen bereit, die mit Y0 bis Y9 bezeichnet sind. Die derzeitigen
+ Werte in diesen Variablen koennen mit dem Y-Kommando angezeigt
+ werden.
+ z.B. Nach dem Starten des DDTZ enthalten die Y-Variablen alle
+ den Wert Null:
+ > Y
+ Y0=0000 Y1=0000
+ Y2=0000 Y3=0000
+ Y4=0000 Y5=0000
+ Y6=0000 Y7=0000
+ Y8=0000 Y9=0000
+
+ Yziffer0bis9
+ ------------
+
+ Anzeigen und eventuell Modifizieren einer Y-Variablen.
+ (examine [and substitute] an Y variable)
+
+ Nach Eingabe des Buchstabens Y, unmittelbar gefolgt von einer
+ Ziffer 0 bis 9, wird der derzeitige Wert der berteffenden Y-
+ Variable angezeigt und ein neuer Wert angefordert. Eine leere
+ Eingabe (nur Return-Taste) laesst den Wert unveraendert, ein
+ angegebener Wert wird in die Variable eingetragen.
+ z.B. Ein File-Control-Block (33 Bytes lang), auf den zur Zeit
+ das DE-Register zeigt, soll im weiteren Verlauf eines
+ Programmtests oefters inspiziert werden. Statt sich den
+ Stand des DE-Registers zu merken oder zu notieren und
+ immer wieder einzugeben, kann er in eine Variable, z.B.
+ Y1, eingetragen werden:
+ > Y1
+ Y1=0000 ^de
+ Mit D y1 s 33. oder dy1s21 kann jetzt jederzeit der File-
+ Control-Block angesehen werden.
+
+
+ Z startadr endadr bytes
+ -----------------------
+
+ Vorbesetzen eines Speicherbereiches mit einer Byte-Folge.
+ (Zap (fill) memory with a byte string)
+
+ Der Speicher wird beginnend bei der angegebenen Startadresse
+ bis (einschliesslich) zur angegebenen Endadresse mit der ange-
+ gebenen Bytefolge belegt. Die Bytefolge wird genauso wie beim
+ S-Kommando angegeben. Ist sie kuerzer als der zu besetzende
+ Speicher, so wird die Bytefolge wiederholt, bis die Endadresse
+ erreicht ist.
+ z.B. Loeschen des gesamten Benutzerspeichers mit Nullen:
+ > Z l t 0
+ z.B. Fuellen eines bei der Adresse 1000H beginnenden, 10H Bytes
+ langen Puffers mit dem Text 'leer!', Carriage Return,
+ Linefeed:
+ > Z1000s10 'leer!',d,a
+ > D1000s12
+ 1000 6C 65 65 72 21 0D 0A 6C 65 65 72 21 0D 0A 6C..
+ 1010 00 00 ..
+ z.B. Durchfuehren eines einfachen Speichertests: Erst wird der
+ gesamte Benutzerspeicher mit einer krummen Anzahl, z.B.
+ sieben, Testbytes gefuellt und dann der Speicher mit sich
+ selbst, um die Laenge der Testbytefolge verschoben, ver-
+ glichen:
+ > Zl t 0 ff aa 55 a5 5a 0f
+ > Vl t-7 l+7
+
+ ANHANG
+ ======
+
+ Zusammenfassung der Kommandos
+ -----------------------------
+
+ > @
+ examine [substitute] displacement register @
+ Anzeigen und eventuell Aendern des Displacement-Registers
+
+ > A [startadresse]
+ Assemble Zilog Z80 mnemonics
+ Assemblieren von Z80-Befehlen
+
+ > B
+ display all breakpoints
+ Anzeigen aller Breakpoints
+ > B breakp [breakp..]
+ set breakpoints
+ Breakpoints setzen
+ > BX
+ clear all breakpoints
+ Loeschen aller Breakpoints
+ > BX adresse [adresse..]
+ clear breakpoints
+ Breakpoints loeschen
+
+ >>C[N][J] [befehlsanzahl]
+ >>C[N][J] W ausdruck
+ >>C[N][J] U ausdruck
+ trace over calls [No list] [Jumps only] /.While./.Until.
+ Tracen ueber CALLs [ohne Ausgabe] [nur Sprungbefehle]
+ /.solange./.bis.
+
+ >>D [startadr] [endadr]
+ Display memory in hex and ASCII
+ Auslisten des Speichers in HEX und ASCII
+
+ > Fkommandozeile
+ specifiy filename and command line
+ File-Controlblock und CP/M-Kommandozeile spezifizieren
+
+ > G [startadr] [;breakp..]
+ Go [to start] [with temporary breakpoints]
+ Starte ein geladenes Programm, eventuell mit temporaeren
+ Breakpoints
+
+ > H
+ display High and maximal size of files
+ Groesse und maximale Groesse von Files anzeigen
+ > H ausdruck
+ compute hex and other expressions
+ Berechnen eines Ausdrucks
+ > H ausdruck ausdruck
+ Hex and other sum and difference
+ Summe und Differenz zweier Ausdruecke
+
+ >>I [port]
+ Input a byte from port
+ Einlesen eines Daten-Bytes von einem Port
+
+ >>L [startadr] [endadr]
+ List disassembled code
+ Listen eines Speicherbereichs in Z80-Mnemonics
+
+ > M[V] startadr endadr zieladr
+ Move memory [and verify]
+ Umladen eines Speicherbereiches in einen anderen, evtl.
+ Vergleichen
+
+ >>O [byte] [port]
+ Output a byte to a port
+ Ausgeben eines Datenbytes an einen Ausgabeport
+
+ > Q[J] startadr endadr bytes
+ Query memory for a byte string [Justified]
+ Durchsuchen des Speichers nach einer gegebenen Folge von
+ Bytes
+
+ > R [displacement]
+ Read a binary or hex file ]add displacement]
+ Einlesen einer Binaer- oder HEX-File in den Speicher,
+ evtl. verschoben
+
+ > S [startadr]
+ Substitute Memory
+ Anzeigen und Aendern von Daten im Speicher
+
+ >>T[N][J] [befehlsanzahl]
+ >>T[N][J] W ausdruck
+ >>T[N][J] U ausdruck
+ Trace [no List] [Jumps only] / .While. / .Until.
+ Tracen [ohne Ausgabe] [nur Sprungbefehle] /.solange./.bis.
+
+ > Vstartadr endadr zieladr
+ Verify (compare) two memory areas
+ Vergleichen zweier Speicherbereiche
+
+ > Wstartadr endadr
+ Write a file to disk
+ Ausschreiben eines Speicherbereichs in eine File
+
+ > X
+ eXamine all cpu registers
+ Anzeigen aller Register und des Befehls, auf den der Pro-
+ grammzaehler zeigt
+ > X register
+ eXamine [and substitute] a register
+ Anzeigen und eventuell Modifizieren eines Registers
+
+ > Y
+ examine all Y variables
+ Anzeigen aller Y-Variablen
+ > Yziffer0bis9
+ examine [and substitute] an Y variable
+ Anzeigen und eventuell Modifizieren einer Y-Variablen
+
+ > Z startadr endadr bytes
+ Zap (fill) memory with a byte string
+ Vorbesetzen eines Speicherbereiches mit einer Byte-Folge
+
+
+ Registernamen
+ -------------
+
+ A , F , B , C , D , E , H , L ,BC , DE , HL
+ A', F', B', C', D', E', H', L',BC', DE', HL'
+ IX oder X , IY oder Y , Sp oder S , PC oder P , I
+
+ Flags des F- und des F'-Registers:
+
+ S Sign Vorzeichen
+ Z Zero Null
+ H Half carry Uebertrag von Bit 3 nach Bit 4
+ V oVerflow/parity Ueberlauf/ gerade Paritaet
+ N Negation NEG, DEC, SUB o.ae. wurde ausgefuehrt
+ C Carry Uebertrag von Bit 7
+ E Interrupt Enabled Das Interrupt-Flag wird im DDTZ wie
+ ein Flag des F-Registers behandelt.
+
+ Variablen und Konstanten
+ ------------------------
+
+ L Low Benutzerspeicher-Anfang. Festwert 100H
+ H High Hoechste Adresse der letzten gelesenen
+ File
+ M Max Maximale Adresse aller gelesenen Files
+ T Top Oberes Ende des Benutzerspeichers
+ @ Displacement Register
+ $ beim Assemblieren Anfangsadresse des
+ Befehls sonst = PC
+ Y0..Y9 Frei verwendbare Variablen
+ ^register Inhalt eines Registers
+ (adresse) Inhalt eines Speicherplatzes (Byte)
+ (adresse). Inhalt eines Speicherplatzes (Wort)
+
+ Ausdruecke
+ ----------
+
+ In allen Situationen, in denen Zahlen eingegeben werden koen-
+ nen, ist auch die Eingabe von Ausdruecken erlaubt.
+
+ Ausdruecke sind im allgemeinen arithmetische Ausdruecke, koen-
+ nen aber auch (zum Formulieren von Bedingungen) Relationen
+ sein. Relationen bestehen aus zwei arithmetischen Ausdruecken,
+ zwischen denen einer der folgenden Relationsoperatoren steht:
+ = <> > >= <= <
+
+ Relationen haben den Wert -1 (=0FFFFH), wenn die Relation wahr
+ ist, 0 sonst.
+ z.B. der Ausdruck 1+2=3 hat den Wert -1, und 'A'>'B' den Wert 0
+
+ Ein arithmetischer Ausdruck hat die folgende Form
+
+ faktor arithmetikoperator faktor arith... faktor
+
+
+ Die Arithmetikoperatoren sind
+ + - * / % Addition, Subtraktion, Mult., Division, Modulo
+ & ! # bitweise AND, OR, XOR
+
+ Ein Faktor hat die Form
+ [ausdruck] geklammerter Ausdruck
+ +faktor
+ -faktor Negation
+ ~faktor bitweise NOT (1er-Komplement)
+ 'a' Wert eines ASCII-Zeichens (a=druckbares Zeichen)
+ 'a'. " mit gesetzem Bit 7
+ 'ab' Wert zweier ASCII-Zeichen (a,b=druckbare Zeichen)
+ 'ab'. " das niederwertige Zeichen mit gesetztem Bit 7
+ (ausdruck) ein Byte im Speicher
+ (ausdruck). ein Wort im Speicher
+ hhhh[H] Hex-Zahl (h=0..9,A..F oder a..f)
+ ddddd. Dezimal-Zahl (d=0..9)
+ bbbbbbbb"bbbbbbbb" Binaer-Zahl (beliebig mit '"' unterteilt (b=0,1)
+
+ Enthaelt ein Ausdruck einen Relationsoperator, so werden erst
+ die beiden arithmetischen Ausdruecke berechnet und dann die
+ Relation.
+ Ein arithmetischer Ausdruck wird von links nach rechts be-
+ rechnet, also ohne Beachtung "Punktrechnung vor Strichrech-
+ nung", die Reihenfolge kann jedoch mit Klammern '[' und ']'
+ geaendert werden.
+ Ein Pluszeichen darf, wenn dabei der Ausdruck eindeutig bleibt,
+ weggelassen werden; z.B. ist @1000 dasselbe wie @+1000.
+ Ausdruecke duerfen keine Leerzeichen enthalten!
+
diff --git a/doc/ddtz-help.txt b/doc/ddtz-help.txt
new file mode 100644
index 0000000..13bea7f
--- /dev/null
+++ b/doc/ddtz-help.txt
@@ -0,0 +1,121 @@
+DDT/Z180 (ROM) Commands:
+> @ examine/substitute the displacement register @
+> A [address] Assemble
+> B[X] display [or clear] all Breakpoints
+ B breakp [:count] [breakp..] set Breakpoints
+ BX address [address..] clear Breakpoints
+>>C[N][J] [count] trace over Calls [No list] [Jumps only]
+ C[N][J] W|U expression trace over Calls While|Until ...
+>>D [startadr] [endadr] Display memory in hex and ascii
+> G [startadr] [;breakp..] Go [to start] [temporary breakpoints]
+> H display High and max load address (set by R cmd)
+> H expression [expression] compute Hex and other expressions
+>>I [port] Input a byte from port
+>>L [startadr] [endadr] List disassembled code
+> M[V] startadr endadr destadr Move memory [and verify]
+>>O [byte] [port] Output a byte to port
+> Q[J] startadr endadr bytes Qery memory for byte string [Justified]
+> R [displacement] Read intel hex from console [add displacemt]
+> S address Substitute memory
+>>T[N][J] [count] Trace [No list] [Jumps only] [count steps]
+ T[N][J] W|U expression Trace While|Until ...
+> V startadr endadr destadr Verify (compare) two memory areas
+> X[register] eXamine [and substitute] registers
+> Y[0..9] eXamine [and substitute] Y variables
+> Z startadr endadr bytes Zap (fill) memory with a byte string
+
+
+
+Registernamen:
+
+A , F , B , C , D , E , H , L ,BC , DE , HL
+A', F', B', C', D', E', H', L',BC', DE', HL'
+IX oder X , IY oder Y , SP oder S , PC oder P , I
+
+Flags des F- und des F'-Registers:
+
+S Sign Vorzeichen
+Z Zero Null
+H Half carry Uebertrag von bit 3 nach bit 4
+V oVerflow/parity Ueberlauf/gerade Paritaet
+N Negation NEG, DEC, SUB o.ae. ausgefuehrt
+C Carry Uebertrag von bit 7
+E interrupt Enabled das Interrupt flag wird im DDTZ wie
+ ein Flag des F-Registers behandelt.
+
+Variablen und Konstanten:
+
+L Low Benutzerspeicher-Anfang. Festwert 100H
+H High Hoechste Adresse der letzten gelesenen File
+M Max Maximale Adresse aller gelesenen Files
+T Top Oberes Ende des Benutzerspeichers
+@ Displacement Register
+$ beim Assemblieren Anfangsadresse des Befehls
+ sonst = PC
+Y0..Y9 frei verwendbare Variablen
+^register Inhalt eines Registers
+(adresse) Inhalt eines Speicherplatzes (Byte)
+(adresse). Inhalt eines Speicherplatzes (Wort)
+
+
+Allgemeines zum Gebrauch des DDTZ:
+
+Ausdruecke:
+
+In allen Situationen, in denen Zahlen eingegeben werden koennen, ist
+auch die Eingabe von Ausdruecken erlaubt.
+Ausdruecke haben die Form
+ arithmetischerexpression
+ oder arithmetischerexpression relationsoperator arithmetischerexpression
+Die relationsoperatoren sind
+= <> > >= <= <
+Der expression hat den Wert -1, wenn die Relation wahr ist, sonst 0.
+z.B: der expression 1+2=3 hat den Wert -1, und 'A'<'B' den Wert 0
+Ein arithmetischer expression hat die allgemeine Form
+ faktor arithmetikoperator faktor arith... faktor
+Die Arithmetikoperatoren sind
++ - * / % Plus, Minus, Multiplikation, Division, Modulo
+& ! # bitweise AND, OR, XOR
+
+Ein Faktor hat die Form
+[expression] geklammerter expression
++faktor
+-faktor Negation
+~faktor bitweise NOT
+'a' Wert eines ASCII-Zeichens
+'a'. mit gesetztem Bit 7
+'ab' Wert zweier ASCII-Zeichen
+'ab'. das niederwertige mit gesetztem bit 7
+(expression) ein Byte im Speicher
+(expression). ein Wort im Speicher
+variable eine der oben aufgezaehlten Variablen
+hhhh[H] Hex-Zahl
+ddddd. Dezimal-Zahl
+bbbbbbbb"bbbbbbbb" Binaer-Zahl (beliebig mit '"' unterteilt)
+
+Enthaelt ein expression einen Relationsoperator, so werden erst die
+beiden arithmetischen Ausdruecke berechnet und dann die Relation.
+Ein arithmetischer expression wird von links nach rechts berechnet,
+also ohne Beachtung 'Punktrechnung vor Strichrechnung', die Reihenfolge
+kann jedoch mit Klammern '[' und ']' geaendert werden.
+Ausdruecke duerfen keine Blanks enthalten.
+
+Befehle:
+
+Befehle beginnen mit einem der Zeichen '@' bis 'Z', eventuell gefolgt
+von weiteren optionalen Buchstaben, sowie Argumenten. Wird eine
+optionale Anfangsadresse weggelassen, so wird die Adresse benutzt,
+bei der Befehl zuletzt beendet wurde. Wird eine optionale Endadresse
+weggelassen, so wird der Befehl (z.B. L oder D) so lange ausgefuehrt,
+bis etwa ein Bildschirm vollgeschrieben ist. Ein weggelassenes
+optionales Argument, hinter dem weitere Argumente angegeben werden
+sollen, muss durch ein Komma ersetzt werden. Zwischen zwei Argumenten
+muss ein Blank, ein Tab (^I) oder ein Komma stehen.
+
+
+Bei Befehlen, die eine Start- und eine Endadresse erfordern, kann
+anstelle der Endadresse auch der Buchstabe 'S', gefolgt von einer
+Laengenangabe verwendet werden.
+ z.B. bedeutet D 1000 S 100 oder D1000S100
+ das selbe wie D 1000 10FF oder D1000,10FF
+
diff --git a/doc/ddtz-ref-short.txt b/doc/ddtz-ref-short.txt
new file mode 100644
index 0000000..e44450f
--- /dev/null
+++ b/doc/ddtz-ref-short.txt
@@ -0,0 +1,150 @@
+ANLEITUNG zum DDTZ
+Development Debugging Tool for Z80 microcomputers
+
+Zusammenfassung der Befehle:
+
+> @ examine [and substitute]
+ the displacement register @
+> A [startadresse] Assemble
+> B display all Breakpoints
+ B breakp [breakp..] [:count] set Breakpoints
+ BX clear all Breakpoints
+ BX adresse [adresse..] clear Breakpoints
+>>C[N][J] [befehlsanzahl] trace over Calls [no list] [jumps only]
+ C[N][J] W ausdruck ..while..
+ C[N][J] U ausdruck ..until..
+>>D [startadr] [endadr] Display memory in hex and ascii
+> F kommandozeile specify Filename and command line
+> G [startadr] [;breakp..] Go [to start] [temporary breakpoints]
+> H display High and maximal size of files
+> H ausdruck compute Hex and other expressions
+ H ausdruck ausdruck Hex and other sum and difference
+>>I [port] Input a byte from port
+>>L [startadr] [endadr] List disassembled code
+> M[V] startadr endadr zieladr Move memory [and verify]
+>>O [byte] [port] Output a byte to port
+> Q[J] startadr endadr bytes Qery memory for byte string [justified]
+> R [displacement] Read binary or hex file [add displacemt]
+> S startadr Substitute memory
+>>T[N][J] [befehlsanzahl] Trace [no list] [Jumps only]
+ T[N][J] W ausdruck ..while..
+ T[N][J] U ausdruck ..until..
+> V startadr endadr zieladr Verify (compare) two memory areas
+> W startadr endadr Write a file to disk
+> X eXamine all cpu registers
+ X register eXamine [and substitute] a register
+> Y eXamine all Y variables
+ Yziffer0bis9 eXamine [and substitute] an Y variable
+> Z startadr endadr bytes Zap (fill) memory with a byte string
+
+
+
+Registernamen:
+
+A , F , B , C , D , E , H , L ,BC , DE , HL
+A', F', B', C', D', E', H', L',BC', DE', HL'
+IX oder X , IY oder Y , SP oder S , PC oder P , I
+
+Flags des F- und des F'-Registers:
+
+S Sign Vorzeichen
+Z Zero Null
+H Half carry Uebertrag von bit 3 nach bit 4
+V oVerflow/parity Ueberlauf/gerade Paritaet
+N Negation NEG, DEC, SUB o.ae. ausgefuehrt
+C Carry Uebertrag von bit 7
+E interrupt Enabled das Interrupt flag wird im DDTZ wie
+ ein Flag des F-Registers behandelt.
+
+Variablen und Konstanten:
+
+L Low Benutzerspeicher-Anfang. Festwert 100H
+H High Hoechste Adresse der letzten gelesenen File
+M Max Maximale Adresse aller gelesenen Files
+T Top Oberes Ende des Benutzerspeichers
+@ Displacement Register
+$ beim Assemblieren Anfangsadresse des Befehls
+ sonst = PC
+Y0..Y9 frei verwendbare Variablen
+^register Inhalt eines Registers
+(adresse) Inhalt eines Speicherplatzes (Byte)
+(adresse). Inhalt eines Speicherplatzes (Wort)
+
+Aufruf des DDTZ:
+
+ DDTZ
+ oder DDTZ d:filename.ext
+
+Bei beiden Aufrufen laedt das Disk Operating System das DDTZ bei
+Adresse 100H beginnend in den Speicher. Das DDTZ verlagert sich
+danach direkt vor das BDOS und ueberschreibt dabei den CCP. Der
+Adressteil des Befehls JP BDOS auf Adresse 5 wird erniedrigt,
+um dem Anwenderprogramm die durch das DDTZ verringerte Speichergroesse
+mitzuteilen. Der urspruenglich vom DDTZ belegte Speicher wird daraufhin
+mit Nullen geloescht.
+Wurde im Aufruf ein Filename angegeben, so laedt das DDTZ die File
+in den Speicher. Nach Ausgabe des Prompt-Zeichens '>' ist das DDTZ
+betriebsbereit.
+
+
+Allgemeines zum Gebrauch des DDTZ:
+
+Ausdruecke:
+
+In allen Situationen, in denen Zahlen eingegeben werden koennen, ist
+auch die Eingabe von Ausdruecken erlaubt.
+Ausdruecke haben die Form
+ arithmetischerausdruck
+ oder arithmetischerausdruck relationsoperator arithmetischerausdruck
+Die relationsoperatoren sind
+= <> > >= <= <
+Der Ausdruck hat den Wert -1, wenn die Relation wahr ist, sonst 0.
+z.B: der Ausdruck 1+2=3 hat den Wert -1, und 'A'<'B' den Wert 0
+Ein arithmetischer Ausdruck hat die allgemeine Form
+ faktor arithmetikoperator faktor arith... faktor
+Die Arithmetikoperatoren sind
++ - * / % Plus, Minus, Multiplikation, Division, Modulo
+& ! # bitweise AND, OR, XOR
+
+Ein Faktor hat die Form
+[ausdruck] geklammerter Ausdruck
++faktor
+-faktor Negation
+~faktor bitweise NOT
+'a' Wert eines ASCII-Zeichens
+'a'. mit gesetztem Bit 7
+'ab' Wert zweier ASCII-Zeichen
+'ab'. das niederwertige mit gesetztem bit 7
+(ausdruck) ein Byte im Speicher
+(ausdruck). ein Wort im Speicher
+variable eine der oben aufgezaehlten Variablen
+hhhh[H] Hex-Zahl
+ddddd. Dezimal-Zahl
+bbbbbbbb"bbbbbbbb" Binaer-Zahl (beliebig mit '"' unterteilt)
+
+Enthaelt ein Ausdruck einen Relationsoperator, so werden erst die
+beiden arithmetischen Ausdruecke berechnet und dann die Relation.
+Ein arithmetischer Ausdruck wird von links nach rechts berechnet,
+also ohne Beachtung 'Punktrechnung vor Strichrechnung', die Reihenfolge
+kann jedoch mit Klammern '[' und ']' geaendert werden.
+Ausdruecke duerfen keine Blanks enthalten.
+
+Befehle:
+
+Befehle beginnen mit einem der Zeichen '@' bis 'Z', eventuell gefolgt
+von weiteren optionalen Buchstaben, sowie Argumenten. Wird eine
+optionale Anfangsadresse weggelassen, so wird die Adresse benutzt,
+bei der Befehl zuletzt beendet wurde. Wird eine optionale Endadresse
+weggelassen, so wird der Befehl (z.B. L oder D) so lange ausgefuehrt,
+bis etwa ein Bildschirm vollgeschrieben ist. Ein weggelassenes
+optionales Argument, hinter dem weitere Argumente angegeben werden
+sollen, muss durch ein Komma ersetzt werden. Zwischen zwei Argumenten
+muss ein Blank, ein Tab (^I) oder ein Komma stehen.
+
+
+Bei Befehlen, die eine Start- und eine Endadresse erfordern, kann
+anstelle der Endadresse auch der Buchstabe 'S', gefolgt von einer
+Laengenangabe verwendet werden.
+ z.B. bedeutet D 1000 S 100 oder D1000S100
+ das selbe wie D 1000 10FF oder D1000,10FF
+
diff --git a/doc/ddtz-ref.txt b/doc/ddtz-ref.txt
new file mode 100644
index 0000000..5d54569
--- /dev/null
+++ b/doc/ddtz-ref.txt
@@ -0,0 +1,204 @@
+ Zusammenfassung der Kommandos
+ -----------------------------
+
+ > @
+ examine [substitute] displacement register @
+ Anzeigen und eventuell Aendern des Displacement-Registers
+
+ > A [startadresse]
+ Assemble Zilog Z80 mnemonics
+ Assemblieren von Z80-Befehlen
+
+ > B
+ display all breakpoints
+ Anzeigen aller Breakpoints
+ > B breakp [breakp..]
+ set breakpoints
+ Breakpoints setzen
+ > BX
+ clear all breakpoints
+ Loeschen aller Breakpoints
+ > BX adresse [adresse..]
+ clear breakpoints
+ Breakpoints loeschen
+
+ >>C[N][J] [befehlsanzahl]
+ >>C[N][J] W ausdruck
+ >>C[N][J] U ausdruck
+ trace over calls [No list] [Jumps only] /.While./.Until.
+ Tracen ueber CALLs [ohne Ausgabe] [nur Sprungbefehle]
+ /.solange./.bis.
+
+ >>D [startadr] [endadr]
+ Display memory in hex and ASCII
+ Auslisten des Speichers in HEX und ASCII
+
+ > Fkommandozeile
+ specifiy filename and command line
+ File-Controlblock und CP/M-Kommandozeile spezifizieren
+
+ > G [startadr] [;breakp..]
+ Go [to start] [with temporary breakpoints]
+ Starte ein geladenes Programm, eventuell mit temporaeren
+ Breakpoints
+
+ > H
+ display High and maximal size of files
+ Groesse und maximale Groesse von Files anzeigen
+ > H ausdruck
+ compute hex and other expressions
+ Berechnen eines Ausdrucks
+ > H ausdruck ausdruck
+ Hex and other sum and difference
+ Summe und Differenz zweier Ausdruecke
+
+ >>I [port]
+ Input a byte from port
+ Einlesen eines Daten-Bytes von einem Port
+
+ >>L [startadr] [endadr]
+ List disassembled code
+ Listen eines Speicherbereichs in Z80-Mnemonics
+
+ > M[V] startadr endadr zieladr
+ Move memory [and verify]
+ Umladen eines Speicherbereiches in einen anderen, evtl.
+ Vergleichen
+
+ >>O [byte] [port]
+ Output a byte to a port
+ Ausgeben eines Datenbytes an einen Ausgabeport
+
+ > Q[J] startadr endadr bytes
+ Query memory for a byte string [Justified]
+ Durchsuchen des Speichers nach einer gegebenen Folge von
+ Bytes
+
+ > R [displacement]
+ Read a binary or hex file ]add displacement]
+ Einlesen einer Binaer- oder HEX-File in den Speicher,
+ evtl. verschoben
+
+ > S [startadr]
+ Substitute Memory
+ Anzeigen und Aendern von Daten im Speicher
+
+ >>T[N][J] [befehlsanzahl]
+ >>T[N][J] W ausdruck
+ >>T[N][J] U ausdruck
+ Trace [no List] [Jumps only] / .While. / .Until.
+ Tracen [ohne Ausgabe] [nur Sprungbefehle] /.solange./.bis.
+
+ > Vstartadr endadr zieladr
+ Verify (compare) two memory areas
+ Vergleichen zweier Speicherbereiche
+
+ > Wstartadr endadr
+ Write a file to disk
+ Ausschreiben eines Speicherbereichs in eine File
+
+ > X
+ eXamine all cpu registers
+ Anzeigen aller Register und des Befehls, auf den der Pro-
+ grammzaehler zeigt
+ > X register
+ eXamine [and substitute] a register
+ Anzeigen und eventuell Modifizieren eines Registers
+
+ > Y
+ examine all Y variables
+ Anzeigen aller Y-Variablen
+ > Yziffer0bis9
+ examine [and substitute] an Y variable
+ Anzeigen und eventuell Modifizieren einer Y-Variablen
+
+ > Z startadr endadr bytes
+ Zap (fill) memory with a byte string
+ Vorbesetzen eines Speicherbereiches mit einer Byte-Folge
+
+
+ Registernamen
+ -------------
+
+ A , F , B , C , D , E , H , L ,BC , DE , HL
+ A', F', B', C', D', E', H', L',BC', DE', HL'
+ IX oder X , IY oder Y , Sp oder S , PC oder P , I
+
+ Flags des F- und des F'-Registers:
+
+ S Sign Vorzeichen
+ Z Zero Null
+ H Half carry Uebertrag von Bit 3 nach Bit 4
+ V oVerflow/parity Ueberlauf/ gerade Paritaet
+ N Negation NEG, DEC, SUB o.ae. wurde ausgefuehrt
+ C Carry Uebertrag von Bit 7
+ E Interrupt Enabled Das Interrupt-Flag wird im DDTZ wie
+ ein Flag des F-Registers behandelt.
+
+ Variablen und Konstanten
+ ------------------------
+
+ L Low Benutzerspeicher-Anfang. Festwert 100H
+ H High Hoechste Adresse der letzten gelesenen
+ File
+ M Max Maximale Adresse aller gelesenen Files
+ T Top Oberes Ende des Benutzerspeichers
+ @ Displacement Register
+ $ beim Assemblieren Anfangsadresse des
+ Befehls sonst = PC
+ Y0..Y9 Frei verwendbare Variablen
+ ^register Inhalt eines Registers
+ (adresse) Inhalt eines Speicherplatzes (Byte)
+ (adresse). Inhalt eines Speicherplatzes (Wort)
+
+ Ausdruecke
+ ----------
+
+ In allen Situationen, in denen Zahlen eingegeben werden koen-
+ nen, ist auch die Eingabe von Ausdruecken erlaubt.
+
+ Ausdruecke sind im allgemeinen arithmetische Ausdruecke, koen-
+ nen aber auch (zum Formulieren von Bedingungen) Relationen
+ sein. Relationen bestehen aus zwei arithmetischen Ausdruecken,
+ zwischen denen einer der folgenden Relationsoperatoren steht:
+ = <> > >= <= <
+
+ Relationen haben den Wert -1 (=0FFFFH), wenn die Relation wahr
+ ist, 0 sonst.
+ z.B. der Ausdruck 1+2=3 hat den Wert -1, und 'A'>'B' den Wert 0
+
+ Ein arithmetischer Ausdruck hat die folgende Form
+
+ faktor arithmetikoperator faktor arith... faktor
+
+ Die Arithmetikoperatoren sind
+ + - * / % Addition, Subtraktion, Mult., Division, Modulo
+ & ! # bitweise AND, OR, XOR
+
+ Ein Faktor hat die Form
+ [ausdruck] geklammerter Ausdruck
+ +faktor
+ -faktor Negation
+ ~faktor bitweise NOT (1er-Komplement)
+ 'a' Wert eines ASCII-Zeichens (a=druckbares Zeichen)
+ 'a'. " mit gesetzem Bit 7
+ 'ab' Wert zweier ASCII-Zeichen (a,b=druckbare Zeichen)
+ 'ab'. " das niederwertige Zeichen mit gesetztem Bit 7
+ (ausdruck) ein Byte im Speicher
+ (ausdruck). ein Wort im Speicher
+ hhhh[H] Hex-Zahl (h=0..9,A..F oder a..f)
+ ddddd. Dezimal-Zahl (d=0..9)
+ bbbbbbbb"bbbbbbbb" Binaer-Zahl (beliebig mit '"' unterteilt (b=0,1)
+
+ Enthaelt ein Ausdruck einen Relationsoperator, so werden erst
+ die beiden arithmetischen Ausdruecke berechnet und dann die
+ Relation.
+ Ein arithmetischer Ausdruck wird von links nach rechts be-
+ rechnet, also ohne Beachtung "Punktrechnung vor Strichrech-
+ nung", die Reihenfolge kann jedoch mit Klammern '[' und ']'
+ geaendert werden.
+ Ein Pluszeichen darf, wenn dabei der Ausdruck eindeutig bleibt,
+ weggelassen werden; z.B. ist @1000 dasselbe wie @+1000.
+ Ausdruecke duerfen keine Leerzeichen enthalten!
+
+