X-Git-Url: http://cloudbase.mooo.com/gitweb/ddt180.git/blobdiff_plain/ca1c9c55bf9f5453368770a8ae137bcb732f96aa..27a5c416cf4ea0b19a9deeaa7ccc0b436b894bca:/ddt180.z80 diff --git a/ddt180.z80 b/ddt180.z80 index dbcebc8..5b7e081 100644 --- a/ddt180.z80 +++ b/ddt180.z80 @@ -63,7 +63,6 @@ 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) ;------------------------------------------------------------------------------- @@ -121,9 +120,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 ;------------------------------------------------------------------------------- @@ -134,9 +131,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: @@ -173,7 +168,7 @@ l0093h: ;------------------------------------------------------------------------------- CMDTAB: - dw cmd_@ ;examine/substitute the displacement register @ + 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 @@ -198,13 +193,16 @@ CMDTAB: dw cmd_V ;Verify (compare) two memory areas dw 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 @@ -232,48 +230,22 @@ mainloop: inc hl ld h,(hl) ld l,a - jr exe_hl -ERROR: - ld hl,(error_func) exe_hl: call CALL_HL jr mainloop ;------------------------------------------------------------------------------- -p_msg_error: - call pstr_inl - dc '?' - ;fall thru crlf: call pstr_inl - db CR,LF+80h + dc CR,LF call inchar ld a,0 ld (con_col),a 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 '-' @@ -563,10 +535,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) @@ -577,10 +545,6 @@ l030ch: res 7,b ret -sub_0318h: - push bc - res 7,b - defb 03eh ;ld a,nn sub_031ch: push bc push de @@ -994,9 +958,6 @@ do_factor: ld hl,TPA cp 'L' ret z - ld hl,(var.@) - cp '@' - ret z ld hl,(var.$) cp '$' ret z @@ -1011,8 +972,6 @@ 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 '[' @@ -1025,21 +984,6 @@ do_factor: ;------------------------------------------------------------------------------- -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: @@ -1245,6 +1189,7 @@ p_cpustat: l063eh: call p_regs djnz l063eh + call outbl6 push hl push de ld iy,(reg.pc) @@ -1261,8 +1206,6 @@ l065bh: djnz l065bh pop af pop hl - call nz,outbl6 - call nz,p_offset jp crlf p_f: @@ -1319,12 +1262,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: @@ -1505,7 +1442,7 @@ l07cdh: call outbl ld l,(ix+002h) ld h,(ix+003h) - call out.hl.@ + call out_hl call pstr_inl dc ' :' ld l,(ix+004h) @@ -1903,45 +1840,6 @@ l0ab0h: ; > 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 outbl4 - pop af - inc a - bit 0,a - push af - call z,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 @@ -1968,7 +1866,7 @@ cmd_X: call sel_dc_string l0c12h: call l0c33h -l0c15h: + call outbl push de push bc @@ -2002,9 +1900,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 @@ -2187,7 +2083,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 @@ -2222,15 +2118,7 @@ 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] @@ -2287,7 +2175,7 @@ l0dedh: cp b jr z,l0e10h ld c,a - call out.hl.@ + call out_hl call outbl ld a,b call out_hex @@ -2296,7 +2184,7 @@ l0dedh: call out_hex call outbl ex de,hl - call out.hl.@ + call out_hl ex de,hl call crlf l0e10h: @@ -2564,7 +2452,7 @@ sub_0f58h: push hl push af l0f5ch: - call out.hl.@ + call out_hl call z,outbl2 call outbl ld de,0 @@ -2947,15 +2835,6 @@ rdhex_done: pop hl jp p_max_high - -test_numeral: - cp '9' - ret z - ccf - ret c - cp '0' - ret - test_whitespace: cp ' ' ret z @@ -3122,7 +3001,7 @@ cmdl_p_line: p_disas_line: call outbl2 - call out.hl.@ + call out_hl call z,outbl call outbl sub a @@ -3136,19 +3015,7 @@ p_disas_line: call p_goto_col ; 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 ;------------------------------------------------------------------------------- @@ -4564,13 +4431,6 @@ expr_bufe: ;------------------------------------------------------------------------------- -msg_Y: - dc 'Yn' -reg_Y: - rept YREG_CNT - dw 0 - endm - last_S: dw TPA