ack/mach/6500/libem/aar.s

37 lines
676 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Aar
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 gets the address of the array element
Aar:
stx ADDR ! address of descriptor (lowbyte)
sta ADDR+1 ! address of descriptor (highbyte)
ldy #0
lda (ADDR),y ! lowerbound (lowbyte)
tax
iny
lda (ADDR),y ! lowerbound (highbyte)
jsr Sbi2 ! index - lowerbound
jsr Push
2: ldy #4
lda (ADDR),y ! objectsize (lowbyte)
sta NBYTES
tax
iny
lda (ADDR),y ! objectsize (highbyte)
sta NBYTES+1
bne 5f
cpx #1 ! objectsize = 1 then return
bne 5f ! arrayaddress + index
jsr Pop
jmp Adi2
5: jsr Mli2 ! objectsize > 1 then return
jmp Adi2 ! arrayaddress + index * objectsize