Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MovToRamOrCreate:
- ; Expects variable name in Hl MUST HAVE OBJ type in data
- ; Returns Data pointer to variable in HL
- ; Destroys all
- push hl
- rst 20h ;move9toop1
- ;rst 10h ;find sym
- bcall(_chkfindsym)
- jr c,Create ;IF it doesnt exist create it
- ex de,hl ; save data pointer
- or b
- jr z,MTROCQexit ;If in ram Exit
- ex de,hl
- Bcall(_UnarchiveVar)
- pop hl
- jr MovToRamOrCreate
- MTROCQexit: ; restore the stack from in the middle of the routine and quit
- pop af
- ret
- Create: ; Creates a variable with the data type pointed to by pop HL \ ld a,(hl)
- pop hl
- push hl
- ld a,(hl) ; Load A with data type
- rst 20h ; load OP1 with name
- ld hl,1 ; Dont need a large space now. THO i should make the max frame size here talk to kerm
- ; This needs to be changed to the bytes that indicate the size in the recieved data packet
- bcall(_CreateVar) ; Make our variable
- ex de,hl
- ret
Advertisement
Add Comment
Please, Sign In to add comment