ack/mach/6500/libem/adi4.s

21 lines
470 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Adi4
! This subroutine adds two fourbyte integers, which are on the stack.
! The addresses are initiated by the subroutine Addsub.
! Also the loopvariable (register X) is initiated by that routine.
! The result is pushed back onto the stack
Adi4:
jsr Addsub ! initiate addresses
clc
1: lda (ADDR+2),y ! get byte first operand
adc (ADDR),y ! add to byte second operand
sta (ADDR+2),y ! push on real stack
iny
inx
bne 1b ! do it 4 times
rts