ack/mach/6500/libem/ldi.s

30 lines
478 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Ldi, Ldo
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
! The subroutine Ldi pushes a four byte object onto the stack.
! The address is in registerpair AX.
! If the address is already in zeropage Ldo is used.
Ldi:
stx ADDR ! address of object (lowbyte)
sta ADDR+1 ! address of object (highbyte)
Ldo:
ldy #3
1: lda (ADDR),y ! get lowbyte
pha
dey
lda (ADDR),y ! get highbyte
tax
pla
jsr Push ! do the push
dey
bpl 1b ! perform 2 times
rts