ack/mach/6500/libem/com.s

27 lines
440 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Com
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 performs a one complement on
! a group of atmost 254 bytes (number in register Y).
! This group is on the top of the stack.
Com:
lda SP+1
sta ADDR+1 ! address (highbyte) of first byte
lda SP+2
sta ADDR ! address (lowbyte) of first byte
1: dey
lda (ADDR),y
1988-08-19 17:05:03 +00:00
eor #0x0FF ! one complement
1984-12-17 11:03:13 +00:00
sta (ADDR),y
tya
bne 1b ! do it n times
rts