1984-12-17 11:03:13 +00:00
|
|
|
.define Teq
|
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 test if the value in registerpair AX is zero
|
|
|
|
! or nonzero.
|
|
|
|
! The returned value, a 1 or a 0, is in AX.
|
|
|
|
|
|
|
|
|
|
|
|
Teq:
|
|
|
|
tay
|
|
|
|
beq 1f ! A is zero
|
|
|
|
2: lda #0 ! AX is zero
|
|
|
|
tax
|
|
|
|
rts
|
|
|
|
1: txa
|
|
|
|
bne 2b ! X is zero
|
|
|
|
lda #0 ! AX is nonzero
|
|
|
|
ldx #1
|
|
|
|
rts
|
|
|
|
|
|
|
|
|