summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-19 20:57:43 +0200
committerLeo C2016-08-19 20:57:43 +0200
commit0c461f1d8b5869c9d263dae1929c3c74c7caa6fd (patch)
tree3b92e4bb2fc96c32bd0d4c54f8da82ff3e535bd7
parent08d0db093cc0eb0d7356b4428c8521f7558304eb (diff)
downloadddt180-0c461f1d8b5869c9d263dae1929c3c74c7caa6fd.zip
Don't convert whole command line buffer to uppercase to allow case sensitive symbols.
-rw-r--r--ddt180.z80179
-rw-r--r--doc/ddtz-de.txt2
2 files changed, 83 insertions, 98 deletions
diff --git a/ddt180.z80 b/ddt180.z80
index 8418907..f9a4014 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -472,55 +472,19 @@ get_line:
ld c,BDOS_CBUF
call ddtz_bdos
call crlf
- ld de,conbuf+1
- ld a,(de)
- ld b,a
- ld c,0
- inc b
-l0162h:
- inc de
- dec b
- jr z,l0194h
- ld a,(de)
- bit 0,c
- call z,toupper
- ld (de),a
- cp ''''
- jr nz,l0162h
- push de
- dec de
- ld a,(de)
- cp ''''
- jr z,l0190h
- dec de
- ld a,(de)
- cp '^'
- jr z,l0184h
- dec de
- ld a,(de)
- cp '^'
- jr nz,l0190h
-l0184h:
- inc de
- push bc
- call sub_0303h
- pop bc
- dec de
- ld a,(de)
- cp ''''
- jr z,l0191h
-l0190h:
- inc c
-l0191h:
- pop de
- jr l0162h
-l0194h:
- xor a
- ld (de),a
- ld de,conbuf+2
+ ld hl,conbuf+1
+ ld e,(hl)
+ xor a
+ ld d,a
+ inc hl
+ ex de,hl
+ add hl,de
+ ld (hl),a
pop hl
ret
+get_char_upper:
+ ld a,(de)
toupper:
cp 'a'
ret c
@@ -532,7 +496,7 @@ toupper:
skipbl0:
inc de
skipbl:
- ld a,(de)
+ call get_char_upper
call test_whitespace
jr z,skipbl0
or a
@@ -661,7 +625,7 @@ l02f5h:
ld a,(hl)
and a
ret z
- ld a,(de)
+ call get_char_upper
cp (hl)
jr z,l0300h
inc hl
@@ -692,12 +656,12 @@ l030ch:
sub_0318h:
push bc
res 7,b
- defb 03eh
+ defb 03eh ;ld a,nn
sub_031ch:
push bc
push de
l031eh:
- ld a,(de)
+ call get_char_upper
xor (hl)
and 07fh
jr nz,l0336h
@@ -1345,13 +1309,14 @@ decnum_done:
jp ERROR
sub_060ch:
- ld a,(de)
+ call get_char_upper
cp '['
jr l0614h
get.hexdigit:
ld a,(de)
hex_digit:
+ call toupper
cp 'F'+1
l0614h:
ccf
@@ -1362,13 +1327,13 @@ l0614h:
ret
get.decdigit:
- ld a,(de)
+ call get_char_upper
l061eh:
cp '9'+1
jr l0625h
get.bindigit:
- ld a,(de)
+ call get_char_upper
cp '1'+1
l0625h:
ccf
@@ -2311,7 +2276,7 @@ l0d60h:
inc de
cp '.'
jr nz,cmds_dash
- ld a,(de)
+ call get_char_upper
or a
jr nz,l0d8ah
ret
@@ -2319,7 +2284,7 @@ cmds_dash:
jp z,assert_eol
cp '-'
jr nz,l0d8ah
- ld a,(de)
+ call get_char_upper
or a
dec hl
jr z,l0d60h
@@ -2405,7 +2370,7 @@ l0e10h:
ret
cmd_M:
- ld a,(de)
+ call get_char_upper
cp 'V'
jr nz,l0e1fh
inc de
@@ -2435,7 +2400,7 @@ cmdm_up:
ret
cmd_H:
- ld a,(de)
+ call get_char_upper
cp 'S'
jr z,p_sym_list
@@ -2519,7 +2484,7 @@ psym_e:
cmd_Q:
- ld a,(de)
+ call get_char_upper
sub 'J'
ld (cmd_Q_jopt),a
jr nz,l0e8dh
@@ -2584,7 +2549,7 @@ sub_0ed7h:
push de
push bc
l0edah:
- ld a,(de)
+ call get_char_upper
cp (hl)
jr nz,l0ee2h
inc de
@@ -2744,7 +2709,7 @@ cmd_F:
ld (hl),' '
inc hl
l0fb6h:
- ld a,(de)
+ call get_char_upper
ld (hl),a
inc hl
inc de
@@ -3354,7 +3319,7 @@ asemble_line:
call skipbl
ld hl,t_MNEMONICS
call sub_030ah
- jp nc,ERROR
+ jr nc,error4
call skipbl
push de
ld a,b
@@ -3599,13 +3564,13 @@ as.LD:
jp c,l149ch
call arg.IX_IY
jp c,l14f5h
- ld a,(de)
+ call get_char_upper
cp 'I'
jp z,l1511h
cp 'R'
jp z,l1519h
cp '('
- jp nz,ERROR
+ jr nz,error5
inc de
call arg.ww
jp c,l1528h
@@ -3627,12 +3592,14 @@ l139bh:
ld (iy+003h),h
ld c,004h
ret
+
l13aah:
- ld a,(de)
+ call get_char_upper
cp 'A'
- jp nz,ERROR
+ jr nz,error5
inc de
ld b,032h
+
as.store_3:
call assert_eol
ld (iy+000h),b
@@ -3640,6 +3607,7 @@ as.store_3:
ld (iy+002h),h
ld c,003h
ret
+
l13c2h:
cp 020h
jr z,l13d0h
@@ -3652,6 +3620,7 @@ l13c9h:
l13d0h:
ld b,022h
jr as.store_3
+
l13d4h:
ld b,a
call assert_comma
@@ -3667,10 +3636,11 @@ l13d4h:
add a,b
add a,040h
cp 076h
- jp z,ERROR
+ jr z,error60
l13ech:
ld b,a
jp as.opc.noarg
+
l13f0h:
call arg.IDX_displcmnt
jr nc,l1413h
@@ -3680,7 +3650,7 @@ l13f0h:
rlca
add a,046h
cp 076h
- jp z,ERROR
+ jr z,error60
l1400h:
ld b,a
@@ -3691,21 +3661,23 @@ l1400h:
ld (iy+000h),a
ld c,003h
ret
+
l1413h:
- ld a,(de)
+ call get_char_upper
cp 'I'
jr z,l1426h
cp 'R'
jr nz,l1432h
ld a,b
cp 007h
- jp nz,ERROR
+ jr nz,error60
ld b,05fh
jr l142eh
+
l1426h:
ld a,b
cp 007h
- jp nz,ERROR
+ jr nz,error60
ld b,057h
l142eh:
inc de
@@ -3731,15 +3703,19 @@ l144ch:
inc de
ld a,b
cp 007h
- jp nz,ERROR
+ jr nz,error60
call arg.ww
jr nc,l1466h
cp 030h
- jp nc,ERROR
+ 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
@@ -3751,7 +3727,7 @@ l1471h:
call arg.r_HL_A
jr nc,l1483h
cp 006h
- jp z,ERROR
+ jr z,error60
add a,070h
jp l1400h
@@ -3784,14 +3760,16 @@ l14b4h:
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:
- ld a,(de)
+ call get_char_upper
cp '('
jr nz,l14e8h
inc de
@@ -3803,9 +3781,11 @@ l14cch:
add a,04bh
ld b,a
jp l13c9h
+
l14e3h:
ld b,02ah
jp as.store_3
+
l14e8h:
call test_expr
call assert_eol
@@ -3815,7 +3795,7 @@ l14e8h:
jp as.store_3
l14f5h:
call assert_comma
- ld a,(de)
+ call get_char_upper
cp '('
jr nz,l1509h
inc de
@@ -3823,21 +3803,24 @@ l14f5h:
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:
- ld a,(de)
+ call get_char_upper
inc de
cp 'A'
jr z,gen.opc.ED2
@@ -3851,7 +3834,7 @@ l1528h:
ld b,a
call test_paren_close
call assert_comma
- ld a,(de)
+ call get_char_upper
cp 'A'
jr nz,error6
inc de
@@ -3874,7 +3857,7 @@ as.ADC_SBC:
jr nc,as.AND_CP_OR_SUB_XOR
call assert_comma
call arg.ww
- jp nc,ERROR
+ jr nc,error6
push af
ld a,b
cp 088h
@@ -3887,6 +3870,7 @@ l156ch:
l156eh:
ld b,a
jr gen.opc.ED2
+
as.ADD:
ld hl,t_HL.AF
call sub_0318h
@@ -3901,7 +3885,7 @@ as.ADD:
ld hl,t_BC.DE.IY.SP
l158eh:
call arg.reg_16bit
- jp nc,ERROR
+ jr nc,error6
add a,009h
l1596h:
ld b,a
@@ -3909,11 +3893,12 @@ l1596h:
l159ah:
call assert_comma
call arg.ww
- jp nc,ERROR
+error61nc:
+ jr nc,error6
add a,009h
jp l13ech
as.AND_CP_OR_SUB_XOR:
- ld a,(de)
+ call get_char_upper
cp 'A'
jr nz,l15b8h
push de
@@ -3945,7 +3930,7 @@ as.SHIFTOP:
call arg.r_HL_A
jr c,l15fah
call arg.IDX_displcmnt
- jp nc,ERROR
+ jr nc,error61nc
ld a,b
add a,006h
ld b,a
@@ -3975,7 +3960,7 @@ as.BITOP:
call arg.r_HL_A
jr c,l1624h
call arg.IDX_displcmnt
- jp nc,ERROR
+ jr nc,error61nc
ld a,l
rlca
rlca
@@ -4175,7 +4160,7 @@ l1739h:
as.EX:
ld hl,b_176d_start
call sub_030ah
- jp nc,ERROR
+ jr nc,error7
ld c,b
call assert_eol
ld b,000h
@@ -4216,7 +4201,7 @@ as.DEC_INC:
call arg.r_HL_A
jr c,l17cch
call arg.IDX_displcmnt
- jp nc,ERROR
+ jr nc,error8
ld a,b
add a,030h
jp l1400h
@@ -4271,7 +4256,7 @@ arg.j_displ:
ret
arg.addr_8bit:
- ld a,(de)
+ call get_char_upper
cp '('
jr nz,arg.imm_8bit
inc de
@@ -4355,7 +4340,7 @@ l1852h:
arg.IDX_displcmnt:
push hl
push bc
- ld a,(de)
+ call get_char_upper
cp '('
jr nz,l18a1h
push de
@@ -4370,14 +4355,14 @@ arg.IDX_displcmnt:
ld a,0fdh
l186eh:
ld (prefix_ixiy),a
- ld a,(de)
+ call get_char_upper
cp '+'
jr z,l1882h
cp ')'
ld hl,0
jr z,l189ah
cp '-'
- jp nz,ERROR
+ jr nz,error9
l1882h:
push af
inc de
@@ -4391,9 +4376,9 @@ l1882h:
and a
sbc hl,bc
l1894h:
- ld a,(de)
+ call get_char_upper
cp ')'
- jp nz,ERROR
+ jr nz,error9
l189ah:
inc de
pop bc
@@ -4433,13 +4418,13 @@ l18b1h:
assert_comma:
call next_arg
ret z
-l18c2h:
+error9:
jp ERROR
test_paren_close:
- ld a,(de)
+ call get_char_upper
cp ')'
- jr nz,l18c2h
+ jr nz,error9
inc de
ret
@@ -5678,13 +5663,13 @@ cmd_T:
l2122h:
ld (cmd_rpt),hl
ld (trace_call_flag),a
- ld a,(de)
+ call get_char_upper
sub 'N'
jr nz,l212eh
inc de
l212eh:
ld (trace_N_flag),a
- ld a,(de)
+ call get_char_upper
sub 'J'
jr nz,l2137h
inc de
@@ -5751,7 +5736,7 @@ sub_21a6h:
call skipbl
xor a
ld (trace_UW_flag),a
- ld a,(de)
+ call get_char_upper
cp 'U'
jr z,l21b5h
cp 'W'
diff --git a/doc/ddtz-de.txt b/doc/ddtz-de.txt
index b38d780..1e72866 100644
--- a/doc/ddtz-de.txt
+++ b/doc/ddtz-de.txt
@@ -352,7 +352,7 @@
C[N][J] U ausdruck
------------------
- Tracen ueber CALLs [ohne Ausgabe] [nue Sprungbefehle]
+ Tracen ueber CALLs [ohne Ausgabe] [nur Sprungbefehle]
/ ..solange.. / ..bis..
(trace over CALLs [No list] [Jumps only] /..While../..Until..