ack/mach/6500/libem/adi.s

23 lines
424 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Adi2
! This subroutine adds two twobyte integers.
! The first operand is on the top of the stack, the second operand
! is in the AX registerpair.
! The result is returned in registerpair AX.
Adi2:
sta ARTH+1 ! second operand (highbyte)
stx ARTH ! second operand (lowbyte)
jsr Pop ! get first operand
pha ! save A
clc
txa
adc ARTH ! add lowbytes
tax
pla ! get A
adc ARTH+1 ! add the highbytes
rts