Instruction Set ArchitectureIP2022 Users Manual
132
www.ubicom.com
CSNE W,#lit8
Compare W,Literal then Skip if Not Equal
Operation:
lit8 - W; if result is not zero, skip next instruction
Bits affected:
None
Opcode:
0111 0110 kkkk kkkk
Description:
This instruction subtracts the contents of W from
an 8-bit literal and discards the result. W is left
unchanged. If the result is nonzero (i.e. W and the
literal are not equal), the following instruction is
skipped. The STATUS register bits are not
updated.
Cycles:
1
Example:
csne w,#0x1B;compare W against
;escape char.
jmp escape_char;if equal, jump
;to escape_char
jmp normal_char;else, jump to
;normal_char
This example compares the contents of W with
the ASCII code for the escape character. If W
holds 0x1B, then the escape_char routine is