Geekboy

Untitled

Jan 16th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MovToRamOrCreate:
  2. ; Expects variable name in Hl  MUST HAVE OBJ type in data
  3. ; Returns Data pointer to variable in HL
  4. ; Destroys all
  5.  push hl
  6.   rst 20h        ;move9toop1
  7.   ;rst 10h        ;find sym
  8.   bcall(_chkfindsym)
  9.   jr c,Create            ;IF it doesnt exist create it
  10.   ex de,hl    ; save data pointer
  11.   or b
  12.   jr z,MTROCQexit   ;If in ram Exit
  13.   ex de,hl
  14.  Bcall(_UnarchiveVar)
  15.  pop hl
  16.  jr MovToRamOrCreate
  17. MTROCQexit:   ; restore the stack from in the middle of the routine and quit
  18.  pop af
  19.  ret
  20. Create: ; Creates a variable with the data type pointed to by pop HL \ ld a,(hl)
  21.  pop hl
  22.  push hl
  23.  ld a,(hl)   ; Load A with data type
  24.  rst 20h     ; load OP1 with name
  25.  ld hl,1     ; Dont need a large space now. THO i should make the max frame size here talk to kerm
  26.              ; This needs to be changed to the bytes that indicate the size in the recieved data packet
  27.  bcall(_CreateVar) ; Make our variable
  28.  ex de,hl
  29.  ret
Advertisement
Add Comment
Please, Sign In to add comment