
© 1998 Scenix Semiconductor, Inc. All rights reserved. 5SX User’sManual Rev. 1.0
www.scenix.com Contents
Chapter 3 Instruction Set
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.2 Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
3.3 Addressing Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.1 Immediate Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.2 Direct Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
3.3.3 Indirect Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
3.4 Instruction Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4.1 Logic Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4.2 Arithmetic and Shift Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4.3 Bitwise Operation Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.4.4 Data Movement Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.4.5 Program Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.4.6 System Control Instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
3.5 Instruction Summary Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
3.6 Equivalent Assembler Mnemonics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.7 Detailed Instruction Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
3.7.1 ADD fr,W Add W to fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.7.2 ADD W,fr Add fr to W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.7.3 AND fr,W AND of fr and W into fr . . . . . . . . . . . . . . . . . . . 58
3.7.4 AND W,fr AND ofW and fr into W . . . . . . . . . . . . . . . . . . . 59
3.7.5 AND W,#lit AND ofW and Literal into W . . . . . . . . . . . . . . . 60
3.7.6 BANK addr8 Load Bank Number into FSR(7:5) . . . . . . . . . . . . 61
3.7.7 CALL addr8 Call Subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . 62
3.7.8 CLR fr Clear fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
3.7.9 CLR W Clear W . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.7.10 CLR !WDT Clear Watchdog Timer . . . . . . . . . . . . . . . . . . . . . 66
3.7.11 CLRB fr,bit Clear Bit in fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
3.7.12 DEC fr Decrement fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.7.13 DECSZ fr Decrement fr and Skip if Zero . . . . . . . . . . . . . . . 69
3.7.14 INC fr Increment fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.7.15 INCSZ fr Increment fr and Skip if Zero . . . . . . . . . . . . . . . 71
3.7.16 IREAD Read Word from Instruction Memory . . . . . . . . . 72
3.7.17 JMP addr9 Jump to Address . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.7.18 MOV fr,W Move W to fr . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
3.7.19 MOV M,#lit Move Literal to MODE Register . . . . . . . . . . . . . 76
3.7.20 MOV M,W Move W to MODE Register . . . . . . . . . . . . . . . . 77
3.7.21 MOV !OPTION,W Move W to OPTION Register . . . . . . . . . . . . . . . 78
3.7.22 MOV !rx,W Move W to Port Rx Control Register . . . . . . . . . 79
3.7.23 MOV W,fr Move fr to W . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
3.7.24 MOV W,/fr Move Complement of fr to W . . . . . . . . . . . . . . . 82
3.7.25 MOV W,fr-W Move (fr-W) to W . . . . . . . . . . . . . . . . . . . . . . . . 83
3.7.26 MOV W,--fr Move (fr-1) to W . . . . . . . . . . . . . . . . . . . . . . . . . 84
3.7.27 MOV W,++fr Move (fr+1) to W . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.7.28 MOV W,<<fr Rotate fr Left through Carry and Move to W . . . 86
3.7.29 MOV W,>>fr Rotate fr Right through Carry and Move to W . . 87
3.7.30 MOV W,<>fr Swap High/Low Nibbles of fr and Move to W . . 88