Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _GetTokStrng = 4594h
- _CreateTempString=4324h
- _OP4ToOP1=4138h
- _StoAns=4ABFh
- ;EFD74AD604C02AEC86772C772CEB4E234623
- ;E5C5D5EF9445218E84D1CDD89D2AEC860922EC86C1E1EDA1EAA79D
- ;2AEC86E5EF2443E1131321EE86EDB0EF3841EFBF4AC9
- ;010000
- ;03F57E23
- ;FE2020043E291829
- ;FE2820043E101821
- ;D641FE1B3004C6411817
- ;D620FE1A3804C661180D
- ;13FE0D3FCEB0F5033EBB1213F1
- ;1213F13D20C6C9
- bcall(_RclAns)
- sub 4
- ret nz
- ld hl,(saveSScreen)
- ld (hl),a
- inc l
- ld (hl),a
- inc l
- ex de,hl
- ld c,(hl)
- inc hl
- ld b,(hl)
- inc hl
- detokloop:
- push hl ;points to instr
- push bc ;size of instr
- push de ;points to outstr
- bcall(_GetTokStrng)
- ld hl,OP3
- pop de
- call ASCIIToTok
- ld hl,(saveSScreen)
- add hl,bc
- ld (saveSScreen),hl
- pop de
- ld hl,OP3
- ldir
- pop bc
- pop hl
- cpi
- jp pe,detokloop
- ;;now make the new string
- ld hl,(saveSScreen)
- push hl
- bcall(_CreateTempString)
- pop hl
- inc de
- inc de
- ld hl,saveSScreen+2
- ldir
- bcall(_OP4ToOP1)
- bcall(_StoAns)
- ret
- ASCIIToTok:
- ;;HL points to ASCII string
- ;;A is the size
- ;;DE is where to write
- ;;Out: DE updated, BC is the new size
- ld bc,0
- loop:
- inc bc
- push af
- ld a,(hl)
- inc hl
- cp 20h \ jr nz,$+6 \ ld a,29h \ jr tokout
- cp 28h \ jr nz,$+6 \ ld a,10h \ jr tokout
- sub 41h
- cp 27 \ jr nc,$+6 \ add a,41h \ jr tokout
- sub 20h
- cp 26 \ jr c,$+6 \ add a,61h \ jr tokout
- inc de
- cp 13
- ccf
- adc a,$B0
- push af
- inc bc
- ld a,$BB
- ld (de),a
- inc de
- pop af
- tokout:
- ld (de),a
- inc de
- pop af
- dec a
- jr nz,loop
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement