ack/mach/6500/libem/teq.s
1987-01-30 18:41:42 +00:00

26 lines
335 B
ArmAsm

.define Teq
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! 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