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
|
|
|
|
eor #0FFh ! one complement
|
|
|
|
sta (ADDR),y
|
|
|
|
tya
|
|
|
|
bne 1b ! do it n times
|
|
|
|
rts
|
|
|
|
|
|
|
|
|