[A83] Re: GetTokString rom call
[Prev][Next][Index][Thread]
[A83] Re: GetTokString rom call
Hm weird.. I didn't know the parentheses were stored as separate tokens. Ah
well. An idea for optimization:
ConvertToASCII:
Loop2:
ld a,(hl)
or a
ret z
push hl
B_CALL GetTokString
ld hl,OP3
B_CALL VPutS
pop hl
ld a,(hl)
inc hl
cp 0bbh
jr nz,SkipIncHL
inc hl
SkipIncHL:
cp 5ch
jr c,Loop2
cp 63h
jr nc,Loop2
inc hl
jr Loop2
-----Original Message-----
From: assembly-83-bounce@lists.ticalc.org
[mailto:assembly-83-bounce@lists.ticalc.org]On Behalf Of Thomas Lutz
Sent: Friday, June 29, 2001 12:02 PM
To: assembly-83@lists.ticalc.org
Subject: [A83] Re: GetTokString rom call
> Oops, also, I think that if you use GetTokString separately, you will not
> get properly formatted output, something more like
> rad()x or something... I think there's a call to untokenize a whole
> equation.
I think this block of code actually does the trick....It works exactly like
VPutS except it will display equations perfectly (I hope). I haven't found
any bugs yet. It keeps displaying until it reaches null. Thanks for you
help!
;HL - pointer to input string data
ConvertToASCII:
Loop2:
ld a,(hl)
cp 0
ret z
push hl
B_CALL GetTokString
ld hl,OP3
B_CALL VPutS
pop hl
ld a,(hl)
inc hl
cp 0bbh
call z,IncHL
cp 5ch
jr c,Loop2
cp 63h
jr nc,Loop2
inc hl
jr Loop2
IncHL:
inc hl
ret
Follow-Ups:
References: