Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rst rMov9ToOP1 ; rst 10h ; D7 ;This copies the name at HL to OP1
- bcall(_ChkFindSym) ; bcall(42F1h) ; EFF142 ;Searches for the variable
- ret c ; ; D8 ;Exits if the variable was not found
- ld a,b ; ; 78 ;A is now the flash page
- or a ; ; B7 ;Test if A=0 (means in RAM)
- ret nz ; ; C0 ;Exit if the variable is in archive
- ex de,hl ; ; EB ;Now HL points to the size bytes
- ld c,(hl) ; ; 4E ;C is the LSB of the size of the var
- inc hl ; ; 23 ;HL points to the next sizebyte
- ld b,(hl) ; ; 46 ;Now B is the MSB, making BC the size of the variable
- inc hl ; ; ;HL now points to the data
- ;Now you can edit the data and know if you are out of bounds. Also, if the data is less than 127 bytes (like for save data), you can do this:
- push hl
- pop ix
- ;Now IX points to the data, and if you want to read or write to a byte, you can do ld (ix+3),33h, for example.
Add Comment
Please, Sign In to add comment