ack/mach/6500/libem/ngi4.s

36 lines
445 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Ngi4
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 takes a fourbyte interger and negates it.
! For more details see ngi2.s
Ngi4:
sta ADDR+1
stx ADDR
ldy #3
1: lda (ADDR),y
1988-08-19 17:05:03 +00:00
eor #0x0FF ! one's complement lowbyte+y
1984-12-17 11:03:13 +00:00
sta (ADDR),y
dey
bpl 1b
1988-08-19 17:05:03 +00:00
ldx #0x0FD
1984-12-17 11:03:13 +00:00
iny
clc
lda (ADDR),y
adc #1
sta (ADDR),y ! lowbyte+y
1: iny
lda (ADDR),y
adc #0
sta (ADDR),y ! (lowbyte+y)+0
inx
bne 1b
rts