summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-26 10:42:31 +0200
committerLeo C2016-08-26 10:42:31 +0200
commit9711a4302976b629c287d08960680cc1cfa60980 (patch)
tree3e2957061148e8b57224495063f899daada08dbe
parentec12f2535a9763717fd7aa251a065878251960e0 (diff)
downloadddt180-0.4.zip
Add some commentsv0.4
-rw-r--r--Makefile2
-rw-r--r--ddt180.z80194
2 files changed, 194 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index bdfc336..44b6c27 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ endif
version.inc: autorevision.cache
- @echo update $@
+ @echo update $@ to $(VERS)
@printf "defvers macro\r\n\
db '$(VERS)'\r\n\
endm\r\n\032" > $@
diff --git a/ddt180.z80 b/ddt180.z80
index 122748d..c4c38a7 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -138,6 +138,8 @@ var.@: dw 0
error_func:dw p_msg_error
cmd_rpt:dw mainloop
+;-------------------------------------------------------------------------------
+
conbuf:
db CONBUF_SIZE
@@ -181,6 +183,8 @@ l0093h:
ds CONBUF_SIZE + 3 - ($ - conbuf)
+;-------------------------------------------------------------------------------
+
CMDTAB:
dw cmd_@ ;examine/substitute the displacement register @
dw cmd_A ;Assemble
@@ -249,6 +253,8 @@ exe_hl:
call CALL_HL
jr mainloop
+;-------------------------------------------------------------------------------
+
p_msg_error:
call pstr_inl
dc '?'
@@ -460,7 +466,7 @@ p_goto_col:
call outbl
jr p_goto_col
-
+;-------------------------------------------------------------------------------
inchar:
push ix
@@ -498,6 +504,8 @@ get_line:
pop hl
ret
+;-------------------------------------------------------------------------------
+
get_char_upper:
ld a,(de)
toupper:
@@ -518,6 +526,8 @@ tolower:
or 020h
ret
+;-------------------------------------------------------------------------------
+
skipbl0:
inc de
skipbl:
@@ -542,6 +552,8 @@ assert_eol:
to_error:
jp ERROR
+;-------------------------------------------------------------------------------
+
chk_stack:
push hl
push de
@@ -554,6 +566,8 @@ chk_stack:
jr c,to_error
ret
+;-------------------------------------------------------------------------------
+
add_hl_a:
add a,l
ld l,a
@@ -578,6 +592,8 @@ sub_hl_a:
pop bc
ret
+;-------------------------------------------------------------------------------
+
sym_getname:
push de
push hl
@@ -644,6 +660,8 @@ pl_e:
pop hl
ret
+;-------------------------------------------------------------------------------
+
lookupch:
ld b,0
l02f5h:
@@ -826,6 +844,8 @@ l03b8h:
scf
ret
+;-------------------------------------------------------------------------------
+
expr:
call skipbl
expr1:
@@ -845,6 +865,8 @@ expr1:
pop de
ret
+;-------------------------------------------------------------------------------
+
do_op_eq:
jr z,l03edh
jr l03ech
@@ -1074,6 +1096,8 @@ tblf_opa:
dw doop_xor
dw 0
+;-------------------------------------------------------------------------------
+
fact_factor:
call do_factor
ret nc
@@ -1127,6 +1151,8 @@ do_factor:
scf
ret
+;-------------------------------------------------------------------------------
+
fact_reg.Y:
call get.decdigit
jr c,error1
@@ -1279,6 +1305,8 @@ fs_cont_1:
call sub_hl_a
jr fs_nxtsym
+;-------------------------------------------------------------------------------
+
get.number:
call get.hexdigit
ret c
@@ -1385,6 +1413,8 @@ l0625h:
sub '0'
ret
+;-------------------------------------------------------------------------------
+
p_cpustat0:
call assert_eol
p_cpustat:
@@ -1531,6 +1561,10 @@ b_0709_start:
db 000h
db 000h
+;-------------------------------------------------------------------------------
+; > G [startaddr] [;breakp..]
+; Go [to start] [with temporary breakpoints]
+
cmd_G:
sub a
ld (trace_call_flag),a
@@ -1548,6 +1582,7 @@ l0740h:
call bp_enter
jp user_go
+;-------------------------------------------------------------------------------
bpl_init:
ld b,BP_CNT
@@ -1579,6 +1614,19 @@ bp_clr_temporary:
call bpl_next
ret
+;-------------------------------------------------------------------------------
+; > B
+; display all breakpoints
+; > B breakp [breakp..]
+; set breakpoints
+; > BX
+; clear all breakpoints
+; > BX address [address..]
+; clear breakpoints
+;
+; where breakp is:
+; [R] expression [I condition]
+
cmd_B:
call skipbl
jr z,bp_print
@@ -1658,6 +1706,7 @@ bp_pr_cont:
call bpl_next
ret
+;-------------------------------------------------------------------------------
; Add break points to list
; A = 1 Permanent (B command)
; A = 2 Temporary (G command)
@@ -1753,6 +1802,8 @@ bp_get_condition:
ld hl,(expr_p2)
ret
+;-------------------------------------------------------------------------------
+
bpddtz:
ld (reg.l),hl
pop hl
@@ -1939,6 +1990,8 @@ l0a1dh:
call bpl_next
ret
+;-------------------------------------------------------------------------------
+
user_go:
sub a
ld (b_21e2_start),a
@@ -1972,6 +2025,8 @@ l0a41h:
ld sp,(reg_sp)
jp reg.iff
+;-------------------------------------------------------------------------------
+
bp_clr_condition:
ld a,(ix+000h)
and 003h
@@ -2024,6 +2079,12 @@ l0ab0h:
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
@@ -2072,6 +2133,14 @@ sub_0bdch:
ld c,003h
jp l0c33h
+;-------------------------------------------------------------------------------
+; > X
+; eXamine (display) all cpu registers and
+; the instruction at the current program counter
+; > X register
+; eXamine (and substitute) a register
+
+
cmd_X:
call skipbl
call sub_0caeh
@@ -2301,6 +2370,10 @@ b_0cfa_start:
db 000h
dw reg.f
+;-------------------------------------------------------------------------------
+; > S [startaddr]
+; Substitute memory
+
cmd_S:
ld hl,(last_S)
call get_lastarg_def
@@ -2337,6 +2410,10 @@ l0d8ah:
call sub_0ef8h
jr l0d60h
+;-------------------------------------------------------------------------------
+; > @
+; examine (substitute) displacement register @
+
cmd_@:
call assert_eol
ld hl,msg_@
@@ -2347,6 +2424,10 @@ cmd_@:
msg_@:
dc '@'
+;-------------------------------------------------------------------------------
+; >>I [port]
+; Input a byte from port
+
cmd_I:
ld hl,cmd_I
ld (cmd_rpt),hl
@@ -2363,6 +2444,10 @@ cmd_I:
call out.bin.b
jp crlf
+;-------------------------------------------------------------------------------
+; >>O [byte] [port]
+; Output a byte to a port
+
cmd_O:
ld hl,cmd_O
ld (cmd_rpt),hl
@@ -2381,6 +2466,10 @@ cmd_O:
out (c),a
ret
+;-------------------------------------------------------------------------------
+; > Vstartaddr endaddr targetaddr
+; Verify (compare) two memory areas
+
cmd_V:
call sub_034eh
l0dedh:
@@ -2412,6 +2501,10 @@ l0e10h:
jr nz,l0dedh
ret
+;-------------------------------------------------------------------------------
+; > M[V] startaddr endaddr destaddr
+; Move memory [and verify]
+
cmd_M:
call get_char_upper
cp 'V'
@@ -2442,6 +2535,17 @@ cmdm_up:
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'
@@ -2526,6 +2630,10 @@ psym_e:
jp crlf
+;-------------------------------------------------------------------------------
+; > Q[J] startaddr endaddr bytes
+; Query memory for a byte string [Justified]
+
cmd_Q:
call get_char_upper
sub 'J'
@@ -2565,6 +2673,10 @@ l0eb0h:
pop bc
ret
+;-------------------------------------------------------------------------------
+; > Z startaddr endaddr bytes
+; Zap (fill) memory with a byte string
+
cmd_Z:
call get_arg_range
push bc
@@ -2678,6 +2790,10 @@ l0f42h:
ld (last_S),hl
ret
+;-------------------------------------------------------------------------------
+; >>D [startaddr] [endaddr]
+; Display memory in hex and ASCII
+
cmd_D:
ld hl,cmd_D
ld (cmd_rpt),hl
@@ -2746,6 +2862,10 @@ l0fach:
ld a,'.'
ret
+;-------------------------------------------------------------------------------
+; > Fcommandline
+; specifiy filenames and command line
+
cmd_F:
push de
ld hl,DMA_BUF+1
@@ -2875,6 +2995,8 @@ sub_1043h:
cp ','
ret
+;-------------------------------------------------------------------------------
+
setup_fcb:
push de
ld hl,12
@@ -2891,6 +3013,8 @@ l1052h:
pop de
ret
+;-------------------------------------------------------------------------------
+
file_open:
ld (cur_fcb),de
call setup_fcb
@@ -3014,6 +3138,10 @@ read_hexbyte0:
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
@@ -3247,6 +3375,8 @@ test_whitespace:
cp TAB
ret
+;-------------------------------------------------------------------------------
+
p_max_high0:
call assert_eol
p_max_high:
@@ -3264,6 +3394,10 @@ p_max_high:
call out_hl
jp crlf
+;-------------------------------------------------------------------------------
+; > Wstartaddr endaddr
+; Write a file to disk
+
cmd_W:
call get_arg_range
call assert_eol
@@ -3325,6 +3459,10 @@ close_file:
ld c,BDOS_CLOSE
jp ddtz_bdos
+;-------------------------------------------------------------------------------
+; > A [startaddr]
+; Assemble Zilog Z180 mnemonics
+
cmd_A:
ld hl,(last_A)
call get_lastarg_def
@@ -3394,6 +3532,8 @@ asemble_line:
CALL_HL:
jp (hl)
+;-------------------------------------------------------------------------------
+
b_1289_start:
dw as.ADC_SBC ;ADC
db 088h ;
@@ -3551,6 +3691,8 @@ b_1289_start:
dw as.TSTIO ;TSTIO
db 074h ;
+;-------------------------------------------------------------------------------
+
as.TST:
call arg.r_HL_A ;
jr nc,as.tst_0
@@ -4484,6 +4626,10 @@ test_paren_close:
inc de
ret
+;-------------------------------------------------------------------------------
+; >>L [startaddr] [endaddr]
+; List disassembled code
+
cmd_L:
ld hl,cmd_L
ld (cmd_rpt),hl
@@ -4517,6 +4663,8 @@ l190fh:
jr c,l190fh
ret
+;-------------------------------------------------------------------------------
+
cmdl_p_line:
push hl
call p_disas_line
@@ -4547,6 +4695,8 @@ p_disas_line:
call outbl
jp p_symbol
+;-------------------------------------------------------------------------------
+
p_offset:
ld de,(var.@)
ld a,d
@@ -4560,6 +4710,8 @@ p_offset:
add hl,de
jp out_rparen
+;-------------------------------------------------------------------------------
+
p_disas_instr:
sub a
ld (disas_argtype),a
@@ -4619,6 +4771,8 @@ l19b1h:
scf
ret
+;-------------------------------------------------------------------------------
+
disas_pfx.DDFD:
inc iy
ld hl,b_19ef_start
@@ -4645,6 +4799,7 @@ l19edh:
and a
ret
+;-------------------------------------------------------------------------------
; DD/FD 3 byte (ix+d)/(iy+d)
b_19ef_start:
db 034h
@@ -4692,6 +4847,8 @@ l1a0ah:
db 0f9h
db 0
+;-------------------------------------------------------------------------------
+
disas_pfx.ED:
inc iy
ld hl,b_1bc9_start
@@ -4712,6 +4869,8 @@ disas_pfx.ED:
ld b,4
ret
+;-------------------------------------------------------------------------------
+
disas_pfx.CB:
push iy
inc iy
@@ -4726,6 +4885,8 @@ l1a42h:
ld b,2
ret
+;-------------------------------------------------------------------------------
+
disas_nopfx:
ld hl,b_1b54_start
call lookup_opc
@@ -4745,6 +4906,8 @@ disas_nopfx:
ld b,3
ret
+;-------------------------------------------------------------------------------
+
sub_1a72h:
ld a,(hl)
cp 0ffh
@@ -4800,6 +4963,7 @@ get_mnemonic:
scf
ret
+;-------------------------------------------------------------------------------
; 1 byte opcodes (no parameters)
; Format: db opcode, t_MNEMONICS-index
b_1ab6_start:
@@ -5053,6 +5217,8 @@ b_1c55_start:
dw p_arg_bitop
db 0
+;-------------------------------------------------------------------------------
+
p_arg_r_r:
call p_arg_r
call p_char_comma
@@ -5389,6 +5555,8 @@ p_arg:
call sel_dc_string
jp pstr
+;-------------------------------------------------------------------------------
+
t_MNEMONICS:
DC 'ADC'
DC 'ADD'
@@ -5540,6 +5708,8 @@ t__C_:
DC '(C)'
DB 0
+;-------------------------------------------------------------------------------
+
sub_1ffeh:
ld hl,(reg.pc)
ld a,h
@@ -5571,6 +5741,8 @@ l2037h:
scf
ret
+;-------------------------------------------------------------------------------
+
b_2039_start:
db 0ffh,0ddh,000h ;Prefix DD
dw l20a7h
@@ -5604,6 +5776,8 @@ b_2048_start:
dw l20c5h
db 0
+;-------------------------------------------------------------------------------
+
l2080h:
ld a,(b_21e2_start)
and a
@@ -5709,10 +5883,24 @@ l2113h:
l2115h:
and a
ret
+
+;-------------------------------------------------------------------------------
+; >>C[N][J] [steps]
+; >>C[N][J] W expression
+; >>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]
+; >>T[N][J] W expression
+; >>T[N][J] U expression
+; Trace [no List] [Jumps only] / .While. / .Until.
+
cmd_T:
xor a
ld hl,cmd_T
@@ -5826,6 +6014,8 @@ l21dah:
cp 045h
ret
+;-------------------------------------------------------------------------------
+
b_21e2_start:
db 0
trace_call_flag:
@@ -5944,6 +6134,8 @@ current_cseg defl $
ds EXPR_BUF_SIZE - ($ - expr_buf)
expr_bufe:
+;-------------------------------------------------------------------------------
+
msg_Y:
dc 'Yn'
reg_Y: