ack/mach/6500/libem/asp.s

26 lines
459 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Asp
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 adds an offset to the stackpointer,
! e.g. after the return from a procedurecall.
! The offset is in registerpair AX, and is added to the
! stackpointer.
Asp:
tay ! save A
txa ! get X
clc
adc SP+2 ! add adjustment (lowbyte)
sta SP+2 ! new stackpointer (lowbyte)
tya ! get A
adc SP+1 ! add adjustment (highbyte)
sta SP+1 ! get stackpointer (highbyte)
rts