© 2000 Scenix Semiconductor, Inc. All rights reserved. - 47 - www.scenix.com SX48BD/SX52BD/SX52BD75/SX52BD100 Bitwise Operations CLRB fr.bit Clear Bit in fr (fr.bit = 0) 1 0100 bbbf ffff none SB fr.bit Test Bit in fr and Skip if Set (test fr.bit and skip next instruction if bit is 1) 1 or 2 (skip) 0111 bbbf ffff none SETB fr.bit Set Bit in fr (fr.bit = 1) 1 0101 bbbf ffff none SNB fr.bit Test Bit in fr and Skip if Clear (test fr.bit and skip next instruction if bit is 0) 1 or 2 (skip) 0110 bbbf ffff none Data Movement Instructions MOV fr,W Move W to fr (fr = W) 1 0000 001f ffff none MOV W,fr Move fr to W (W = fr) 1 0010 000f ffff Z MOV W,fr-W Move (fr-W) to W (W = fr - W); complement of carry flag is subtracted if CF bit in FUSEX regis- ter is cleared to 0 1 0000 100f ffff C, DC, Z MOV W,#lit Move Literal to W (W = lit) 1 1100 kkkk kkkk none MOV W,/fr Move Complement of fr to W (W = fr ^ FFh) 1 0010 010f ffff Z MOV W,--fr Move (fr-1) to W (W = fr - 1) 1 0000 110f ffff Z MOV W,++fr Move (fr+1) to W (W = fr + 1) 1 0010 100f ffff Z MOV W,<<fr Rotate fr Left through Carry and Move to W (W = << fr) 1 0011 010f ffff C MOV W,>>fr Rotate fr Right through Carry and Move to W (W = >> fr) 1 0011 000f ffff C MOV W,<>fr Swap High/Low Nibbles of fr and move to W (W = <> fr) 1 0011 100f ffff none MOV W,M Move MODE Register to W (W = MODE), high nibble of W cleared 1 0000 0100 0010 none MOVSZ W,--fr Move (fr-1) to W and Skip if Zero (W = fr -1 and skip next instruction if result is zero) 1 2 (skip) 0010 110f ffff none MOVSZ W,++fr Move (fr+1) to W and Skip if Zero (W = fr + 1 and skip next instruction if result is zero) 1 2 (skip) 0011 110f ffff none MOV M,W Move W to MODE Register (MODE = W) 1 0000 0100 0011 none MOV M,#lit Move Literal to MODE Register (MODE = lit, only lower 4 bits) 1 0000 0101 kkkk none MOV !rx,W Move Data Between W and Control Register: rx = W (move W to rx) - MODE Reg bit 4 = 1 W = rx (move rx to W) - MODE Reg bit 4 = 0 rx <=> W (exchange W and rx) - MODE = x8 or x9 1 0000 0000 ffff none MOV !OPTION, W Move W to OPTION Register (OPTION = W) 1 0000 0000 0010 none TEST fr Test fr for Zero (fr = fr to set or clear Z flag) 1 0010 001f ffff Z Program Control Instructions Table 16-1.  The SX Instruction Set (Continued) Mnemonic, Operands Description Cycles Opcode Flags Affected