© 2000 Scenix Semiconductor, Inc. All rights reserved.
SX Users Manual Rev. 3.1
Chapter 3 Instruction Set
3.6.54 TEST fr
Test fr for Zero
fr = fr
0010 001f ffff
This instruction moves the contents of the specified file register into the same reg-
ister. There is no net effect except to set or clear the Z bit. If the register contains
00h, the bit is set. Otherwise, the bit is cleared. If the TEST operation is performed
on the RTCC register, the RTCC prescaler will be initialized to 0. If the prescaler is
about to expire causing the RTCC to increment and the TEST instruction is execut-
ed, the RTCC will not increment.
;test file register 1Bh
;test Z bit and skip if set
;increment file reg 1Bh if nonzero
;move file reg 1Bh to W
This example tests the contents of file register 1Bh. The test instruction sets or
clears the Z bit based on the contents of the file register. The sb instruction tests
the Z bit. The inc instruction is executed if the file register contains zero or is
skipped if the file register contains a nonzero value.