WHOA, Kerm wrong, I never thought I'd see the day, wow.
Well, either way, I will try and figure it out.
Well, either way, I will try and figure it out.
|
...whatever headers you use...
bcall(_clrlcdfull)
bcall(_homeup)
ld hl,$0201
push hl
ld h,0
bcall(_disphl)
bcall(_newline)
pop hl
ld a,h
ld l,a
ld h,0
bcall(_disphl)
bcall(_getkey)
ret
ld hl,$0201
bcall(_getkey)
ret
MyVar .equ SafeRAM
Var:
.db 0
ld a,(VAR) ;it now works just like a regular ram variable
Bank .equ AppBackUpScreen
Bet .equ AppBackUpScreen+2 ;this is two bytes greater
;because we will make Bank and Bet 2byte variables
ld hl,$1000
ld (Bank),hl
ld hl,0
ld (Bet),hl
;now AppBackUpScreen=$00,App...+1=$10,and +2,+3 both equal 0
ld hl,$1000
ld (Bank),hl
ld hl,0
ld (Bet),hl
;now at the address of ram in your code these are assigned to are the same as above. Notice how hl is loaded into ram. It flips around and L is loaded into the first byte and h, the second
Bank:
.db 0
Bet:
.db 0
Bank .equ AppBackUpScreen ;essentially creates var "Bank"
Bet .equ AppBackUpScreen+2 ;creates var "bet"
ld hl,$1000 ; stores address $1000 to hl
ld (Bank),hl ; stores value of hl into "bank"
ld hl,0 ; Stores 0 to hl
ld (Bet),hl ; stores value of hl to "bet"
Advertisement