Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;===============================================================
- TokensToASCII:
- ;===============================================================
- ;Input:
- ; HL points to the start of the string
- ; DE points to where to output the ACII
- ;Outputs:
- ; A is the value of the ending byte of the string
- ; BC is the size of the string
- ; DE is not changed
- ; HL points to the ending byte of the string
- ; z flag is set
- ;===============================================================
- ld bc,0
- push de
- TextConvert:
- ld a,(hl)
- cp 4
- jr z,TextConvertEnd
- cp 3Fh
- jr z,TextConvertEnd
- cp 2Ah
- jr z,TextConvertEnd
- push hl
- push bc
- push de
- bcall(4594h)
- pop de
- pop hl
- add hl,bc
- push hl
- ld hl,848Eh
- ldir
- pop bc
- pop hl
- ld a,(hl)
- call Is_2_Byte ;see http://pastebin.com/Y4sdjN9h
- jr nz,$+3
- inc hl
- inc hl
- cp 2Ah
- jr nz,TextConvert
- TextConvertEnd:
- inc hl
- pop de
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement