- and a\r
- jr z,rdhex_done\r
- call read_hexchar ; RECTYP\r
-l10cch:\r
- call read_hexchar ; DATA\r
- pop de\r
- push de\r
- push hl\r
- add hl,de\r
- call cmdR_storebyte\r
- pop hl\r
- inc hl\r
- djnz l10cch\r
- call read_hexchar ; CHKSUM\r
- ld a,c\r
- and a\r
- jr nz,error3\r
- jr l10aeh\r
-rdhex_done:\r
- pop hl\r
- jr read_symfile\r
-\r
-read_symfile:\r
- ld de,fcbsym+1\r
- ld a,(de)\r
- cp ' '\r
- jp z,p_max_high\r
-\r
- push hl ; offset\r
- call pstr_inl\r
- db 'SYMBOLS',CR,LF+80h\r
-\r
- dec de\r
- call file_open\r
- ld a,(symattrib)\r
- ld c,a\r
-rs_1:\r
- call read_byte\r
-rs_2:\r
- pop de ; offset\r
- cp 1ah\r
- jp z,p_max_high\r
- push de ; offset\r
- cp '!'\r
- jr c,rs_1\r
- call read_hexbyte0 ; symval H\r
- ld h,a\r
- call read_hexbyte ; symval L\r
- ld l,a\r
- add hl,de\r
- call read_byte\r
- cp ' '\r
- jr z,rs_4\r
-rs_3: call read_byte\r
- cp ' '\r
- jr nc,rs_3\r
- jr rs_2\r
-\r
-rs_4:\r
- push hl ; symval\r
- ld hl,(BDOS+1) ;\r
- ld b,0 ; setup symlen\r
-rs_5:\r
- dec hl ;\r
- call read_byte ; next char of symbol name\r
- call test_sym_char ; valid char?\r
- jr nz,rs_6\r
- bit SYMCASE_CONV,c\r
- jr z,rs_51\r
- call toupper\r
- bit SYMCASE_LOWER,c\r
- call nz,tolower\r
-rs_51:\r
- ld (hl),a ;\r
- inc b ; symlen++\r
- ld a,(symlen_max) ;\r
- cp b ;\r
- jr nc,rs_5 ;\r
-error3:\r
- jp ERROR ;\r
-\r
-rs_6:\r
- call test_symterm_ch\r
- jr nz,error3\r
-\r
- push bc ; symlen\r
- ex de,hl ;\r
- ld hl,(BDOS+1) ;\r
- inc hl ;\r
- ld c,(hl) ;\r
- inc hl ;\r
- ld b,(hl) ;\r
- ex de,hl\r
- ld (hl),b ;\r
- dec hl ;\r
- ld (hl),c ;\r
- dec hl ;\r
- ld (hl),0c3h ;\r
-\r
- ld de,(max_load) ;\r
- call cp_hl_de ;\r
- jr c,error3 ;\r
- ld de,(reg_sp) ;\r
- call cp_hl_de ;\r
- jr nc,rs_61 ;\r
- ld (reg_sp),hl ;\r
-rs_61:\r
- ld de,(BDOS+1) ;\r
- ld (BDOS+1),hl ;\r
- ex de,hl ;\r
- pop bc ; symlen\r
- ld (hl),b ;\r
- inc hl ;\r
- pop de ; symval\r
- ld (hl),e ;\r
- inc hl ;\r
- ld (hl),d ;\r
- ld a,b ;\r
- ld hl,symlen_cur ;\r
- cp (hl) ; new max?\r
- jr c,$+3 ;\r
- ld (hl),a ;\r
- jp rs_1 ;\r
-\r
-\r
-; test for valid character for symbols\r
-; return z if valid\r
-\r
-test_sym_char:\r
- cp '$'\r
- ret z\r
- cp '%'\r
- ret z\r
- cp '.'\r
- ret z\r
- cp '_'\r
- ret z\r
- call test_alphanum\r
- ret c ; cy == 1 --> z == 0\r
- cp a ; return z\r
- ret\r
-\r
-\r
-; check if char is in [0..9,?,@,A..Z,a..z]\r
-; return cy if invalid\r
-; return nc if valid alfanumeric char\r
-\r
-test_alphanum:\r
- cp 'z'\r
- ret z\r
- ccf\r
- ret c\r
- cp 'a'\r
- ret nc\r
- cp 'Z'\r
- ret z\r
- ccf\r
- ret c\r
- cp '?'\r
- ret nc\r
-test_numeral:\r
- cp '9'\r
- ret z\r
- ccf\r
- ret c\r
- cp '0'\r
- ret\r
-\r
-test_symterm_ch:\r
- cp CR\r
- ret z\r
- cp LF\r
- ret z\r
-test_whitespace:\r
- cp ' '\r
- ret z\r
- cp TAB\r
- ret\r
-\r
-;-------------------------------------------------------------------------------\r
-\r
-p_max_high0:\r
- call assert_eol\r
-p_max_high:\r
- call pstr_inl\r
- DC 'High = '\r
- ld hl,(high_load)\r
- call out_hl\r
- call pstr_inl\r
- DC ' Max = '\r
- ld hl,(max_load)\r
- call out_hl\r
- call pstr_inl\r
- DC ' Top = '\r
- ld hl,(BDOS+1)\r
- call out_hl\r
- jp crlf\r
-\r
-;-------------------------------------------------------------------------------\r
-; > Wstartaddr endaddr\r
-; Write a file to disk\r
-\r
-cmd_W:\r
- call get_arg_range\r
- call assert_eol\r
- push hl\r
- ld a,c\r
- add a,07fh\r
- jr nc,l11adh\r
- inc b\r
-l11adh:\r
- and 080h\r
- ld c,a\r
- push bc\r
- ld a,(dfcb1+1)\r
- cp ' '\r
- jr z,error4\r
- ld de,dfcb1\r
- call setup_fcb\r
- push de\r
- ld c,BDOS_DELETE\r
- call ddtz_bdos\r
- pop de\r
- ld c,BDOS_CREATE\r
- call ddtz_bdos\r
- inc a\r
- jr z,error4\r
- pop bc\r
- pop hl\r
-l11cch:\r
- ld a,b\r
- or c\r
- jr z,close_file\r
- push bc\r
- ld de,080h ; DMA_BUF\r
- ld b,d\r
- ld c,e\r
- ldir\r
- call write_sector\r
- ex (sp),hl\r
- ld bc,0ff80h\r
- add hl,bc\r
- ex (sp),hl\r
- pop bc\r
- jr l11cch\r
-\r
-write_sector:\r
- push hl\r
- ld de,dfcb1\r
- ld c,BDOS_WRITE\r
- call ddtz_bdos\r
- pop hl\r
- and a\r
- ret z\r
- call close_file\r
-error4:\r
- jp ERROR\r
-\r
-close_file:\r
- ld de,dfcb1\r
- ld c,BDOS_CLOSE\r
- jp ddtz_bdos\r
-\r
-;-------------------------------------------------------------------------------\r
-; > A [startaddr]\r
-; Assemble Zilog Z180 mnemonics\r
-\r
-cmd_A:\r
- ld hl,(last_A)\r
- call get_lastarg_def\r
- ld (last_A),hl\r
- ld (cmd_A_prev),hl\r
- ld hl,cmda_restart\r
- ld (error_func),hl\r
- ld (l1262h),sp\r
-cmda_loop:\r
- ld hl,(last_A)\r
- ld (var.$),hl\r
- push hl\r
- call p_disas_line\r
- ld c,19\r
- call p_align_@_sym\r
- ld c,b\r
- push bc\r
- call get_line\r
- pop bc\r
- pop hl\r
- call skipbl\r
- cp '.'\r
- ret z\r
- cp '-'\r
- jr nz,l124bh\r
- ld hl,(cmd_A_prev)\r
- jr cmda_lpend\r
-l124bh:\r
- push hl\r
- pop iy\r
- push hl\r
- and a\r
- call nz,asemble_line\r
- ld b,0\r
- pop hl\r
- ld (cmd_A_prev),hl\r
- add hl,bc\r
-cmda_lpend:\r
- ld (last_A),hl\r
- jr cmda_loop\r
-\r
-cmda_restart:\r
- call p_msg_error\r
- ld sp,(l1262h)\r
- jr cmda_loop\r
-\r
-asemble_line:\r
- call skipbl\r
- ld hl,t_MNEMONICS\r
- call sub_030ah\r
- jr nc,error4\r
- call skipbl\r
- push de\r
- ld a,b\r
- add a,b\r
- add a,b\r
- ld hl,b_1289_start\r
- call add_hl_a\r
- ld e,(hl)\r
- inc hl\r
- ld d,(hl)\r
- inc hl\r
- ld b,(hl)\r
- ex de,hl\r
- pop de\r
-\r
-CALL_HL:\r
- jp (hl)\r
-\r
-;-------------------------------------------------------------------------------\r
-\r
-b_1289_start:\r
- dw as.ADC_SBC ;ADC\r
- db 088h ;\r
- dw as.ADD ;ADD\r
- db 080h ;\r
- dw as.AND_CP_OR_SUB_XOR ;AND\r
- db 0a0h ;\r
- dw as.BITOP ;BIT\r
- db 040h ;\r
- dw as.CALL ;CALL\r
- db 0c4h ;\r
- dw as.opc.noarg ;CCF\r
- db 03fh ;\r
- dw as.AND_CP_OR_SUB_XOR ;CP\r
- db 0b8h ;\r
- dw gen.opc.ED2 ;CPD\r
- db 0a9h ;\r
- dw gen.opc.ED2 ;CPDR\r
- db 0b9h ;\r
- dw gen.opc.ED2 ;CPI\r
- db 0a1h ;\r
- dw gen.opc.ED2 ;CPIR\r
- db 0b1h ;\r
- dw as.opc.noarg ;CPL\r
- db 02fh ;\r
- dw as.opc.noarg ;DAA\r
- db 027h ;\r
- dw as.DEC_INC ;DEC\r
- db 005h ;\r
- dw as.opc.noarg ;DI\r
- db 0f3h ;\r
- dw as.DJNZ ;DJNZ\r
- db 010h ;\r
- dw as.opc.noarg ;EI\r
- db 0fbh ;\r
- dw as.EX ;EX\r
- db 0e3h ;\r
- dw as.opc.noarg ;EXX\r
- db 0d9h ;\r
- dw as.opc.noarg ;HALT\r
- db 076h ;\r
- dw as.IM ;IM\r
- db 046h ;\r
- dw as.IN ;IN\r
- db 040h ;\r
- dw as.DEC_INC ;INC\r
- db 004h ;\r
- dw gen.opc.ED2 ;IND\r
- db 0aah ;\r
- dw gen.opc.ED2 ;INDR\r
- db 0bah ;\r
- dw gen.opc.ED2 ;INI\r
- db 0a2h ;\r
- dw gen.opc.ED2 ;INIR\r
- db 0b2h ;\r
- dw as.JP ;JP\r
- db 0c2h ;\r
- dw as.JR ;JR\r
- db 020h ;\r
- dw as.LD ;LD\r
- db 040h ;\r
- dw gen.opc.ED2 ;LDD\r
- db 0a8h ;\r
- dw gen.opc.ED2 ;LDDR\r
- db 0b8h ;\r
- dw gen.opc.ED2 ;LDI\r
- db 0a0h ;\r
- dw gen.opc.ED2 ;LDIR\r
- db 0b0h ;\r
- dw gen.opc.ED2 ;NEG\r
- db 044h ;\r
- dw as.opc.noarg ;NOP\r
- db 000h ;\r
- dw as.AND_CP_OR_SUB_XOR ;OR\r
- db 0b0h ;\r
- dw gen.opc.ED2 ;OTDR\r
- db 0bbh ;\r
- dw gen.opc.ED2 ;OTIR\r
- db 0b3h ;\r
- dw as.OUT ;OUT\r
- db 041h ;\r
- dw gen.opc.ED2 ;OUTD\r
- db 0abh ;\r
- dw gen.opc.ED2 ;OUTI\r
- db 0a3h ;\r
- dw as.POP_PUSH ;POP\r
- db 0c1h ;\r
- dw as.POP_PUSH ;PUSH\r
- db 0c5h ;\r
- dw as.BITOP ;RES\r
- db 080h ;\r
- dw as.RET ;RET\r
- db 0c0h ;\r
- dw gen.opc.ED2 ;RETI\r
- db 04dh ;\r
- dw gen.opc.ED2 ;RETN\r
- db 045h ;\r
- dw as.SHIFTOP ;RL\r
- db 010h ;\r
- dw as.opc.noarg ;RLA\r
- db 017h ;\r
- dw as.SHIFTOP ;RLC\r
- db 000h ;\r
- dw as.opc.noarg ;RLCA\r
- db 007h ;\r
- dw gen.opc.ED2 ;RLD\r
- db 06fh ;\r
- dw as.SHIFTOP ;RR\r
- db 018h ;\r
- dw as.opc.noarg ;RRA\r
- db 01fh ;\r
- dw as.SHIFTOP ;RRC\r
- db 008h ;\r
- dw as.opc.noarg ;RRCA\r
- db 00fh ;\r
- dw gen.opc.ED2 ;RRD\r
- db 067h ;\r
- dw as.RST ;RST\r
- db 0c7h ;\r
- dw as.ADC_SBC ;SBC\r
- db 098h ;\r
- dw as.opc.noarg ;SCF\r
- db 037h ;\r
- dw as.BITOP ;SET\r
- db 0c0h ;\r
- dw as.SHIFTOP ;SLA\r
- db 020h ;\r
- dw as.SHIFTOP ;SRA\r
- db 028h ;\r
- dw as.SHIFTOP ;SRL\r
- db 038h ;\r
- dw as.AND_CP_OR_SUB_XOR ;SUB\r
- db 090h ;\r
- dw as.AND_CP_OR_SUB_XOR ;XOR\r
- db 0a8h ;\r
-\r
- dw as.IN0 ;IN0\r
- db 000h ;\r
- dw as.MLT ;MLT\r
- db 04ch ;\r
- dw gen.opc.ED2 ;OTDM\r
- db 08bh ;\r
- dw gen.opc.ED2 ;OTDMR\r
- db 09bh ;\r
- dw gen.opc.ED2 ;OTIM\r
- db 083h ;\r
- dw gen.opc.ED2 ;OTIMR\r
- db 093h ;\r
- dw as.OUTO ;OUT0\r
- db 001h ;\r
- dw gen.opc.ED2 ;SLP\r
- db 076h ;\r
- dw as.TST ;TST\r
- db 004h ;\r
- dw as.TSTIO ;TSTIO\r
- db 074h ;\r
-\r
-;-------------------------------------------------------------------------------\r
-\r
-as.TST:\r
- call arg.r_HL_A ;\r
- jr nc,as.tst_0\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- ld b,a\r
- jp gen.opc.ED2\r
-as.tst_0:\r
- ld b,064h\r
-as.TSTIO:\r
- call arg.imm_8bit ;\r
- jr as.store_io0\r
-\r
-as.IN0:\r
- call arg.r_HL_A ;\r
- jr nc,error5\r
- cp 006h\r
- jr z,error5\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- ld b,a\r
- call assert_comma ;\r
- call arg.addr_8bit ;\r
- jr as.store_io0\r
-\r
-as.OUTO:\r
- call arg.addr_8bit ;\r
- call assert_comma ;\r
- call arg.r_HL_A ;\r
- jr nc,error5\r
- cp 006h\r
- jr z,error5\r
- rlca\r
- rlca\r
- rlca\r
- add a,b\r
- ld b,a\r
-\r
-as.store_io0:\r
- call assert_eol\r
- ld (iy+000h),0edh\r
- ld (iy+001h),b\r
- ld (iy+002h),l\r
- ld c,003h\r
- ret\r
-\r
-as.MLT:\r
- call arg.ww ;\r
- jr nc,error5\r
- add a,b\r
- ld b,a\r
- jp gen.opc.ED2\r
-\r
-error5:\r
- jp ERROR\r
-\r
-as.LD:\r
- call arg.r_HL_A\r
- jr c,l13d4h\r
- call arg.IDX_displcmnt\r
- jp c,l1471h\r
- call arg.ww\r
- jp c,l149ch\r
- call arg.IX_IY\r
- jp c,l14f5h\r
- call get_char_upper\r
- cp 'I'\r
- jp z,l1511h\r
- cp 'R'\r
- jp z,l1519h\r
- cp '('\r
- jr nz,error5\r
- inc de\r
- call arg.ww\r
- jp c,l1528h\r
- call test_expr\r
- call test_paren_close\r
- call assert_comma\r
- call arg.ww\r
- jr c,l13c2h\r
- call arg.IX_IY\r
- jr nc,l13aah\r
- ld b,022h\r
-l1395h:\r
- call assert_eol\r
- ld a,(prefix_ixiy)\r
-l139bh:\r
- ld (iy+000h),a\r
- ld (iy+001h),b\r
- ld (iy+002h),l\r
- ld (iy+003h),h\r
- ld c,004h\r
- ret\r
-\r
-l13aah:\r
- call get_char_upper\r
- cp 'A'\r
- jr nz,error5\r
- inc de\r
- ld b,032h\r
-\r
-as.store_3:\r
- call assert_eol\r
- ld (iy+000h),b\r
- ld (iy+001h),l\r
- ld (iy+002h),h\r
- ld c,003h\r
- ret\r
-\r
-l13c2h:\r
- cp 020h\r
- jr z,l13d0h\r
- add a,043h\r
- ld b,a\r
-l13c9h:\r
- call assert_eol\r
- ld a,0edh\r
- jr l139bh\r
-l13d0h:\r
- ld b,022h\r
- jr as.store_3\r
-\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
- jr z,error60\r
-l13ech:\r
- ld b,a\r
- jp as.opc.noarg\r
-\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
- jr z,error60\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
-\r
-l1413h:\r
- call get_char_upper\r
- cp 'I'\r
- jr z,l1426h\r
- cp 'R'\r
- jr nz,l1432h\r
- ld a,b\r
- cp 007h\r
- jr nz,error60\r
- ld b,05fh\r
- jr l142eh\r
-\r
-l1426h:\r
- ld a,b\r
- cp 007h\r
- jr nz,error60\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
- jr nz,error60\r
- call arg.ww\r
- jr nc,l1466h\r
- cp 030h\r
- jr nc,error60\r
- add a,00ah\r
- ld b,a\r
- call test_paren_close\r
- jp as.opc.noarg\r
-\r
-error60:\r
- jp error\r
-\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
- jr z,error60\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
-\r
-l14c3h:\r
- ld a,b\r
- cp 030h\r
- jr nz,error6\r
- ld b,0f9h\r
- jr as.opc.noarg ;14ca\r
-\r
-l14cch:\r
- call get_char_upper\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
-\r
-l14e3h:\r
- ld b,02ah\r
- jp as.store_3\r
-\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
- call get_char_upper\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
-\r
-l1509h:\r
- call test_expr\r
- ld b,021h\r
- jp l1395h\r
-\r
-l1511h:\r
- inc de\r
- call assert_comma\r
- ld b,047h\r
- jr l151fh\r
-\r
-l1519h:\r
- inc de\r
- call assert_comma\r
- ld b,04fh\r
-l151fh:\r
- call get_char_upper\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
- call get_char_upper\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
- jr nc,error6\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
-\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
- jr nc,error6\r
- add a,009h\r
-l1596h:\r
- ld b,a\r
- jp l14b4h\r
-l159ah:\r
- call assert_comma\r
- call arg.ww\r
-error61nc:\r
- jr nc,error6\r
- add a,009h\r
- jp l13ech\r
-as.AND_CP_OR_SUB_XOR:\r
- call get_char_upper\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
- jr nc,error61nc\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
- jr nc,error61nc\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,error7\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,error7\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,error7\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,error7\r
- cp 006h\r
- jr z,error7\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
-error7:\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,error7\r
- cp 006h\r
- jr z,error7\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,error7\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
- jr nc,error7\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
- jr nc,error8\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,error8\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,error8\r
- ret\r
-\r
-arg.addr_8bit:\r
- call get_char_upper\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 error8\r
-\r
-test_expr:\r
- push bc\r
- call expr\r
- pop bc\r
- ret nc\r
-error8:\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