ack/mach/6500/libem/addsub.s

33 lines
642 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Addsub
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 is used by the fourbyte addition and subtraction
! routines.
! It puts the address of the second operand into
! the zeropage locations ADDR and ADDR+1
! The address of the first operand is put into
! zeropage locations ADDR+2 and ADDR+3.
Addsub:
clc
lda SP+2
sta ADDR ! address of second operand (lowbyte)
adc #4
sta SP+2
sta ADDR+2 ! address of first operand (lowbyte)
lda SP+1
sta ADDR+1 ! address of second operand (highbyte)
adc #0
sta ADDR+3 ! address of first operand (highbyte)
sta SP+1
ldy #0
1988-08-19 17:05:03 +00:00
ldx #0x0FC ! do it 4 times
1984-12-17 11:03:13 +00:00
rts