Guest User

Untitled

a guest
Nov 29th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.      rst rMov9ToOP1     ; rst 10h      ; D7      ;This copies the name at HL to OP1
  2.      bcall(_ChkFindSym) ; bcall(42F1h) ; EFF142  ;Searches for the variable
  3.      ret c              ;              ; D8      ;Exits if the variable was not found
  4.      ld a,b             ;              ; 78      ;A is now the flash page
  5.      or a               ;              ; B7      ;Test if A=0 (means in RAM)
  6.      ret nz             ;              ; C0      ;Exit if the variable is in archive
  7.      ex de,hl           ;              ; EB      ;Now HL points to the size bytes
  8.      ld c,(hl)          ;              ; 4E      ;C is the LSB of the size of the var
  9.      inc hl             ;              ; 23      ;HL points to the next sizebyte
  10.      ld b,(hl)          ;              ; 46      ;Now B is the MSB, making BC the size of the variable
  11.      inc hl             ;              ;         ;HL now points to the data
  12. ;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:
  13.      push hl
  14.      pop ix
  15. ;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