summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo C2016-08-15 22:19:26 +0200
committerLeo C2016-08-15 22:19:26 +0200
commitb9ba3380b85ba37d1a4e91d8c4b1b7aeccdc301b (patch)
tree6adf7096c2d6f641852b92989bc1d5608665b66a
parentc9b3681ce26a30c47a312c3eeeea4f7655e94354 (diff)
downloadddt180-b9ba3380b85ba37d1a4e91d8c4b1b7aeccdc301b.zip
Correct symbol evaluation
-rw-r--r--ddt180.z8060
1 files changed, 20 insertions, 40 deletions
diff --git a/ddt180.z80 b/ddt180.z80
index 50d500e..4196861 100644
--- a/ddt180.z80
+++ b/ddt180.z80
@@ -1249,64 +1249,44 @@ error1:
fact_symbol:
push bc
- ld hl,ddtz_base
+ ld hl,ddtz_base ;symtbl start
fs_nxtsym:
ld a,(hl) ;symlen
cp 0c3h
jr z,error1
- ld b,a
+ ld b,a ;symlen
inc b
- push hl
- push de
+ push hl ;symtbl ptr
+ push de ;inpsym ptr
fs_2:
ld a,(de)
- call test_termchar
- jr z,fs_endstr
- dec b
+ djnz fs_3
+ call test_sym_char
jr z,fs_cont
+ pop hl ;inpsym ptr (discard)
+ 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
cp (hl)
jr z,fs_2
-fs_cont:
- pop de
- pop hl
+fs_cont: ;start over
+ pop de ;inpsym ptr
+ pop hl ;symtbl ptr
ld a,(hl)
add a,3
call sub_hl_a
jr fs_nxtsym
-fs_endstr:
- dec b
- jr nz,fs_cont
- pop hl
- pop hl
- inc hl
- ld a,(hl)
- inc hl
- ld h,(hl)
- ld l,a
- or a
- pop bc
- ret
-
-t_trmchrs:
- db ' !#&()*+,-/:;<=>[\]^{|}~',0
-t_trmchrs_len equ $ - t_trmchrs
-
-test_termchar:
- push hl
- push bc
- ld hl,t_trmchrs
- ld bc,t_trmchrs_len
- cpir
- pop bc
- pop hl
- ret
-
-
-
get.number:
call get.hexdigit
ret c