- ld a,0edh\r
- jr l139bh\r
-l13d0h:\r
- ld b,022h\r
- jr as.store_3\r
-l13d4h:\r
- ld b,a\r
- call assert_comma\r
- call arg.r_HL_A\r
- jr nc,l13f0h\r
- push af\r
- ld a,b\r
- rlca\r
- rlca\r
- rlca\r
- ld b,a\r
- pop af\r
- add a,b\r
- add a,040h\r
- cp 076h\r
- jp z,ERROR\r
-l13ech:\r
- ld b,a\r
- jp as.opc.noarg\r
-l13f0h:\r
- call arg.IDX_displcmnt\r
- jr nc,l1413h\r
- ld a,b\r
- rlca\r
- rlca\r
- rlca\r
- add a,046h\r
- cp 076h\r
- jp z,ERROR\r
-\r
-l1400h:\r
- ld b,a\r
- call assert_eol\r
- ld (iy+001h),b\r
- ld (iy+002h),c\r
- ld a,(prefix_ixiy)\r
- ld (iy+000h),a\r
- ld c,003h\r
- ret\r
-l1413h:\r
- ld a,(de)\r
- cp 'I'\r
- jr z,l1426h\r
- cp 'R'\r
- jr nz,l1432h\r
- ld a,b\r
- cp 007h\r
- jp nz,ERROR\r
- ld b,05fh\r
- jr l142eh\r
-l1426h:\r
- ld a,b\r
- cp 007h\r
- jp nz,ERROR\r
- ld b,057h\r
-l142eh:\r
- inc de\r
- jp gen.opc.ED2\r
-l1432h:\r
- cp '('\r
- jr z,l144ch\r
- call arg.imm_8bit\r
- ld a,b\r
- rlca\r
- rlca\r
- rlca\r
- add a,006h\r
-l143fh:\r
- ld b,a\r
-as.store_2:\r
- call assert_eol\r
- ld (iy+000h),b\r
- ld (iy+001h),l\r
- ld c,002h\r
- ret\r
-l144ch:\r
- inc de\r
- ld a,b\r
- cp 007h\r
- jp nz,ERROR\r
- call arg.ww\r
- jr nc,l1466h\r
- cp 030h\r
- jp nc,ERROR\r
- add a,00ah\r
- ld b,a\r
- call test_paren_close\r
- jp as.opc.noarg\r
-l1466h:\r
- call test_expr\r
- call test_paren_close\r
- ld b,03ah\r
- jp as.store_3\r
-\r
-l1471h:\r
- call assert_comma\r
- call arg.r_HL_A\r
- jr nc,l1483h\r
- cp 006h\r
- jp z,ERROR\r
- add a,070h\r
- jp l1400h\r
-\r
-l1483h:\r
- call arg.imm_8bit\r
- call assert_eol\r
- ld a,(prefix_ixiy)\r
- ld (iy+000h),a\r
- ld (iy+001h),036h\r
- ld (iy+002h),c\r
- ld (iy+003h),l\r
- ld c,004h\r
- ret\r
-l149ch:\r
- ld b,a\r
- call assert_comma\r
- ld hl,t_HL.AF\r
- call sub_0318h\r
- jr c,l14c3h\r
- call arg.IX_IY\r
- jr nc,l14cch\r
- ld a,b\r
- cp 030h\r
- jr nz,error6\r
- ld b,0f9h\r
-l14b4h:\r
- call assert_eol\r
- ld a,(prefix_ixiy)\r
- ld (iy+000h),a\r
- ld (iy+001h),b\r
- ld c,002h\r
- ret\r
-l14c3h:\r
- ld a,b\r
- cp 030h\r
- jr nz,error6\r
- ld b,0f9h\r
- jr as.opc.noarg ;14ca\r
-l14cch:\r
- ld a,(de)\r
- cp '('\r
- jr nz,l14e8h\r
- inc de\r
- call test_expr\r
- call test_paren_close\r
- ld a,b\r
- cp 020h\r
- jr z,l14e3h\r
- add a,04bh\r
- ld b,a\r
- jp l13c9h\r
-l14e3h:\r
- ld b,02ah\r
- jp as.store_3\r
-l14e8h:\r
- call test_expr\r
- call assert_eol\r
- ld a,001h\r
- add a,b\r
- ld b,a\r
- jp as.store_3\r
-l14f5h:\r
- call assert_comma\r
- ld a,(de)\r
- cp '('\r
- jr nz,l1509h\r
- inc de\r
- call test_expr\r
- call test_paren_close\r
- ld b,02ah\r
- jp l1395h\r
-l1509h:\r
- call test_expr\r
- ld b,021h\r
- jp l1395h\r
-l1511h:\r
- inc de\r
- call assert_comma\r
- ld b,047h\r
- jr l151fh\r
-l1519h:\r
- inc de\r
- call assert_comma\r
- ld b,04fh\r
-l151fh:\r
- ld a,(de)\r
- inc de\r
- cp 'A'\r
- jr z,gen.opc.ED2\r
-error6:\r
- jp ERROR\r
-\r
-l1528h:\r
- cp 020h\r
- jr nc,error6\r
- add a,002h\r
- ld b,a\r
- call test_paren_close\r
- call assert_comma\r
- ld a,(de)\r
- cp 'A'\r
- jr nz,error6\r
- inc de\r
-as.opc.noarg:\r
- call assert_eol\r
- ld (iy+000h),b\r
- ld c,001h\r
- ret\r
-\r
-gen.opc.ED2:\r
- call assert_eol\r
- ld (iy+000h),0edh\r
- ld (iy+001h),b\r
- ld c,002h\r
- ret\r
-\r
-as.ADC_SBC:\r
- ld hl,t_HL.AF\r
- call sub_0318h\r
- jr nc,as.AND_CP_OR_SUB_XOR\r
- call assert_comma\r
- call arg.ww\r
- jp nc,ERROR\r
- push af\r
- ld a,b\r
- cp 088h\r
- ld b,04ah\r
- jr z,l156ch\r
- ld b,042h\r
-l156ch:\r
- pop af\r
- add a,b\r
-l156eh:\r
- ld b,a\r
- jr gen.opc.ED2\r
-as.ADD:\r
- ld hl,t_HL.AF\r
- call sub_0318h\r
- jr c,l159ah\r
- call arg.IX_IY\r
- jr nc,as.AND_CP_OR_SUB_XOR\r
- call assert_comma\r
- ld hl,t_BC.DE.IX.SP\r
- ld a,(prefix_ixiy)\r
- cp 0fdh\r
- jr nz,l158eh\r
- ld hl,t_BC.DE.IY.SP\r
-l158eh:\r
- call arg.reg_16bit\r
- jp nc,ERROR\r
- add a,009h\r
-l1596h:\r
- ld b,a\r
- jp l14b4h\r
-l159ah:\r
- call assert_comma\r
- call arg.ww\r
- jp nc,ERROR\r
- add a,009h\r
- jp l13ech\r
-as.AND_CP_OR_SUB_XOR:\r
- ld a,(de)\r
- cp 'A'\r
- jr nz,l15b8h\r
- push de\r
- inc de\r
- call next_arg\r
- jr z,l15b7h\r
- pop de\r
- jr l15b8h\r
-l15b7h:\r
- pop af\r
-l15b8h:\r
- call arg.r_HL_A\r
- jr c,l15cbh\r
- call arg.IDX_displcmnt\r
- jr c,l15cfh\r
- call arg.imm_8bit\r
- ld a,b\r
- add a,046h\r
- jp l143fh\r
-l15cbh:\r
- add a,b\r
- jp l13ech\r
-l15cfh:\r
- ld a,b\r
- add a,006h\r
- jp l1400h\r
-\r
-as.SHIFTOP:\r
- call arg.r_HL_A\r
- jr c,l15fah\r
- call arg.IDX_displcmnt\r
- jp nc,ERROR\r
- ld a,b\r
- add a,006h\r
- ld b,a\r
-l15e4h:\r
- call assert_eol\r
- ld a,(prefix_ixiy)\r
- ld (iy+000h),a\r
- ld (iy+001h),0cbh\r
- ld (iy+002h),c\r
- ld (iy+003h),b\r
- ld c,004h\r
- ret\r
-\r
-l15fah:\r
- add a,b\r
-l15fbh:\r
- ld b,a\r
- call assert_eol\r
- ld (iy+001h),b\r
- ld (iy+000h),0cbh\r
- ld c,002h\r
- ret\r
-\r
-as.BITOP:\r
- call arg.bit\r
- call assert_comma\r
- call arg.r_HL_A\r
- jr c,l1624h\r
- call arg.IDX_displcmnt\r
- jp nc,ERROR\r
- ld a,l\r
- rlca\r
- rlca\r
- rlca\r
- add a,006h\r
- add a,b\r
- ld b,a\r
- jr l15e4h\r
-l1624h:\r
- add a,b\r
- ld b,a\r
- ld a,l\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- jr l15fbh\r
-\r
-as.CALL:\r
- push de\r
- call arg.cc_ZCPS\r
- jr nc,l163ch\r
- add a,b\r
- ld b,a\r
- call next_arg\r
- jr z,l163eh\r
- pop de\r
- push de\r
-l163ch:\r
- ld b,0cdh\r
-l163eh:\r
- pop af\r
- call test_expr\r
- jp as.store_3\r
-\r
-as.RET:\r
- call arg.cc_ZCPS\r
- jr nc,l164eh\r
- add a,b\r
- ld b,a\r
- jr l1650h\r
-l164eh:\r
- ld b,0c9h\r
-l1650h:\r
- jp as.opc.noarg\r
-\r
-as.JP:\r
- push de\r
- call arg.cc_ZCPS\r
- jr c,l1666h\r
-l1659h:\r
- pop de\r
- ld hl,l168ch\r
- call sub_030ah\r
- jr c,l1674h\r
- ld b,0c3h\r
- jr l166eh\r
-\r
-l1666h:\r
- add a,b\r
- ld b,a\r
- call next_arg\r
- jr nz,l1659h\r
- pop af\r
-l166eh:\r
- call test_expr\r
- jp as.store_3\r
-l1674h:\r
- call assert_eol\r
- ld a,b\r
- and a\r
- jr nz,l1680h\r
- ld b,0e9h\r
- jp as.opc.noarg\r
-l1680h:\r
- ld b,0ddh\r
- dec a\r
- jr z,l1687h\r
- ld b,0fdh\r
-l1687h:\r
- ld l,0e9h\r
- jp as.store_2\r
-\r
-l168ch:\r
- DC '(HL)'\r
- DC '(IX)'\r
- DC '(IY)'\r
- DB 0\r
-\r
-as.DJNZ:\r
- call next_arg\r
- ld b,010h\r
- jr l16aeh\r
-as.JR:\r
- call arg.cc_ZC\r
- jr c,l16a9h\r
- ld b,018h\r
- jr l16aeh\r
-l16a9h:\r
- add a,b\r
- ld b,a\r
- call assert_comma\r
-l16aeh:\r
- call arg.j_displ\r
- jp as.store_2\r
-\r
-as.IM:\r
- call arg.imm_8bit\r
- ld a,l\r
- cp 003h\r
- jr nc,error2\r
- and a\r
- jr z,l16c7h\r
- ld b,056h\r
- cp 001h\r
- jr z,l16c7h\r
- ld b,05eh\r
-l16c7h:\r
- jp gen.opc.ED2\r
-\r
-as.RST:\r
- call arg.imm_8bit\r
- ld a,l\r
- push af\r
- add a,b\r
- ld b,a\r
- pop af\r
- and 0c7h\r
- jr nz,error2\r
- jp as.opc.noarg\r
-\r
-as.POP_PUSH:\r
- call arg.IX_IY\r
- jr c,l16e7h\r
- call arg.zz\r
- jr nc,error2\r
- add a,b\r
- jp l13ech\r
-l16e7h:\r
- ld a,b\r
- add a,020h\r
- jp l1596h\r
-\r
-as.IN:\r
- call arg.r_HL_A\r
- jr nc,error2\r
- cp 006h\r
- jr z,error2\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- ld b,a\r
- cp 078h\r
- jr nz,l170fh\r
- call assert_comma\r
- call sub_171bh\r
- jr c,l1715h\r
- call arg.addr_8bit\r
- ld b,0dbh\r
- jp as.store_2\r
-l170fh:\r
- call assert_comma\r
- call sub_171bh\r
-l1715h:\r
- jp c,gen.opc.ED2\r
-error2:\r
- jp ERROR\r
-\r
-sub_171bh:\r
- ld hl,t__C_\r
- jp sub_0318h\r
-\r
-as.OUT:\r
- call sub_171bh\r
- jr nc,l1739h\r
- call assert_comma\r
- call arg.r_HL_A\r
- jr nc,error2\r
- cp 006h\r
- jr z,error2\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- jp l156eh\r
-\r
-l1739h:\r
- call arg.addr_8bit\r
- call assert_comma\r
- cp 'A'\r
- jr nz,error2\r
- inc de\r
- ld b,0d3h\r
- jp as.store_2\r
-\r
-as.EX:\r
- ld hl,b_176d_start\r
- call sub_030ah\r
- jp nc,ERROR\r
- ld c,b\r
- call assert_eol\r
- ld b,000h\r
- ld hl,l178eh\r
- add hl,bc\r
- add hl,bc\r
- ld a,(hl)\r
- ld (iy+000h),a\r
- ld c,001h\r
- inc hl\r
- ld a,(hl)\r
- and a\r
- ret z\r
- ld (iy+001h),a\r
- ld c,002h\r
- ret\r
-\r
-b_176d_start:\r
- DC 'AF,AF'''\r
-l1773h:\r
- DC 'DE,HL'\r
- DC '(SP),HL'\r
- DC '(SP),IX'\r
- DC '(SP),IY'\r
- db 0\r
-l178eh:\r
- db 008h,000h\r
- db 0ebh,000h\r
- db 0e3h,000h\r
- db 0ddh,0e3h\r
- db 0fdh,0e3h\r
-\r
-as.DEC_INC:\r
- call arg.IX_IY\r
- jr c,l17b3h\r
- call arg.ww\r
- jr c,l17bfh\r
- call arg.r_HL_A\r
- jr c,l17cch\r
- call arg.IDX_displcmnt\r
- jp nc,ERROR\r
- ld a,b\r
- add a,030h\r
- jp l1400h\r
-l17b3h:\r
- ld a,b\r
- ld b,023h\r
- cp 004h\r
- jr z,l17bch\r
- ld b,02bh\r
-l17bch:\r
- jp l14b4h\r
-l17bfh:\r
- push af\r
- ld a,b\r
- ld b,003h\r
- cp 004h\r
- jr z,l17c9h\r
- ld b,00bh\r
-l17c9h:\r
- pop af\r
- jr l17cfh\r
-l17cch:\r
- rlca\r
- rlca\r
- rlca\r
-l17cfh:\r
- add a,b\r
- jp l13ech\r
-\r
-arg.bit:\r
- call arg.imm_8bit\r
- ld a,l\r
- cp 008h\r
- jr nc,error3\r
- ret\r
-\r
-arg.j_displ:\r
- call test_expr\r
- push bc\r
- push iy\r
- pop bc\r
- and a\r
- sbc hl,bc\r
- dec hl\r
- dec hl\r
- pop bc\r
- call sub_1802h\r
- ld a,h\r
- xor l\r
- bit 7,a\r
- jr nz,error3\r
- ret\r
-\r
-arg.addr_8bit:\r
- ld a,(de)\r
- cp '('\r
- jr nz,arg.imm_8bit\r
- inc de\r
- call arg.imm_8bit\r
- jp test_paren_close\r
-\r
-arg.imm_8bit:\r
- call test_expr\r
-sub_1802h:\r
- ld a,h\r
- and a\r
- ret z\r
- inc a\r
- ret z\r
- jr error3\r
-\r
-test_expr:\r
- push bc\r
- call expr\r
- pop bc\r
- ret nc\r
-error3:\r
- jp ERROR\r
-\r
-arg.zz:\r
- push hl\r
- ld hl,t_BC.DE.HL.AF\r
- jr l181fh\r
-\r
-arg.reg_16bit:\r
- push hl\r
- jr l181fh\r
-\r
-arg.ww:\r
- push hl\r
- ld hl,t_BC.DE.HL.SP\r
-l181fh:\r
- push bc\r
- call sub_030ah\r
- jr nc,l182bh\r
- ld a,b\r
- rlca\r
- rlca\r
- rlca\r
- rlca\r
- scf\r
-l182bh:\r
- pop bc\r
- pop hl\r
- ret\r
-\r
-arg.r_HL_A:\r
- call skipbl\r
- push bc\r
- push hl\r
- ld hl,t_BCDEHL_HL_A\r
- call sub_030ah\r
- ld a,b\r
- pop hl\r
- pop bc\r
- ret\r
-\r
-arg.IX_IY:\r
- push hl\r
- push bc\r
- ld hl,t_IX.IY\r
- call sub_030ah\r
- jr nc,l1852h\r
- ld a,0ddh\r
- dec b\r
- jr nz,l184eh\r
- ld a,0fdh\r
-l184eh:\r
- ld (prefix_ixiy),a\r
- scf\r
-l1852h:\r
- pop bc\r
- pop hl\r
- ret\r
-\r
-arg.IDX_displcmnt:\r
- push hl\r
- push bc\r
- ld a,(de)\r
- cp '('\r
- jr nz,l18a1h\r
- push de\r
- inc de\r
- ld hl,t_IX.IY\r
- call sub_030ah\r
- jr nc,l18a0h\r
- pop af\r
- ld a,0ddh\r
- dec b\r
- jr nz,l186eh\r
- ld a,0fdh\r
-l186eh:\r
- ld (prefix_ixiy),a\r
- ld a,(de)\r
- cp '+'\r
- jr z,l1882h\r
- cp ')'\r
- ld hl,0\r
- jr z,l189ah\r
- cp '-'\r
- jp nz,ERROR\r
-l1882h:\r
- push af\r
- inc de\r
- call arg.imm_8bit\r
- pop af\r
- cp '+'\r
- jr z,l1894h\r
- ld b,h\r
- ld c,l\r
- ld hl,0\r
- and a\r
- sbc hl,bc\r
-l1894h:\r
- ld a,(de)\r
- cp ')'\r
- jp nz,ERROR\r
-l189ah:\r
- inc de\r
- pop bc\r
- ld c,l\r
- pop hl\r
- scf\r
- ret\r
-l18a0h:\r
- pop de\r
-l18a1h:\r
- pop bc\r
- pop hl\r
- and a\r
- ret\r
-\r
-arg.cc_ZCPS:\r
- ld hl,t_tstfl_ZCPS\r
- ld c,007h\r
- jr l18b1h\r
-\r
-arg.cc_ZC:\r
- ld hl,t_tstfl_ZC\r
- ld c,003h\r
-l18b1h:\r
- push bc\r
- call sub_030ah\r
- ld a,b\r
- pop bc\r
- ret nc\r
- and c\r
- rlca\r
- rlca\r
- rlca\r
- scf\r
- ret\r
-\r
-assert_comma:\r
- call next_arg\r
- ret z\r
-l18c2h:\r
- jp ERROR\r
-\r
-test_paren_close:\r
- ld a,(de)\r
- cp ')'\r
- jr nz,l18c2h\r
- inc de\r
- ret\r
-\r
-cmd_L:\r
- ld hl,cmd_L\r
- ld (cmd_rpt),hl\r
- call expr\r
- jr nc,l18dbh\r
- ld hl,(last_L)\r
-l18dbh:\r
- push hl\r
- pop iy\r
- call next_arg\r
- call get_range\r
- jr nc,l1905h\r
- call assert_eol\r
- ld b,16\r
-l18ebh:\r
- push bc\r
- push iy\r
- pop hl\r
- push hl\r
- call p_disas_line\r
- call crlf\r
- pop iy\r
- ld c,b\r
- ld b,0\r
- add iy,bc\r
- ld (last_L),iy\r
- pop bc\r
- djnz l18ebh\r
- ret\r
-l1905h:\r
- call assert_eol\r
- ld h,b\r
- ld l,c\r
- ld a,b\r
- or c\r
- jr nz,l190fh\r
- dec hl\r