ack/mach/6500/libem/lxl.s

31 lines
509 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Lxl
1987-01-30 18:41:42 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1984-12-17 11:03:13 +00:00
! This subroutine loads LB n (255 => n > 0) static levels back.
Lxl:
lda LB
sta ADDR ! address of localbase (lowbyte)
lda LB+1
sta ADDR+1 ! address of localbase (highbyte)
1: ldy #2
lda (ADDR),y ! get localbase (lowbyte) 1 level back
pha
iny
lda (ADDR),y ! get localbase (highbyte) 1 level back
sta ADDR+1 ! new localbase (highbyte)
pla
sta ADDR ! new localbase (lowbyte)
dex
bne 1b ! n levels
tax
lda ADDR+1
rts