X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/836f48abced5e144dc61515cb2bdac71c77e43f3..c18ba81991314d10f95b00051fd1e3fbcebc8e48:/ddt180.z80 diff --git a/ddt180.z80 b/ddt180.z80 index ed3d7f2..3a445c3 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -29,32 +29,21 @@ current_cseg defl $ ; Some greneral definitions -TAB equ 9 -LF equ 10 -CR equ 13 +BS equ 08h +TAB equ 09h +CR equ 0dh +LF equ 0ah +DEL equ 7fh +CNTRX equ 'X'-'@' ; CP/M memory layout BDOS equ 5 -dfcb1 equ 05ch -dfcb2 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 @@ -62,12 +51,7 @@ STACK_SIZE equ 80 ;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) - -SYMCASE_SENS equ 0 ;Symbols are case sensitive -SYMCASE_CONV equ 1 ;Convert case when symbols are loaded -SYMCASE_LOWER equ 2 ;Convert to lower case if set, else to upper case +BP_SIZE equ 4 ;Size of a breakpoint record ;------------------------------------------------------------------------------- @@ -75,24 +59,16 @@ ddtz_base: jp ddtz_bdos l0003h: rst 30h -sub_0004h: +di_or_ei: nop ret ddtz_bdos: jp 0 -screen_width: - db 80 -symlen_max: - db 16 - -symattrib: - db 0 - current_cseg defl $ - current_cseg .phase current_phase + current_cseg signon: - db 'Symbolic DDTZ/180' + db 'DDTZ/180' db ' - Version ' maclib version.inc defvers @@ -133,9 +109,7 @@ reg.iff: db 0c3h reg.pc: dw TPA var.$: dw 0000h -var.@: dw 0 -error_func:dw p_msg_error cmd_rpt:dw mainloop ;------------------------------------------------------------------------------- @@ -146,9 +120,7 @@ conbuf: ld sp,stack exx ld de,ddtz_base - or a - sbc hl,de - add hl,de + call cp_hl_de jr c,l0079h ex de,hl l0079h: @@ -170,29 +142,48 @@ l007ch: ld a,0fbh l0093h: ld (reg.iff),a - call sub_0004h + call di_or_ei ld hl,ddtz_base ld l,000h ld (reg_sp),hl - call cpy_fcb2 - ld a,(dfcb1+1) - cp ' ' - ld hl,0 - call nz,read_file + + ld hl,(1) ;wboot addr + ld de,?const + ld b,6 +vini_l: + inc hl + inc hl + inc hl + ex de,hl + inc hl + ld (hl),e + inc hl + ld (hl),d + inc hl + ex de,hl + djnz vini_l + jr mainloop ds CONBUF_SIZE + 3 - ($ - conbuf) ;------------------------------------------------------------------------------- +?const: jp 0 ; return console input status +?conin: jp 0 ; return console input character +?cono: jp 0 ; send console output character +?list: jp 0 ; send list output character +?auxo: jp 0 ; send auxiliary output character +?auxi: jp 0 ; return auxiliary input character + CMDTAB: - dw cmd_@ ;examine/substitute the displacement register @ - dw cmd_A ;Assemble + dw ERROR ;cmd_@ ;examine/substitute the displacement register @ + dw ERROR ;cmd_A ;Assemble dw cmd_B ;Breakpoints display/set/clear - dw cmd_C ;trace over Calls + dw ERROR ;cmd_C ;trace over Calls dw cmd_D ;Display memory in hex and ascii dw ERROR ; - dw cmd_F ;specify Filename and command line + dw ERROR ;cmd_F ;specify Filename and command line dw cmd_G ;Go dw cmd_H ;compute Hex and other expressions dw cmd_I ;Input a byte from port @@ -204,25 +195,29 @@ CMDTAB: dw cmd_O ;Output a byte to port dw ERROR ; dw cmd_Q ;Qery memory for byte string - dw cmd_R ;Read binary or hex file and/or symbol file + dw cmd_R ;Read binary or hex file dw cmd_S ;Substitute memory dw cmd_T ;Trace dw ERROR ; dw cmd_V ;Verify (compare) two memory areas - dw cmd_W ;Write a file to disk + dw ERROR ;cmd_W ;Write a file to disk dw cmd_X ;eXamine [and substitute] registers - dw cmd_Y ;examine [and substitute] Y variables + dw ERROR ;cmd_Y ;examine [and substitute] Y variables dw cmd_Z ;Zap (fill) memory with a byte string +ERROR: +p_msg_error: + call pstr_inl + dc '?',CR,LF + ;fall thru mainloop: ld sp,stack - ld hl,p_msg_error - ld (error_func),hl ld hl,(reg.pc) ld (var.$),hl call bp_clr_temporary ld hl,(cmd_rpt) ld de,mainloop + push de call cp_hl_de ld a,'>' call outchar @@ -231,7 +226,8 @@ mainloop: call get_line call skipbl jr z,exe_hl - ld hl,mainloop + pop hl + push hl ld (cmd_rpt),hl inc de sub '@' @@ -245,48 +241,20 @@ mainloop: inc hl ld h,(hl) ld l,a - jr exe_hl - -ERROR: - ld hl,(error_func) exe_hl: - call CALL_HL - jr mainloop + jp (hl) ;------------------------------------------------------------------------------- -p_msg_error: - call pstr_inl - dc '?' - ;fall thru crlf: call pstr_inl - db CR,LF+80h - call inchar - ld a,0 + dc CR,LF + xor a ld (con_col),a + call inchar jr c,mainloop ret -out.hl.@: - call out_hl - push de - push hl - ld de,(var.@) - ld a,d - or e - jr z,l01bfh - call outbl - call pstr_inl - dc '@' - and a - sbc hl,de - call out_hl -l01bfh: - pop hl - pop de - ret - sub_01d9h: call pstr_inl dc '-' @@ -412,9 +380,8 @@ outchar: push bc push af and 07fh - ld e,a - ld c,BDOS_COUT - call ddtz_bdos + ld c,a + call ?cono ld hl,con_col inc (hl) pop af @@ -431,7 +398,6 @@ pstr: and a ret z call outchar - and a ret m jr pstr @@ -441,17 +407,6 @@ pstr_inl: ex (sp),hl ret -p_align_@_sym: - push de - ld de,(var.@) - ld a,d - or e - pop de - ld a,(symlen_cur) - jr z,$+4 - add a,6 - add a,c - ld c,a p_goto_col: ld a,(con_col) cp c @@ -462,41 +417,114 @@ p_goto_col: ;------------------------------------------------------------------------------- +incharw: + call inchar + jr nc,incharw + ret + +;------------------------------------------------------------------------------- + inchar: push ix push hl push de push bc - ld c,BDOS_CSTAT - call ddtz_bdos + call ?const and a - jr z,l0284h - ld c,BDOS_CIN - call ddtz_bdos + jr z,inch1 + call ?conin scf -l0284h: +inch1: pop bc pop de pop hl pop ix ret +;------------------------------------------------------------------------------- + +DELC: + ld a,b + or a + ret z + call DELC1 + dec hl + dec b + inc c + ld a,(hl) + cp ' ' + ret nc +DELC1: + call pstr_inl + dc BS,' ',BS + ret + +DELL: + ld a,b ; + or a ; + ret z ; + call DELC ; + jr DELL ; + +;------------------------------------------------------------------------------- + get_line: - push hl - ld de,conbuf - ld c,BDOS_CBUF - call ddtz_bdos - call crlf - ld hl,conbuf+1 - ld e,(hl) - xor a - ld d,a + push hl ; + ld hl,conbuf ; + ld c,(hl) ; + inc hl ; + ld b,000h ; + inc hl ; +inlnxtch: + ld a,c ; + or a ; + jr z,inl_e ; + call incharw ; + cp CR ; + jr z,inl_e ;Accept line + cp LF ; + jr z,inl_e ;Accept line + + cp BS ; + jr z,gl_1 ; + cp DEL ; + jr nz,gl_2 ; +gl_1: + call DELC ;Delete Char + jr inlnxtch ; +gl_2: + cp CNTRX ; + jr nz,gl_3 ; + call DELL ;Delete Line + jr inlnxtch ; +gl_3: + cp TAB ; + jr nz,gl_4 ; + ld a,' ' ; +gl_4: + ld (hl),a ; + cp ' ' ; + jr nc,gl_5 ; + ld a,'^' ;Controll characters + call outchar ; + ld a,(hl) ; + add a,'@' ; +gl_5: + call outchar ; + inc hl ; + inc b ; + dec c ; + jr inlnxtch ; + +inl_e: + ld (hl),0 + ld hl,conbuf+1 ; + ld (hl),b ; + call CRLF ; inc hl ex de,hl - add hl,de - ld (hl),a - pop hl - ret + pop hl ; + ret ; ;------------------------------------------------------------------------------- @@ -511,32 +539,26 @@ toupper: and 05fh ret -tolower: - cp 'A' - ret c - cp 'Z'+1 - ccf - ret c - or 020h - ret - ;------------------------------------------------------------------------------- skipbl0: inc de skipbl: call get_char_upper - call test_whitespace + cp ' ' + jr z,skipbl0 + cp TAB jr z,skipbl0 or a ret +;------------------------------------------------------------------------------- + next_arg: call skipbl cp ',' ret nz - inc de - call skipbl + call skipbl0 cp a ret @@ -574,86 +596,6 @@ cp_hl_de: sbc hl,de add hl,de ret - -sub_hl_a1: - dec hl -sub_hl_a: - push bc - ld c,a - ld b,0 - or a - sbc hl,bc - pop bc - ret - -;------------------------------------------------------------------------------- - -sym_getname: - push de - push hl - ld hl,ddtz_base+2 -sgn_l: - ld d,(hl) - dec hl - ld e,(hl) - dec hl - ld a,(hl) - cp 0c3h - jr z,sgn_e - - ex (sp),hl - call cp_hl_de - jr z,sgn_e - ex (sp),hl - call sub_hl_a1 - jr sgn_l -sgn_e: - sub 0c3h - pop hl - pop de - ret - -p_symstr: - push bc - ld b,(hl) -pss_l: - dec hl - ld a,(hl) - call outchar - djnz pss_l - dec hl - pop bc - ret - -p_symbol: - if 0 - ld a,(dash_flag) - or a - ret nz - endif - push hl - call sym_getname - call nz,p_symstr - pop hl - ret - -p_label: - if 0 - ld a,(dash_flag) - or a - ret nz - endif - push hl - call sym_getname - jr z,pl_e - call p_symstr - call pstr_inl - dc ':' - call crlf -pl_e: - pop hl - ret - ;------------------------------------------------------------------------------- lookupch: @@ -676,10 +618,6 @@ l0300h: sub_0303h: ld hl,t_reg_names ld b,07fh - jr l030ch - -sub_030ah: - ld b,0ffh l030ch: inc b ld a,(hl) @@ -690,10 +628,6 @@ l030ch: res 7,b ret -sub_0318h: - push bc - res 7,b - defb 03eh ;ld a,nn sub_031ch: push bc push de @@ -999,40 +933,33 @@ doop_mod: ; de: r (x%y) div_hl_de: - push bc - ex de,hl - ld b,h - ld c,l - ld hl,0 - ld a,16 + push bc + ex de,hl ;de: x + ld b,h ;bc: y + ld c,l + ld hl,0 ;hl: r + ld a,16 ; de: x (x shifted out, q shifted in) ; bc: y ; hl: r (initially 0) -l047eh: - push af - add hl,hl - ex de,hl - xor a - add hl,hl - ex de,hl - adc a,l - sub c - ld l,a - ld a,h - sbc a,b - ld h,a - inc de - jr nc,l048fh - add hl,bc - dec de -l048fh: - pop af - dec a - jr nz,l047eh - ex de,hl - pop bc +div_lp: + ex de,hl + add hl,hl ;x <<= 1 + ex de,hl + adc hl,hl ;r <<= 1 + inc de + or a + sbc hl,bc + jr nc,div_norestore + dec de + add hl,bc +div_norestore: + dec a + jr nz,div_lp + ex de,hl + pop bc ret doop_and: @@ -1114,9 +1041,6 @@ do_factor: ld hl,TPA cp 'L' ret z - ld hl,(var.@) - cp '@' - ret z ld hl,(var.$) cp '$' ret z @@ -1131,37 +1055,18 @@ do_factor: jr z,fact_factor cp '^' jr z,fact_reg.CPU - cp 'Y' - jr z,fact_reg.Y cp '(' jr z,fact_mem cp '[' jr z,expr_brckt cp '''' jr z,fact_factstring - cp '.' - jr z,fact_symbol dec de scf ret ;------------------------------------------------------------------------------- -fact_reg.Y: - call get.decdigit - jr c,error1 - inc de -get_y_val: - add a,a - ld hl,reg_Y - call add_hl_a - ld a,(hl) - inc hl - ld h,(hl) - ld l,a - and a - ret - fact_factstring: ld hl,0 l054bh: @@ -1246,59 +1151,6 @@ expr_brckt: error1: jp ERROR -fact_symbol: - push bc - ld hl,ddtz_base ;symtbl start - ld a,(symattrib) - ld c,07fh - rra - jr c,fs_nxtsym - res 5,c - -fs_nxtsym: - ld a,(hl) ;symlen - cp 0c3h - jr z,error1 - ld b,a ;symlen - inc b - push hl ;symtbl ptr - push de ;inpsym ptr -fs_nxtchar: - ld a,(de) - djnz fs_3 - call test_sym_char - jr z,fs_cont - pop hl ;inpsym ptr (discard) - inc de - cp a,':' - jr z,fs_cont_1 - dec de - - pop hl ;symtbl ptr - inc hl - ld a,(hl) ;symval h - inc hl - ld h,(hl) ;symval l - ld l,a - or a ;clear carry - pop bc - ret - -fs_3: - inc de - dec hl - xor (hl) - and c - jr z,fs_nxtchar -fs_cont: ;start over - pop de ;inpsym ptr -fs_cont_1: - pop hl ;symtbl ptr - ld a,(hl) - add a,3 - call sub_hl_a - jr fs_nxtsym - ;------------------------------------------------------------------------------- get.number: @@ -1420,6 +1272,7 @@ p_cpustat: l063eh: call p_regs djnz l063eh + call outbl6 push hl push de ld iy,(reg.pc) @@ -1436,8 +1289,6 @@ l065bh: djnz l065bh pop af pop hl - call nz,outbl6 - call nz,p_offset jp crlf p_f: @@ -1494,12 +1345,6 @@ p_regs: inc hl ld d,(hl) ex de,hl - dec a - jr z,l06d9h - call out.hl.@ - call z,outbl6 - jr l06e2h -l06d9h: call out_hl jr l06e2h l06deh: @@ -1562,19 +1407,19 @@ b_0709_start: cmd_G: sub a - ld (trace_call_flag),a - ld (l0941h),a + ld (bp_p_cpu_flag),a call expr jr c,l0740h ld (reg.pc),hl l0740h: call skipbl - jp z,user_go + jr z,user_go0 cp ';' jp nz,ERROR inc de ld a,002h call bp_enter +user_go0: jp user_go ;------------------------------------------------------------------------------- @@ -1589,7 +1434,9 @@ bpl_init: bpl_next: ld de,BP_SIZE + push af add ix,de + pop af dec b ret z @@ -1604,7 +1451,6 @@ bp_clr_temporary: ld a,(ix+000h) and 0f1h ld (ix+000h),a - call bp_clr_condition call bpl_next ret @@ -1616,11 +1462,10 @@ bp_clr_temporary: ; set breakpoints ; > BX ; clear all breakpoints -; > BX address [address..] +; > BX breakp [breakp..] ; clear breakpoints ; -; where breakp is: -; [R] expression [I condition] +; breakp can be any valid expression cmd_B: call skipbl @@ -1631,6 +1476,7 @@ cmd_B: dec de ld a,001h jp bp_enter + bp_clr0: call skipbl jr z,bp_clr_all @@ -1656,49 +1502,27 @@ bp_clr: jr nz,l07aeh l07a7h: ld (ix+000h),000h - call bp_clr_condition l07aeh: pop af call bpl_next ret bp_print: + ld c,0 call bpl_init bit 0,(ix+000h) jr z,bp_pr_cont - ld a,'R' - bit 4,(ix+000h) - jr nz,l07cdh - ld a,' ' -l07cdh: - call outchar - call outbl ld l,(ix+002h) ld h,(ix+003h) - call out.hl.@ - call outbl - call p_symbol - ld c,9 - call p_align_@_sym - call pstr_inl - dc ':' - ld l,(ix+004h) - ld h,(ix+005h) call out_hl - ld l,(ix+006h) - ld h,(ix+007h) - ld a,h - or l - jr z,l0805h - call outbl4 - call pstr_inl - dc 'I ' - call pstr -l0805h: - call crlf + call outbl2 + inc c bp_pr_cont: call bpl_next + ld a,c + or a + call nz,crlf ret ;------------------------------------------------------------------------------- @@ -1710,11 +1534,7 @@ bp_enter: ld b,a call skipbl ret z - cp 'R' - jr nz,bp_e_1 - inc de - set 4,b -bp_e_1: + push bc call expr jr c,error12 @@ -1729,12 +1549,6 @@ bp_e_1: pop de ld (ix+002h),l ld (ix+003h),h - call bp_get_count - ld (ix+004h),l - ld (ix+005h),h - call bp_get_condition - ld (ix+006h),l - ld (ix+007h),h call next_arg pop af ld (ix+000h),a @@ -1752,73 +1566,30 @@ bp_get_freeslot: error12 jp ERROR -bp_get_count: - call skipbl - ld hl,1 - cp ':' - ret nz - inc de - call expr - jr c,error12 - ret -bp_get_condition: - call skipbl - cp 'I' - ld hl,0 - ret nz - inc de - call skipbl - push de - call expr - jr c,error12 - ex de,hl - pop de - push de - sbc hl,de - ld b,h - ld c,l - ld hl,(expr_p1) - push hl - add hl,bc - ld de,expr_bufe - call cp_hl_de - jr nc,error12 - pop hl - ld (expr_p2),hl - pop de - ex de,hl - ldir - xor a - ld (de),a - inc de - ex de,hl - ld (expr_p1),hl - ld hl,(expr_p2) - ret - -;------------------------------------------------------------------------------- - -bpddtz: - ld (reg.l),hl - pop hl - dec hl - ld (reg.pc),hl - ld (reg_sp),sp - ld sp,reg.l +;------------------------------------------------------------------------------- +; Breakpoint handling routine. + +bpddtz: + ld (reg.l),hl + pop hl + dec hl + ld (reg.pc),hl + ld (reg_sp),sp + ld sp,reg.l push de push bc push af push ix push iy ld a,i - call sub_0004h + call di_or_ei ld h,a ld l,000h push hl - ld a,0f3h + ld a,0f3h ; EI jp po,l08dfh - ld a,0fbh + ld a,0fbh ; DI l08dfh: ld (reg.iff),a ex af,af' @@ -1827,18 +1598,18 @@ l08dfh: push bc push de push hl - call sub_097ah + call bp_restore_mem ld a,(b_21e2_start) dec a jr z,l090bh - call inchar - jr c,l0902h + call inchar ;Keyboard hit? + jr c,do_break ;yes call sub_0913h and a jp z,user_go and 083h jp z,l2151h -l0902h: +do_break: call bp_clr_temporary call p_cpustat jp mainloop @@ -1852,7 +1623,7 @@ sub_0913h: ld a,080h ex af,af' sub a - ld (l0941h),a + ld (bp_p_cpu_flag),a call bpl_init ld a,(ix+000h) @@ -1862,49 +1633,17 @@ sub_0913h: ld d,(ix+003h) ld hl,(reg.pc) call cp_hl_de - push bc - call z,sub_0942h - pop bc -l0938h: - - call bpl_next - ex af,af' - ret - -sub_0942h: + jr nz,l0938h ex af,af' res 7,a - ex af,af' - ld e,(ix+006h) - ld d,(ix+007h) - ld a,d - or e - ld hl,0ffffh - call nz,expr - ld a,h - or l - jr z,l0969h - ld e,(ix+004h) - ld d,(ix+005h) - dec de - ld a,d - or e - jr z,l0974h - ld (ix+004h),e - ld (ix+005h),d -l0969h: - bit 4,(ix+000h) - ret z - ld a,001h - ld (l0941h),a - ret -l0974h: - ex af,af' or (ix+000h) ex af,af' +l0938h: + call bpl_next + ex af,af' ret -sub_097ah: +bp_restore_mem: call bpl_init bit 5,(ix+000h) @@ -1923,38 +1662,33 @@ l099ah: call bpl_next ret -sub_09a6h: +bp_tst_@pc: call bpl_init ld a,(ix+000h) and 003h - jr z,l09c0h + jr z,bp_tst_e ld e,(ix+002h) ld d,(ix+003h) ld hl,(reg.pc) call cp_hl_de ret z -l09c0h: - +bp_tst_e: call bpl_next sub a inc a ret -sub_09cah: +bp_trace_enter: call bp_get_freeslot - ld (ix+004h),001h - ld (ix+005h),000h ld (ix+002h),l ld (ix+003h),h - ld (ix+006h),000h - ld (ix+007h),000h ld a,(b_21e2_start) and a ld a,008h - jr nz,l09edh + jr nz,bp_t_e rra -l09edh: +bp_t_e: ld (ix+000h),a ret @@ -1990,15 +1724,15 @@ l0a1dh: user_go: sub a ld (b_21e2_start),a - ld a,(l0941h) + ld a,(bp_p_cpu_flag) and a call nz,p_cpustat - call sub_09a6h + call bp_tst_@pc ld c,007h jr nz,l0a41h ld a,001h ld (b_21e2_start),a - call sub_1ffeh + call tc_set_bp ld c,008h l0a41h: call bp_set_to_mem @@ -2020,113 +1754,12 @@ l0a41h: ld sp,(reg_sp) jp reg.iff -;------------------------------------------------------------------------------- - -bp_clr_condition: - ld a,(ix+000h) - and 003h - ret nz - ld e,(ix+006h) - ld d,(ix+007h) - ld a,d - or e - ret z - push bc - ld h,d - ld l,e - sub a - ld (ix+006h),a - ld (ix+007h),a - ld bc,0ffffh - cpir -l0a7dh: - push de - ld de,(expr_p1) - call cp_hl_de - pop de - jr nc,l0a93h - call sub_0a99h -l0a8bh: - ld a,(hl) - ldi - and a - jr nz,l0a8bh - jr l0a7dh -l0a93h: - ld (expr_p1),de - pop bc - ret - -sub_0a99h: - ld iy,bp_tab - push de -l0a9eh: - ld e,(iy+006h) - ld d,(iy+007h) - call cp_hl_de - jr z,l0ab0h - ld de,BP_SIZE - add iy,de - jr l0a9eh -l0ab0h: - pop de - ld (iy+006h),e - ld (iy+007h),d - ret - ;------------------------------------------------------------------------------- ; > Y ; examine all Y variables ; > Y[0..9] ; examine (and substitute) an Y variable -cmd_Y: - call get.decdigit - jr c,l0bc3h - inc de - push af - call assert_eol - pop af - call sub_0bdch - jp l0c15h -l0bc3h: - call assert_eol - xor a -l0bc7h: - push af - call sub_0bdch - call outbl - pop af - push af - call get_y_val - call p_symbol - pop af - inc a - push af - rra - push af - ld c,11 - call c,p_align_@_sym - pop af - call nc,crlf - pop af - cp YREG_CNT - jr c,l0bc7h - ret - -sub_0bdch: - ld c,a - ld b,0 - add a,'0'+080h - ld de,msg_Y+1 - ld (de),a - dec de - ld hl,reg_Y - add hl,bc - add hl,bc - ex de,hl - ld c,003h - jp l0c33h ;------------------------------------------------------------------------------- ; > X @@ -2151,9 +1784,8 @@ cmd_X: ex de,hl ld hl,t_reg_names call sel_dc_string -l0c12h: call l0c33h -l0c15h: + call outbl push de push bc @@ -2187,9 +1819,7 @@ l0c33h: ld a,(de) dec de ld h,a - bit 1,c - jp z,out_hl - jp out.hl.@ + jp out_hl l0c4fh: call p_f @@ -2372,7 +2002,7 @@ cmd_S: call get_lastarg_def l0d60h: ld (last_S),hl - call out.hl.@ + call out_hl call outbl ld a,(hl) call out_hex @@ -2407,22 +2037,13 @@ l0d8ah: ; > @ ; examine (substitute) displacement register @ -cmd_@: - call assert_eol - ld hl,msg_@ - ld de,var.@ - ld c,001h - jp l0c12h - -msg_@: - dc '@' +;cmd_@: ;------------------------------------------------------------------------------- ; >>I [port] ; Input a byte from port cmd_I: - ld hl,cmd_I ld (cmd_rpt),hl ld hl,(last_I) call get_lastarg_def @@ -2442,7 +2063,6 @@ cmd_I: ; Output a byte to a port cmd_O: - ld hl,cmd_O ld (cmd_rpt),hl ld hl,(last_O_val) call get_arg_def @@ -2472,7 +2092,7 @@ l0dedh: cp b jr z,l0e10h ld c,a - call out.hl.@ + call out_hl call outbl ld a,b call out_hex @@ -2481,34 +2101,22 @@ l0dedh: call out_hex call outbl ex de,hl - call out.hl.@ + call out_hl ex de,hl call crlf l0e10h: pop bc - inc hl inc de - dec bc - ld a,b - or c - jr nz,l0dedh + cpi + jp pe,l0dedh ret ;------------------------------------------------------------------------------- -; > M[V] startaddr endaddr destaddr -; Move memory [and verify] +; > M startaddr endaddr destaddr +; Move memory cmd_M: - call get_char_upper - cp 'V' - jr nz,l0e1fh - inc de -l0e1fh: - push af call sub_034eh - push hl - push de - push bc call cp_hl_de jr nc,cmdm_up add hl,bc @@ -2521,49 +2129,19 @@ l0e1fh: db 01h ;swallow ldir instruction (ld bc,...) cmdm_up: ldir - pop bc - pop de - pop hl - pop af - jr z,l0dedh ret ;------------------------------------------------------------------------------- ; > H ; display Highest load address of last filed loaded, Maximum "High" ; off all loaded files, and Top address of available memory -; > HS -; display symbol list ; > H expression ; evaluate expression and display result in hex, decimal and other formats -; > H expression expression -; display sum und difference of expressions cmd_H: - call get_char_upper - cp 'S' - jr z,p_sym_list - call expr jp c,p_max_high0 - call next_arg - push hl - call expr - push af call assert_eol - pop af - ex de,hl - pop hl - jr c,l0e5eh - push hl - push de - add hl,de - call l0e5eh - pop de - pop hl - and a - sbc hl,de -l0e5eh: call out_hl call outbl2 call out_hl_neg @@ -2573,87 +2151,41 @@ l0e5eh: call out_hl_dec_neg call outbl4 call out.bin.w - call outbl + call outbl2 ld a,l call out.ascii - call outbl2 - call p_symbol jp crlf -p_sym_list: - inc de - call assert_eol - ld a,(symlen_cur) - add a,7 - ld b,a - ld c,0 - ld hl,ddtz_base+2 -psym_nxtsym: - ld d,(hl) - dec hl - ld e,(hl) - dec hl - ld a,(hl) - cp 0c3h - jr z,psym_e - - call p_goto_col - ex de,hl - call out_hl - call outbl - ex de,hl - call p_symstr - - ld a,c - add b - ld c,a - ld a,(screen_width) - sub b - cp c - jr nc,psym_nxtsym - - call crlf - ld c,0 - jr psym_nxtsym - -psym_e: - ld a,c - or a - ret z - jp crlf - - ;------------------------------------------------------------------------------- ; > Q[J] startaddr endaddr bytes ; Query memory for a byte string [Justified] cmd_Q: - call get_char_upper - sub 'J' - ld (cmd_Q_jopt),a - jr nz,l0e8dh - inc de -l0e8dh: call get_arg_range push bc push hl call sub_0ee6h pop hl l0e96h: - call sub_0ed7h + push hl + push de + push bc +l0edah: + ld a,(de) + cp (hl) + jr nz,l0ee2h + inc de + inc hl + djnz l0edah +l0ee2h: + pop bc + pop de + pop hl jr nz,l0eb0h push bc - push hl - ld a,(cmd_Q_jopt) - or a - jr nz,l0ea7h - ld bc,-8 - add hl,bc -l0ea7h: ld bc,16 - and a + and a ;clear carry call sub_0f58h - pop hl pop bc l0eb0h: inc hl @@ -2692,23 +2224,6 @@ l0ed3h: pop hl ret -sub_0ed7h: - push hl - push de - push bc -l0edah: - ld a,(de) - cp (hl) - jr nz,l0ee2h - inc de - inc hl - djnz l0edah -l0ee2h: - pop bc - pop de - pop hl - ret - sub_0ee6h: ld hl,conbuf+1 call sub_0ef7h @@ -2719,26 +2234,13 @@ sub_0ee6h: ret nz jp ERROR -sub_0ef7h: - db 0e6h ; and 037h (clear carry) -sub_0ef8h: +sub_0ef7h: ;from cmd_Q, cmd_Z + db 0e6h ;and 037h (clear carry) +sub_0ef8h: ;from cmd_S scf l0ef9h: push af call next_arg - cp 'W' - jr nz,l0f0eh - inc de - push hl - call sub_035dh - ex de,hl - ex (sp),hl - ld (hl),e - inc hl - ld a,d - pop de - jr l0f1ah -l0f0eh: cp '''' jr z,l0f1eh push hl @@ -2788,7 +2290,6 @@ l0f42h: ; Display memory in hex and ASCII cmd_D: - ld hl,cmd_D ld (cmd_rpt),hl ld hl,(last_D) ld bc,128 @@ -2800,9 +2301,8 @@ sub_0f58h: push hl push af l0f5ch: - call out.hl.@ - call z,outbl2 - call outbl + call out_hl + call outbl2 ld de,0 l0f68h: ld a,(hl) @@ -2836,1795 +2336,183 @@ l0f86h: ld (last_D),hl l0f97h: call crlf - ld a,b - or c - jr nz,l0f5ch - pop af - pop hl - pop de - pop bc - ret - -sub_0fa3h: - and 07fh - cp 07fh - jr z,l0fach - cp ' ' - ret nc -l0fach: - ld a,'.' - ret - -;------------------------------------------------------------------------------- -; > Fcommandline -; specifiy filenames and command line - -cmd_F: - push de - ld hl,DMA_BUF+1 - ld (hl),' ' - inc hl -l0fb6h: - call get_char_upper - ld (hl),a - inc hl - inc de - and a - jr nz,l0fb6h - ld a,l - sub DMA_BUF+2 - ld (DMA_BUF),a - pop hl - ld de,dfcb1 - call parse_filename - ld de,dfcb2 - call parse_filename - ;fall thru - -cpy_fcb2: - ld hl,dfcb2 - ld de,fcbsym - ld bc,16 - ldir - ret - -parse_filename: - call sub_102ch - push de - push bc - ld b,(hl) - inc hl - ld a,(hl) - cp ':' - jr nz,l0fe1h - inc hl - ld a,b - sub 040h - and 01fh - jr l0fe3h -l0fe1h: - dec hl - xor a -l0fe3h: - ld (de),a - inc de - ld b,8 - call sub_0ff2h - ld b,3 - call sub_0ff2h - pop bc - pop de - ret - -sub_0ff2h: - call sub_1012h - jr z,l0ffeh - inc hl - ld (de),a - inc de - djnz sub_0ff2h - jr l1003h -l0ffeh: - ld a,c -l0fffh: - ld (de),a - inc de - djnz l0fffh -l1003h: - call sub_1012h - inc hl - jr nz,l1003h - cp '*' - jr z,l1003h - cp '.' - ret z - dec hl - ret - -sub_1012h: - ld a,(hl) - ld c,' ' - and 01fh - ret z - ld a,(hl) - cp ' ' - ret z - call sub_1043h - ret z - cp '/' - ret z - cp '.' - ret z - ld c,'?' - call toupper - cp '*' - ret - -l102bh: - inc hl -sub_102ch: - ld a,(hl) - cp '/' - jr z,l103bh - call sub_1043h - jr z,l102bh -l1036h: - cp ' ' - jr z,l102bh - ret - -l103bh: - ld a,(hl) - cp ' '+1 - jr c,l1036h - inc hl - jr l103bh - -sub_1043h: - cp '=' - ret z - cp '_' - ret z - cp ',' - ret - -;------------------------------------------------------------------------------- - -setup_fcb: - push de - ld hl,12 - add hl,de - xor a - ld b,21 -l1052h: - ld (hl),a - inc hl - djnz l1052h - ld de,DMA_BUF - ld c,BDOS_SETDMA - call ddtz_bdos - pop de - ret - -;------------------------------------------------------------------------------- - -file_open: - ld (cur_fcb),de - call setup_fcb - ld c,BDOS_OPEN - call ddtz_bdos - inc a - jp z,ERROR - ld a,080h - ld (cmdR_rindex),a - ret - -read_byte: - ld a,(cmdR_rindex) - cp 080h - jr nz,l1111h - call read_sector - ld a,01ah - ret z - sub a -l1111h: - inc a - ld (cmdR_rindex),a - push hl - add a,07fh - ld l,a - ld h,000h - ld a,(hl) - pop hl - cp 01ah - ret - -read_sector: - push hl - push de - push bc - ld de,(cur_fcb) - ld c,BDOS_READ - call ddtz_bdos - sub a,1 - jr z,l1132h - jr nc,error2 -l1132h: - pop bc - pop de - pop hl - ret - -cmdR_storebyte: - push af - push de - ld de,TPA - call cp_hl_de - jr c,error2 - ld de,(BDOS+1) - call cp_hl_de - jr nc,error2 - ld de,(high_load) - call cp_hl_de - jr c,l1157h - ld (high_load),hl -l1157h: - ld de,(max_load) - call cp_hl_de - jr c,l1163h - ld (max_load),hl -l1163h: - pop de - pop af - ld (hl),a - ret - -strncmp: - ld a,(de) - cp (hl) - inc de - inc hl - ret nz - djnz strncmp - ret - -str_hex: - db 'HEX' - -read_hexchar: - call read_hexdigit - rlca - rlca - rlca - rlca - ld d,a - call read_hexdigit - add a,d - ld d,a - add a,c - ld c,a - ld a,d - ret - -read_hexdigit: - call read_byte - jr z,error2 -hex_digit_v: - call hex_digit - ret nc -error2: - jp ERROR - -read_hexbyte: - call read_byte -read_hexbyte0: - push bc - call hex_digit_v - rlca - rlca - rlca - rlca - ld c,a - call read_byte - call hex_digit_v - or c - pop bc - ret - -;------------------------------------------------------------------------------- -; > R [displacement] -; Read a binary or hex file and or symbol file [add displacement] - -cmd_R: - ld hl,0 - call get_lastarg_def -read_file: - ld de,dfcb1+1 - ld a,(de) - cp '?' - jr z,read_symfile - dec de - push hl - ld hl,0 - ld (high_load),hl - call file_open - ld hl,dfcb1+9 - ld de,str_hex - ld b,3 - call strncmp - pop hl - jr z,read_hexfile - ld de,TPA - push hl - add hl,de -l108eh: - call read_sector - jr nz,read_file_nxt - pop hl - jr read_symfile - -read_file_nxt: - ld de,DMA_BUF - ld b,080h -l109ah: - ld a,(de) - call cmdR_storebyte - inc de - inc hl - djnz l109ah - jr l108eh - -read_hexfile: - push hl -l10aeh: - call read_byte ; RECORD MARK - jr z,rdhex_done - cp ':' - jr nz,l10aeh - ld c,0 - call read_hexchar ; RECLEN - ld b,a - call read_hexchar ; LOAD ADDR H - ld h,a - call read_hexchar ; LOAD ADDR L - ld l,a - ld a,b - and a - jr z,rdhex_done - call read_hexchar ; RECTYP -l10cch: - call read_hexchar ; DATA - pop de - push de - push hl - add hl,de - call cmdR_storebyte - pop hl - inc hl - djnz l10cch - call read_hexchar ; CHKSUM - ld a,c - and a - jr nz,error3 - jr l10aeh -rdhex_done: - pop hl - jr read_symfile - -read_symfile: - ld de,fcbsym+1 - ld a,(de) - cp ' ' - jp z,p_max_high - - push hl ; offset - call pstr_inl - db 'SYMBOLS',CR,LF+80h - - dec de - call file_open - ld a,(symattrib) - ld c,a -rs_1: - call read_byte -rs_2: - pop de ; offset - cp 1ah - jp z,p_max_high - push de ; offset - cp '!' - jr c,rs_1 - call read_hexbyte0 ; symval H - ld h,a - call read_hexbyte ; symval L - ld l,a - add hl,de - call read_byte - cp ' ' - jr z,rs_4 -rs_3: call read_byte - cp ' ' - jr nc,rs_3 - jr rs_2 - -rs_4: - push hl ; symval - ld hl,(BDOS+1) ; - ld b,0 ; setup symlen -rs_5: - dec hl ; - call read_byte ; next char of symbol name - call test_sym_char ; valid char? - jr nz,rs_6 - bit SYMCASE_CONV,c - jr z,rs_51 - call toupper - bit SYMCASE_LOWER,c - call nz,tolower -rs_51: - ld (hl),a ; - inc b ; symlen++ - ld a,(symlen_max) ; - cp b ; - jr nc,rs_5 ; -error3: - jp ERROR ; - -rs_6: - call test_symterm_ch - jr nz,error3 - - push bc ; symlen - ex de,hl ; - ld hl,(BDOS+1) ; - inc hl ; - ld c,(hl) ; - inc hl ; - ld b,(hl) ; - ex de,hl - ld (hl),b ; - dec hl ; - ld (hl),c ; - dec hl ; - ld (hl),0c3h ; - - ld de,(max_load) ; - call cp_hl_de ; - jr c,error3 ; - ld de,(reg_sp) ; - call cp_hl_de ; - jr nc,rs_61 ; - ld (reg_sp),hl ; -rs_61: - ld de,(BDOS+1) ; - ld (BDOS+1),hl ; - ex de,hl ; - pop bc ; symlen - ld (hl),b ; - inc hl ; - pop de ; symval - ld (hl),e ; - inc hl ; - ld (hl),d ; - ld a,b ; - ld hl,symlen_cur ; - cp (hl) ; new max? - jr c,$+3 ; - ld (hl),a ; - jp rs_1 ; - - -; test for valid character for symbols -; return z if valid - -test_sym_char: - cp '$' - ret z - cp '%' - ret z - cp '.' - ret z - cp '_' - ret z - call test_alphanum - ret c ; cy == 1 --> z == 0 - cp a ; return z - ret - - -; check if char is in [0..9,?,@,A..Z,a..z] -; return cy if invalid -; return nc if valid alfanumeric char - -test_alphanum: - cp 'z' - ret z - ccf - ret c - cp 'a' - ret nc - cp 'Z' - ret z - ccf - ret c - cp '?' - ret nc -test_numeral: - cp '9' - ret z - ccf - ret c - cp '0' - ret - -test_symterm_ch: - cp CR - ret z - cp LF - ret z -test_whitespace: - cp ' ' - ret z - cp TAB - ret - -;------------------------------------------------------------------------------- - -p_max_high0: - call assert_eol -p_max_high: - call pstr_inl - DC 'High = ' - ld hl,(high_load) - call out_hl - call pstr_inl - DC ' Max = ' - ld hl,(max_load) - call out_hl - call pstr_inl - DC ' Top = ' - ld hl,(BDOS+1) - call out_hl - jp crlf - -;------------------------------------------------------------------------------- -; > Wstartaddr endaddr -; Write a file to disk - -cmd_W: - call get_arg_range - call assert_eol - push hl - ld a,c - add a,07fh - jr nc,l11adh - inc b -l11adh: - and 080h - ld c,a - push bc - ld a,(dfcb1+1) - cp ' ' - jr z,error4 - ld de,dfcb1 - call setup_fcb - push de - ld c,BDOS_DELETE - call ddtz_bdos - pop de - ld c,BDOS_CREATE - call ddtz_bdos - inc a - jr z,error4 - pop bc - pop hl -l11cch: - ld a,b - or c - jr z,close_file - push bc - ld de,080h ; DMA_BUF - ld b,d - ld c,e - ldir - call write_sector - ex (sp),hl - ld bc,0ff80h - add hl,bc - ex (sp),hl - pop bc - jr l11cch - -write_sector: - push hl - ld de,dfcb1 - ld c,BDOS_WRITE - call ddtz_bdos - pop hl - and a - ret z - call close_file -error4: - jp ERROR - -close_file: - ld de,dfcb1 - ld c,BDOS_CLOSE - jp ddtz_bdos - -;------------------------------------------------------------------------------- -; > A [startaddr] -; Assemble Zilog Z180 mnemonics - -cmd_A: - ld hl,(last_A) - call get_lastarg_def - ld (last_A),hl - ld (cmd_A_prev),hl - ld hl,cmda_restart - ld (error_func),hl - ld (l1262h),sp -cmda_loop: - ld hl,(last_A) - ld (var.$),hl - push hl - call p_disas_line - ld c,19 - call p_align_@_sym - ld c,b - push bc - call get_line - pop bc - pop hl - call skipbl - cp '.' - ret z - cp '-' - jr nz,l124bh - ld hl,(cmd_A_prev) - jr cmda_lpend -l124bh: - push hl - pop iy - push hl - and a - call nz,asemble_line - ld b,0 - pop hl - ld (cmd_A_prev),hl - add hl,bc -cmda_lpend: - ld (last_A),hl - jr cmda_loop - -cmda_restart: - call p_msg_error - ld sp,(l1262h) - jr cmda_loop - -asemble_line: - call skipbl - ld hl,t_MNEMONICS - call sub_030ah - jr nc,error4 - call skipbl - push de - ld a,b - add a,b - add a,b - ld hl,b_1289_start - call add_hl_a - ld e,(hl) - inc hl - ld d,(hl) - inc hl - ld b,(hl) - ex de,hl - pop de - -CALL_HL: - jp (hl) - -;------------------------------------------------------------------------------- - -b_1289_start: - dw as.ADC_SBC ;ADC - db 088h ; - dw as.ADD ;ADD - db 080h ; - dw as.AND_CP_OR_SUB_XOR ;AND - db 0a0h ; - dw as.BITOP ;BIT - db 040h ; - dw as.CALL ;CALL - db 0c4h ; - dw as.opc.noarg ;CCF - db 03fh ; - dw as.AND_CP_OR_SUB_XOR ;CP - db 0b8h ; - dw gen.opc.ED2 ;CPD - db 0a9h ; - dw gen.opc.ED2 ;CPDR - db 0b9h ; - dw gen.opc.ED2 ;CPI - db 0a1h ; - dw gen.opc.ED2 ;CPIR - db 0b1h ; - dw as.opc.noarg ;CPL - db 02fh ; - dw as.opc.noarg ;DAA - db 027h ; - dw as.DEC_INC ;DEC - db 005h ; - dw as.opc.noarg ;DI - db 0f3h ; - dw as.DJNZ ;DJNZ - db 010h ; - dw as.opc.noarg ;EI - db 0fbh ; - dw as.EX ;EX - db 0e3h ; - dw as.opc.noarg ;EXX - db 0d9h ; - dw as.opc.noarg ;HALT - db 076h ; - dw as.IM ;IM - db 046h ; - dw as.IN ;IN - db 040h ; - dw as.DEC_INC ;INC - db 004h ; - dw gen.opc.ED2 ;IND - db 0aah ; - dw gen.opc.ED2 ;INDR - db 0bah ; - dw gen.opc.ED2 ;INI - db 0a2h ; - dw gen.opc.ED2 ;INIR - db 0b2h ; - dw as.JP ;JP - db 0c2h ; - dw as.JR ;JR - db 020h ; - dw as.LD ;LD - db 040h ; - dw gen.opc.ED2 ;LDD - db 0a8h ; - dw gen.opc.ED2 ;LDDR - db 0b8h ; - dw gen.opc.ED2 ;LDI - db 0a0h ; - dw gen.opc.ED2 ;LDIR - db 0b0h ; - dw gen.opc.ED2 ;NEG - db 044h ; - dw as.opc.noarg ;NOP - db 000h ; - dw as.AND_CP_OR_SUB_XOR ;OR - db 0b0h ; - dw gen.opc.ED2 ;OTDR - db 0bbh ; - dw gen.opc.ED2 ;OTIR - db 0b3h ; - dw as.OUT ;OUT - db 041h ; - dw gen.opc.ED2 ;OUTD - db 0abh ; - dw gen.opc.ED2 ;OUTI - db 0a3h ; - dw as.POP_PUSH ;POP - db 0c1h ; - dw as.POP_PUSH ;PUSH - db 0c5h ; - dw as.BITOP ;RES - db 080h ; - dw as.RET ;RET - db 0c0h ; - dw gen.opc.ED2 ;RETI - db 04dh ; - dw gen.opc.ED2 ;RETN - db 045h ; - dw as.SHIFTOP ;RL - db 010h ; - dw as.opc.noarg ;RLA - db 017h ; - dw as.SHIFTOP ;RLC - db 000h ; - dw as.opc.noarg ;RLCA - db 007h ; - dw gen.opc.ED2 ;RLD - db 06fh ; - dw as.SHIFTOP ;RR - db 018h ; - dw as.opc.noarg ;RRA - db 01fh ; - dw as.SHIFTOP ;RRC - db 008h ; - dw as.opc.noarg ;RRCA - db 00fh ; - dw gen.opc.ED2 ;RRD - db 067h ; - dw as.RST ;RST - db 0c7h ; - dw as.ADC_SBC ;SBC - db 098h ; - dw as.opc.noarg ;SCF - db 037h ; - dw as.BITOP ;SET - db 0c0h ; - dw as.SHIFTOP ;SLA - db 020h ; - dw as.SHIFTOP ;SRA - db 028h ; - dw as.SHIFTOP ;SRL - db 038h ; - dw as.AND_CP_OR_SUB_XOR ;SUB - db 090h ; - dw as.AND_CP_OR_SUB_XOR ;XOR - db 0a8h ; - - dw as.IN0 ;IN0 - db 000h ; - dw as.MLT ;MLT - db 04ch ; - dw gen.opc.ED2 ;OTDM - db 08bh ; - dw gen.opc.ED2 ;OTDMR - db 09bh ; - dw gen.opc.ED2 ;OTIM - db 083h ; - dw gen.opc.ED2 ;OTIMR - db 093h ; - dw as.OUTO ;OUT0 - db 001h ; - dw gen.opc.ED2 ;SLP - db 076h ; - dw as.TST ;TST - db 004h ; - dw as.TSTIO ;TSTIO - db 074h ; - -;------------------------------------------------------------------------------- - -as.TST: - call arg.r_HL_A ; - jr nc,as.tst_0 - rlca - rlca - rlca - add a,b - ld b,a - jp gen.opc.ED2 -as.tst_0: - ld b,064h -as.TSTIO: - call arg.imm_8bit ; - jr as.store_io0 - -as.IN0: - call arg.r_HL_A ; - jr nc,error5 - cp 006h - jr z,error5 - rlca - rlca - rlca - add a,b - ld b,a - call assert_comma ; - call arg.addr_8bit ; - jr as.store_io0 - -as.OUTO: - call arg.addr_8bit ; - call assert_comma ; - call arg.r_HL_A ; - jr nc,error5 - cp 006h - jr z,error5 - rlca - rlca - rlca - add a,b - ld b,a - -as.store_io0: - call assert_eol - ld (iy+000h),0edh - ld (iy+001h),b - ld (iy+002h),l - ld c,003h - ret - -as.MLT: - call arg.ww ; - jr nc,error5 - add a,b - ld b,a - jp gen.opc.ED2 - -error5: - jp ERROR - -as.LD: - call arg.r_HL_A - jr c,l13d4h - call arg.IDX_displcmnt - jp c,l1471h - call arg.ww - jp c,l149ch - call arg.IX_IY - jp c,l14f5h - call get_char_upper - cp 'I' - jp z,l1511h - cp 'R' - jp z,l1519h - cp '(' - jr nz,error5 - inc de - call arg.ww - jp c,l1528h - call test_expr - call test_paren_close - call assert_comma - call arg.ww - jr c,l13c2h - call arg.IX_IY - jr nc,l13aah - ld b,022h -l1395h: - call assert_eol - ld a,(prefix_ixiy) -l139bh: - ld (iy+000h),a - ld (iy+001h),b - ld (iy+002h),l - ld (iy+003h),h - ld c,004h - ret - -l13aah: - call get_char_upper - cp 'A' - jr nz,error5 - inc de - ld b,032h - -as.store_3: - call assert_eol - ld (iy+000h),b - ld (iy+001h),l - ld (iy+002h),h - ld c,003h - ret - -l13c2h: - cp 020h - jr z,l13d0h - add a,043h - ld b,a -l13c9h: - call assert_eol - ld a,0edh - jr l139bh -l13d0h: - ld b,022h - jr as.store_3 - -l13d4h: - ld b,a - call assert_comma - call arg.r_HL_A - jr nc,l13f0h - push af - ld a,b - rlca - rlca - rlca - ld b,a - pop af - add a,b - add a,040h - cp 076h - jr z,error60 -l13ech: - ld b,a - jp as.opc.noarg - -l13f0h: - call arg.IDX_displcmnt - jr nc,l1413h - ld a,b - rlca - rlca - rlca - add a,046h - cp 076h - jr z,error60 - -l1400h: - ld b,a - call assert_eol - ld (iy+001h),b - ld (iy+002h),c - ld a,(prefix_ixiy) - ld (iy+000h),a - ld c,003h - ret - -l1413h: - call get_char_upper - cp 'I' - jr z,l1426h - cp 'R' - jr nz,l1432h - ld a,b - cp 007h - jr nz,error60 - ld b,05fh - jr l142eh - -l1426h: - ld a,b - cp 007h - jr nz,error60 - ld b,057h -l142eh: - inc de - jp gen.opc.ED2 -l1432h: - cp '(' - jr z,l144ch - call arg.imm_8bit - ld a,b - rlca - rlca - rlca - add a,006h -l143fh: - ld b,a -as.store_2: - call assert_eol - ld (iy+000h),b - ld (iy+001h),l - ld c,002h - ret -l144ch: - inc de - ld a,b - cp 007h - jr nz,error60 - call arg.ww - jr nc,l1466h - cp 030h - jr nc,error60 - add a,00ah - ld b,a - call test_paren_close - jp as.opc.noarg - -error60: - jp error - -l1466h: - call test_expr - call test_paren_close - ld b,03ah - jp as.store_3 - -l1471h: - call assert_comma - call arg.r_HL_A - jr nc,l1483h - cp 006h - jr z,error60 - add a,070h - jp l1400h - -l1483h: - call arg.imm_8bit - call assert_eol - ld a,(prefix_ixiy) - ld (iy+000h),a - ld (iy+001h),036h - ld (iy+002h),c - ld (iy+003h),l - ld c,004h - ret -l149ch: - ld b,a - call assert_comma - ld hl,t_HL.AF - call sub_0318h - jr c,l14c3h - call arg.IX_IY - jr nc,l14cch - ld a,b - cp 030h - jr nz,error6 - ld b,0f9h -l14b4h: - call assert_eol - ld a,(prefix_ixiy) - ld (iy+000h),a - ld (iy+001h),b - ld c,002h - ret - -l14c3h: - ld a,b - cp 030h - jr nz,error6 - ld b,0f9h - jr as.opc.noarg ;14ca - -l14cch: - call get_char_upper - cp '(' - jr nz,l14e8h - inc de - call test_expr - call test_paren_close - ld a,b - cp 020h - jr z,l14e3h - add a,04bh - ld b,a - jp l13c9h - -l14e3h: - ld b,02ah - jp as.store_3 - -l14e8h: - call test_expr - call assert_eol - ld a,001h - add a,b - ld b,a - jp as.store_3 -l14f5h: - call assert_comma - call get_char_upper - cp '(' - jr nz,l1509h - inc de - call test_expr - call test_paren_close - ld b,02ah - jp l1395h - -l1509h: - call test_expr - ld b,021h - jp l1395h - -l1511h: - inc de - call assert_comma - ld b,047h - jr l151fh - -l1519h: - inc de - call assert_comma - ld b,04fh -l151fh: - call get_char_upper - inc de - cp 'A' - jr z,gen.opc.ED2 -error6: - jp ERROR - -l1528h: - cp 020h - jr nc,error6 - add a,002h - ld b,a - call test_paren_close - call assert_comma - call get_char_upper - cp 'A' - jr nz,error6 - inc de -as.opc.noarg: - call assert_eol - ld (iy+000h),b - ld c,001h - ret - -gen.opc.ED2: - call assert_eol - ld (iy+000h),0edh - ld (iy+001h),b - ld c,002h - ret - -as.ADC_SBC: - ld hl,t_HL.AF - call sub_0318h - jr nc,as.AND_CP_OR_SUB_XOR - call assert_comma - call arg.ww - jr nc,error6 - push af - ld a,b - cp 088h - ld b,04ah - jr z,l156ch - ld b,042h -l156ch: - pop af - add a,b -l156eh: - ld b,a - jr gen.opc.ED2 - -as.ADD: - ld hl,t_HL.AF - call sub_0318h - jr c,l159ah - call arg.IX_IY - jr nc,as.AND_CP_OR_SUB_XOR - call assert_comma - ld hl,t_BC.DE.IX.SP - ld a,(prefix_ixiy) - cp 0fdh - jr nz,l158eh - ld hl,t_BC.DE.IY.SP -l158eh: - call arg.reg_16bit - jr nc,error6 - add a,009h -l1596h: - ld b,a - jp l14b4h -l159ah: - call assert_comma - call arg.ww -error61nc: - jr nc,error6 - add a,009h - jp l13ech -as.AND_CP_OR_SUB_XOR: - call get_char_upper - cp 'A' - jr nz,l15b8h - push de - inc de - call next_arg - jr z,l15b7h - pop de - jr l15b8h -l15b7h: - pop af -l15b8h: - call arg.r_HL_A - jr c,l15cbh - call arg.IDX_displcmnt - jr c,l15cfh - call arg.imm_8bit - ld a,b - add a,046h - jp l143fh -l15cbh: - add a,b - jp l13ech -l15cfh: - ld a,b - add a,006h - jp l1400h - -as.SHIFTOP: - call arg.r_HL_A - jr c,l15fah - call arg.IDX_displcmnt - jr nc,error61nc - ld a,b - add a,006h - ld b,a -l15e4h: - call assert_eol - ld a,(prefix_ixiy) - ld (iy+000h),a - ld (iy+001h),0cbh - ld (iy+002h),c - ld (iy+003h),b - ld c,004h - ret - -l15fah: - add a,b -l15fbh: - ld b,a - call assert_eol - ld (iy+001h),b - ld (iy+000h),0cbh - ld c,002h - ret - -as.BITOP: - call arg.bit - call assert_comma - call arg.r_HL_A - jr c,l1624h - call arg.IDX_displcmnt - jr nc,error61nc - ld a,l - rlca - rlca - rlca - add a,006h - add a,b - ld b,a - jr l15e4h -l1624h: - add a,b - ld b,a - ld a,l - rlca - rlca - rlca - add a,b - jr l15fbh - -as.CALL: - push de - call arg.cc_ZCPS - jr nc,l163ch - add a,b - ld b,a - call next_arg - jr z,l163eh - pop de - push de -l163ch: - ld b,0cdh -l163eh: - pop af - call test_expr - jp as.store_3 - -as.RET: - call arg.cc_ZCPS - jr nc,l164eh - add a,b - ld b,a - jr l1650h -l164eh: - ld b,0c9h -l1650h: - jp as.opc.noarg - -as.JP: - push de - call arg.cc_ZCPS - jr c,l1666h -l1659h: - pop de - ld hl,l168ch - call sub_030ah - jr c,l1674h - ld b,0c3h - jr l166eh - -l1666h: - add a,b - ld b,a - call next_arg - jr nz,l1659h - pop af -l166eh: - call test_expr - jp as.store_3 -l1674h: - call assert_eol - ld a,b - and a - jr nz,l1680h - ld b,0e9h - jp as.opc.noarg -l1680h: - ld b,0ddh - dec a - jr z,l1687h - ld b,0fdh -l1687h: - ld l,0e9h - jp as.store_2 - -l168ch: - DC '(HL)' - DC '(IX)' - DC '(IY)' - DB 0 - -as.DJNZ: - call next_arg - ld b,010h - jr l16aeh -as.JR: - call arg.cc_ZC - jr c,l16a9h - ld b,018h - jr l16aeh -l16a9h: - add a,b - ld b,a - call assert_comma -l16aeh: - call arg.j_displ - jp as.store_2 - -as.IM: - call arg.imm_8bit - ld a,l - cp 003h - jr nc,error7 - and a - jr z,l16c7h - ld b,056h - cp 001h - jr z,l16c7h - ld b,05eh -l16c7h: - jp gen.opc.ED2 - -as.RST: - call arg.imm_8bit - ld a,l - push af - add a,b - ld b,a - pop af - and 0c7h - jr nz,error7 - jp as.opc.noarg - -as.POP_PUSH: - call arg.IX_IY - jr c,l16e7h - call arg.zz - jr nc,error7 - add a,b - jp l13ech -l16e7h: - ld a,b - add a,020h - jp l1596h - -as.IN: - call arg.r_HL_A - jr nc,error7 - cp 006h - jr z,error7 - rlca - rlca - rlca - add a,b - ld b,a - cp 078h - jr nz,l170fh - call assert_comma - call sub_171bh - jr c,l1715h - call arg.addr_8bit - ld b,0dbh - jp as.store_2 -l170fh: - call assert_comma - call sub_171bh -l1715h: - jp c,gen.opc.ED2 -error7: - jp ERROR - -sub_171bh: - ld hl,t__C_ - jp sub_0318h - -as.OUT: - call sub_171bh - jr nc,l1739h - call assert_comma - call arg.r_HL_A - jr nc,error7 - cp 006h - jr z,error7 - rlca - rlca - rlca - add a,b - jp l156eh - -l1739h: - call arg.addr_8bit - call assert_comma - cp 'A' - jr nz,error7 - inc de - ld b,0d3h - jp as.store_2 - -as.EX: - ld hl,b_176d_start - call sub_030ah - jr nc,error7 - ld c,b - call assert_eol - ld b,000h - ld hl,l178eh - add hl,bc - add hl,bc - ld a,(hl) - ld (iy+000h),a - ld c,001h - inc hl - ld a,(hl) - and a - ret z - ld (iy+001h),a - ld c,002h - ret - -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 - db 0ebh,000h - db 0e3h,000h - db 0ddh,0e3h - db 0fdh,0e3h - -as.DEC_INC: - call arg.IX_IY - jr c,l17b3h - call arg.ww - jr c,l17bfh - call arg.r_HL_A - jr c,l17cch - call arg.IDX_displcmnt - jr nc,error8 - ld a,b - add a,030h - jp l1400h -l17b3h: - ld a,b - ld b,023h - cp 004h - jr z,l17bch - ld b,02bh -l17bch: - jp l14b4h -l17bfh: - push af - ld a,b - ld b,003h - cp 004h - jr z,l17c9h - ld b,00bh -l17c9h: - pop af - jr l17cfh -l17cch: - rlca - rlca - rlca -l17cfh: - add a,b - jp l13ech - -arg.bit: - call arg.imm_8bit - ld a,l - cp 008h - jr nc,error8 - ret - -arg.j_displ: - call test_expr - push bc - push iy - pop bc - and a - sbc hl,bc - dec hl - dec hl - pop bc - call sub_1802h - ld a,h - xor l - bit 7,a - jr nz,error8 - ret - -arg.addr_8bit: - call get_char_upper - cp '(' - jr nz,arg.imm_8bit - inc de - call arg.imm_8bit - jp test_paren_close - -arg.imm_8bit: - call test_expr -sub_1802h: - ld a,h - and a - ret z - inc a - ret z - jr error8 - -test_expr: - push bc - call expr - pop bc - ret nc -error8: - jp ERROR - -arg.zz: - push hl - ld hl,t_BC.DE.HL.AF - jr l181fh - -arg.reg_16bit: - push hl - jr l181fh - -arg.ww: - push hl - ld hl,t_BC.DE.HL.SP -l181fh: - push bc - call sub_030ah - jr nc,l182bh - ld a,b - rlca - rlca - rlca - rlca - scf -l182bh: - pop bc - pop hl - ret - -arg.r_HL_A: - call skipbl - push bc - push hl - ld hl,t_BCDEHL_HL_A - call sub_030ah - ld a,b - pop hl - pop bc - ret - -arg.IX_IY: - push hl - push bc - ld hl,t_IX.IY - call sub_030ah - jr nc,l1852h - ld a,0ddh - dec b - jr nz,l184eh - ld a,0fdh -l184eh: - ld (prefix_ixiy),a - scf -l1852h: - pop bc - pop hl - ret - -arg.IDX_displcmnt: - push hl - push bc - call get_char_upper - cp '(' - jr nz,l18a1h - push de - inc de - ld hl,t_IX.IY - call sub_030ah - jr nc,l18a0h - pop af - ld a,0ddh - dec b - jr nz,l186eh - ld a,0fdh -l186eh: - ld (prefix_ixiy),a - call get_char_upper - cp '+' - jr z,l1882h - cp ')' - ld hl,0 - jr z,l189ah - cp '-' - jr nz,error9 -l1882h: - push af - inc de - call arg.imm_8bit - pop af - cp '+' - jr z,l1894h - ld b,h - ld c,l - ld hl,0 - and a - sbc hl,bc -l1894h: - call get_char_upper - cp ')' - jr nz,error9 -l189ah: - inc de - pop bc - ld c,l + ld a,b + or c + jr nz,l0f5ch + pop af pop hl - scf - ret -l18a0h: pop de -l18a1h: pop bc - pop hl - and a ret -arg.cc_ZCPS: - ld hl,t_tstfl_ZCPS - ld c,007h - jr l18b1h +sub_0fa3h: + and 07fh + cp 07fh + jr z,l0fach + cp ' ' + ret nc +l0fach: + ld a,'.' + ret -arg.cc_ZC: - ld hl,t_tstfl_ZC - ld c,003h -l18b1h: - push bc - call sub_030ah +;------------------------------------------------------------------------------- +; > Fcommandline +; specifiy filenames and command line + +;cmd_F: + +;------------------------------------------------------------------------------- +; > R [displacement] +; Read Intel Hex File from console [add displacement] + +cmd_R: + ld hl,0 + call get_lastarg_def ;get offset from command line + push hl + ld hl,0 + ld (high_load),hl +w_recstart: + call i.getchar + jr z,rdhex_done + cp ':' + jr nz,w_recstart + ld c,0 ;init checksum + call i.gethexbyte ;record len + ld b,a + call i.gethexbyte ;address high + ld h,a + call i.gethexbyte ;address low + ld l,a + call i.gethexbyte ;record type (ignored) ld a,b - pop bc - ret nc - and c + and a ;record len == 0? + jr z,rdhex_done +l16c6h: + call i.gethexbyte + pop de ;offset + push de + push hl + add hl,de + call i.storebyte + pop hl + inc hl + djnz l16c6h ;repeat for record len + call i.gethexbyte ;checksum + ld a,c + and a + jp nz,ERROR ;exit if checksum error + jr w_recstart ;next record +rdhex_done: + pop hl + call i.gethexbyte + jp p_max_high + +i.gethexbyte: + call sub_16f6h rlca rlca rlca - scf + rlca + ld d,a + call sub_16f6h + add a,d + ld d,a + add a,c + ld c,a + ld a,d ret -assert_comma: - call next_arg - ret z -error9: +sub_16f6h: + call i.getchar + jr z,error2 + call hex_digit + ret nc +error2: jp ERROR -test_paren_close: - call get_char_upper - cp ')' - jr nz,error9 - inc de +i.getchar: + call incharw + cp 01ah + ret + +i.storebyte: + push af + push de + ld de,TPA ;lowest allowed load address + call cp_hl_de + jr c,error2 + ld de,(BDOS+1) ;highest allowed load address + call cp_hl_de + jr nc,error2 + ld de,(high_load) + call cp_hl_de + jr c,l1157h + ld (high_load),hl +l1157h: + ld de,(max_load) + call cp_hl_de + jr c,l1163h + ld (max_load),hl +l1163h: + pop de + pop af + ld (hl),a ;store byte ret +;------------------------------------------------------------------------------- + +p_max_high0: + call assert_eol +p_max_high: + call pstr_inl + DC 'High = ' + ld hl,(high_load) + call out_hl + call pstr_inl + DC ' Max = ' + ld hl,(max_load) + call out_hl + call pstr_inl + DC ' Top = ' + ld hl,(BDOS+1) + call out_hl + jp crlf + +;------------------------------------------------------------------------------- +; > Wstartaddr endaddr +; Write a file to disk + +;cmd_W: + +;------------------------------------------------------------------------------- +; > A [startaddr] +; Assemble Zilog Z180 mnemonics + +;cmd_A: + + +CALL_HL: + jp (hl) + +;------------------------------------------------------------------------------- + + + + +b_176d_start: + DC 'AF,AF''' +l1773h: + DC 'DE,HL' + DC '(SP),HL' + DC '(SP),IX' + DC '(SP),IY' + db 0 + ;------------------------------------------------------------------------------- ; >>L [startaddr] [endaddr] ; List disassembled code cmd_L: - ld hl,cmd_L ld (cmd_rpt),hl call expr jr nc,l18dbh @@ -4670,9 +2558,8 @@ cmdl_p_line: ret p_disas_line: - call p_label call outbl2 - call out.hl.@ + call out_hl call z,outbl call outbl sub a @@ -4684,24 +2571,9 @@ p_disas_line: ld c,15 call p_goto_col - call p_offset - call outbl - jp p_symbol - + ; fall thru ;------------------------------------------------------------------------------- - -p_offset: - ld de,(var.@) - ld a,d - or e - ret z - call pstr_inl - dc '(@' - and a - sbc hl,de - call out_hl - add hl,de - jp out_rparen + ret ;------------------------------------------------------------------------------- @@ -5429,6 +3301,7 @@ p_arg_addr_ww: p_arg_ww_addr: call p_arg_ww call p_char_comma + jr p_arg_addr p_arg_a_addr: call p_A_comma @@ -5651,38 +3524,16 @@ t_BC.DE.HL.SP: 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' @@ -5705,7 +3556,7 @@ t__C_: ;------------------------------------------------------------------------------- -sub_1ffeh: +tc_set_bp: ld hl,(reg.pc) ld a,h or l @@ -5713,7 +3564,7 @@ sub_1ffeh: ld de,BDOS and a sbc hl,de - ld hl,l20edh + ld hl,l20edh ;set break after BDOS call jr z,l2031h ld iy,(reg.pc) call disas_get_instrlen @@ -5722,7 +3573,7 @@ sub_1ffeh: ld b,0 ld hl,(reg.pc) add hl,bc - call sub_09cah + call bp_trace_enter ld iy,(reg.pc) ld hl,b_2039_start call lookup_opc @@ -5731,7 +3582,7 @@ sub_1ffeh: ex de,hl l2031h: call CALL_HL - call c,sub_09cah + call c,bp_trace_enter l2037h: scf ret @@ -5757,34 +3608,31 @@ b_2048_start: dw l20dch db 0ffh,0cfh,000h ;rst 8 dw l2115h - db 0c7h,0c7h,000h ; + db 0c7h,0c7h,000h ;rst n dw l20f9h - db 0c7h,0c4h,000h ; + db 0c7h,0c4h,000h ;call cc,mn dw l2080h - db 0f7h,010h,000h ; + db 0f7h,010h,000h ;djnz d; jr d dw l2093h - db 0e7h,020h,000h ; + db 0e7h,020h,000h ;jr cc,d dw l2093h - db 0c7h,0c2h,000h ; + db 0c7h,0c2h,000h ;jp cc,mn dw l208bh - db 0c7h,0c0h,000h ; + db 0c7h,0c0h,000h ;ret cc dw l20c5h db 0 ;------------------------------------------------------------------------------- - +; call mn call cc,mn l2080h: - ld a,(b_21e2_start) - and a - jr nz,l208bh - ld a,(trace_call_flag) - and a - ret nz + +; jp mn jp cc,mn l208bh: ld l,(iy+001h) ld h,(iy+002h) scf ret + l2093h: ld c,(iy+001h) ld a,c @@ -5797,27 +3645,34 @@ l2093h: inc hl scf ret + +; jp (hl) l20a2h: ld hl,(reg.l) scf ret + +; Prefix DD l20a7h: ld hl,(reg.ix) jr l20afh +; Prefix FD l20ach: ld hl,(reg.iy) l20afh: ld a,(iy+001h) - cp 0e9h + cp 0e9h ; jp (ix); jp (iy) scf ret z and a ret + +; Prefix ED l20b8h: ld a,(iy+001h) - cp 04dh + cp 04dh ; reti jr z,l20dch - cp 045h + cp 045h ; retn jr z,l20dch and a ret @@ -5839,22 +3694,14 @@ l20d7h: jp (hl) l20dch: - ld a,(b_21e2_start) - and a - jr nz,l20edh - ld a,(trace_call_flag) - and a - jr z,l20edh - call l20edh - pop hl - ret l20edh: - ld hl,(reg_sp) + ld hl,(reg_sp) ;break on return address ld e,(hl) inc hl ld d,(hl) ex de,hl - call sub_09cah + call bp_trace_enter +l2115h: and a ret @@ -5868,16 +3715,10 @@ l20f9h: ld h,000h ld a,(b_21e2_start) and a - jr nz,l2113h - ld a,(trace_call_flag) - and a - ret nz -l2113h: + ret z + scf ret -l2115h: - and a - ret ;------------------------------------------------------------------------------- ; >>C[N][J] [steps] @@ -5885,10 +3726,6 @@ l2115h: ; >>C[N][J] U expression ; trace over Calls [No list] [Jumps only] /.While./.Until. -cmd_C: - ld hl,cmd_C - ld a,1 - jr l2122h ;------------------------------------------------------------------------------- ; >>T[N][J] [steps] @@ -5897,139 +3734,44 @@ cmd_C: ; Trace [no List] [Jumps only] / .While. / .Until. cmd_T: - xor a - ld hl,cmd_T -l2122h: ld (cmd_rpt),hl - ld (trace_call_flag),a - call get_char_upper - sub 'N' - jr nz,l212eh - inc de -l212eh: - ld (trace_N_flag),a - call get_char_upper - sub 'J' - jr nz,l2137h - inc de -l2137h: - ld (trace_J_flag),a - call sub_21a6h - jr z,l2145h - ld hl,1 + ld hl,1 ;default: 1 step call get_lastarg_def -l2145h: - ld (trace_count),hl + ld (trace_cnt_or_ptr),hl sub a - ld (l0941h),a -l214ch: - call sub_1ffeh - jr l21a3h + ld (bp_p_cpu_flag),a + call tc_set_bp + jr user_go1 l2151h: call bp_clr_temporary - ld a,(trace_J_flag) - and a - jr nz,l216bh - ld iy,(reg.pc) - call sub_21c8h - jr z,l216bh - ld hl,b_2048_start - call lookup_opc - jr nc,l214ch -l216bh: - ld a,(trace_UW_flag) - and a - jr z,l2188h - ld de,(trace_count) - call expr - ld a,h - or l - add a,0ffh - sbc a,a - ld hl,trace_UW_flag - xor (hl) - bit 1,a - jr z,l2193h -l2185h: - jp l0902h -l2188h: - ld hl,(trace_count) + ld hl,(trace_cnt_or_ptr) dec hl - ld (trace_count),hl + ld (trace_cnt_or_ptr),hl ld a,h or l - jr z,l2185h -l2193h: - call sub_1ffeh - jr nc,l2185h - ld a,(trace_N_flag) - ld b,a - ld a,(l0941h) - or b - ld (l0941h),a -l21a3h: - jp user_go - -sub_21a6h: - call skipbl - xor a - ld (trace_UW_flag),a - call get_char_upper - cp 'U' - jr z,l21b5h - cp 'W' - ret nz -l21b5h: - inc de - push af - push de - call expr - jp c,ERROR - call assert_eol - pop hl - pop af - ld (trace_UW_flag),a - sub a - ret + jp z,do_break -sub_21c8h: - ld a,(iy+000h) - cp 0edh - jr z,l21dah - and 0dfh - cp 0ddh - ret nz - ld a,(iy+001h) - cp 0e9h - ret -l21dah: - ld a,(iy+001h) - and 0f7h - cp 045h - ret + call tc_set_bp + jp nc,do_break + sbc a,a + ld (bp_p_cpu_flag),a +user_go1: + jp user_go ;------------------------------------------------------------------------------- -b_21e2_start: +con_col: db 0 -trace_call_flag: - db 0 ;1=call, 0=trace -trace_UW_flag: - db 0 ;0 or 'U' or 'W' -trace_count: - dw 0 -trace_N_flag: - db 0 ;0 if 'N' -trace_J_flag: - db 0 ;0 if 'J' ;------------------------------------------------------------------------------- -con_col: +b_21e2_start: db 0 +trace_cnt_or_ptr: + dw 0 -l0941h: +bp_p_cpu_flag: db 0 bp_tab: @@ -6039,11 +3781,6 @@ bp_tab: endm endm -expr_p1: - dw expr_buf -expr_p2: - dw expr_buf - expr_buf: current_cseg defl $ - current_cseg .phase current_phase + current_cseg @@ -6131,13 +3868,6 @@ expr_bufe: ;------------------------------------------------------------------------------- -msg_Y: - dc 'Yn' -reg_Y: - rept YREG_CNT - dw 0 - endm - last_S: dw TPA @@ -6149,30 +3879,14 @@ last_O_addr: last_O_val: db 0 -cmd_Q_jopt: - db -1 - last_D: dw TPA -cmdR_rindex: - db 0 - high_load: dw TPA max_load: dw TPA -l1262h: - dw 0 -last_A: - dw TPA -cmd_A_prev: - dw TPA - -prefix_ixiy: - db 0 - isprefix_ixiy: db 0 last_L: @@ -6185,13 +3899,6 @@ disas_argtype: pbl_loop_adr: dw 0 -symlen_cur: ;max length of symbols read so far - db 0 -cur_fcb: - dw 0 -fcbsym: - ds 33 - ddtz_size equ $-ddtz_base ddtz_end: