
04.02.1997

Pic16C5x commands:


fr	=	fileregister
lit	=	literal
W	=	Workingregister
addr8	=	8bit address (jump)
addr9	=	9bit address (call)
addr11	=	11bit address (call with pageselect)
d	=	d=0 -> result in W, d=1 -> result in fr (microchip)




Parallax:			Description:

ADD	fr,#lit			add literal to fr
ADD	fr1,fr2			add fr2 to fr1
ADD	fr,W			add W to fr
ADD	W,fr			add fr to W
ADDB	fr,bit			add bit to fr
AND	fr,#lit			fr and literal to fr
AND	fr1,fr2			fr1 and fr2 to fr1
AND	fr,W			fr and W to fr
AND	W,#lit			W and literal to W
AND	W,fr			W and fr to W

CALL	addr8			call subroutine

CJA	fr,#lit,addr9		compare and jump if fr
CJA	fr1,fr2,addr9		compare and jump if fr1
CJAE	fr,#lit,addr9		compare and jump if fr or equal
CJAE	fr1,fr2,addr9		compare and jump if fr1 or equal
CJB	fr,#lit,addr9		compare and jump if fr
CJB	fr1,fr2,addr9		compare and jump if fr1
CJBE	fr,#lit,addr9		compare and jump if fr or equal
CJBE	fr1,fr2,addr9		compare and jump if fr1 or equal
CJE	fr,#lit,addr9		compare and jump if equal
CJE	fr1,fr2,addr9		compare and jump if equal
CJNE	fr,#lit,addr9		compare and jump if not equal
CJNE	fr1,fr2,addr9		compare and jump if not equal

CLC				clear carrybit
CLR	fr			clear file register
CLR	W			clear working register
CLR	WDT			clear Watchdogtimer
CLRB	bit			clear bit
CLZ				clear zerobit

CSA	fr,#lit,addr9		compare and skip if fr
CSA	fr1,fr2,addr9		compare and skip if fr1
CSAE	fr,#lit,addr9		compare and skip if fr or equal 
CSAE	fr1,fr2,addr9		compare and skip if fr1 or equal
CSB	fr,#lit,addr9		compare and skip if fr
CSB	fr1,fr2,addr9		compare and skip if fr1
CSBE	fr,#lit,addr9		compare and skip if fr or equal
CSBE	fr1,fr2,addr9		compare	and skip if fr1 or equal
CSE	fr,#lit,addr9		compare and skip if equal
CSE	fr1,fr2,addr9		compare and skip if equal
CSNE	fr,#lit,addr9		compare and skip if not equal
CSNE	fr1,fr2,addr9		compare and skip if not equal

DEC	fr			decrease fileregister
DECSZ	fr			decrease fileregister and skip if zero
DJNZ	fr,addr9		decrease fileregster and jump if not zero
INC	fr			increase fileregister
INCSZ	fr			increase fileregister and skip if zero
IJNZ	fr,addr9		increase fileregister and jump if not zero

JB	bit,addr9		jump if bit
JC	addr9			jump if carry
JMP	addr9			jump
JMP	PC+W			jump to pc + w
JMP	W			jump to w
JNB	bit,addr9		jump if not bit
JNC	addr9			jump if not carrybit
JNZ	addr9			jump if not zerobit
JZ	addr9			jump if zero bit

LCALL	addr11			long call
LJMP	addr11			long jump
LSET	addr11			long set

MOV	fr,#lit			move literal to fileregister
MOV	fr1,fr2			move fr2 to fr1
MOV	fr,W			move w to fr
MOV	OPTION,#lit		move literal to optionregister
MOV	OPTION,fr		move fr to optionregister
MOV	OPTION,W		move w to optionregister
MOV	!port_fr,#lit		move literal to tristateregister
MOV	!port_fr,fr		move fr to tristateregister
MOV	!port_fr,W		move w to tristateregister
MOV	W,#lit			move literal to w
MOV	W,fr			move fr to w
MOV	W,/fr			move not fr to w
MOV	W,fr-W			move w - fr to w
MOV	W,++fr			move increased fr to w
MOV	W,--fr			move dercreased fr to w
MOV	W,<<fr			move left rotatet fr to w
MOV	W,>>fr			move right rotatet fr to w
MOV	W,<>fr			move swapped nibbles fr to w

MOVB	bit1,bit2		move bit2 to bit1
MOVB	bit1,/bit2		move not bit2 to bit1
MOVSZ	W,++fr			move increased fr to w and skip if zero
MOVSZ	W,--fr			move decreased fr to w and skip if zero

NEG	fr			negate fr (not fr + 1)

NOP				no operation

NOT	fr			not fr
NOT	W			not w

OR	fr,#lit			or literal and fr to fr
OR	fr1,fr2			or fr2 and fr1 to fr1
OR	fr,W			or w and fr to fr
OR	W,#lit			or literal and w to w
OR	W,fr			or fr and w to w

RET				return from subroutine, clear w
RETW	lit,lit,...		return from subroutine, W=literal

RL	fr			rotate fr left
RR	fr			rotate fr right

SB	bit			skip if bit
SC				skip if carry

SETB	bit			set bit

SKIP				skip next command

SLEEP				sleepmode

SNB	bit			skip if not bit
SNC				skip if not carry

SNZ				skip if not zero

STC				set carrybit
STZ				set zerobit

SUB	fr,#lit			sub literal from fr to fr
SUB	fr1,fr2			sub fr2 from fr1 to fr1
SUB	fr,W			sub w from fr to fr

SUBB	fr,bit			decrease fr if not bit

SWAP	fr			swap nibbles

SZ				skip if zero

TEST	fr			test fr if zero

XOR	fr,#lit			xor literal and fr to fr
XOR	fr1,fr2			xor fr2 and fr1 to fr1
XOR	fr,W			xor w and fr to fr
XOR	W,#lit			xor literal and w to w
XOR	W,fr			xor fr and w to w

















Microchip			Description:

ADDWF	fr,d			add W and fr
ADDWF	fr		
ADDWF	fr,W

ANDLW	lit			and W and literal
ANDWF	fr,d			and W and fr
ANDWF	fr
ANDWF	fr,W

BCF	fr,b			clear bit
BCF	bit
BSF	fr,b			set bit
BSF	bit

BTFSC	fr,b			test bit and skip if bit clear
BTFSC	bit
BTFSS	fr,b			test bit and skip if bit set
BTFSS	bit

CALL	addr8			call address

CLRF	fr			clear fileregister
CLRW				clear Workingregister
CLRWDT				clear Watchdogtimer

COMF	fr,d			complement from fr
COMF	fr
COMF	fr,W

DECF	fr,d			decrease fr
DECF	fr
DECF	fr,W

DECFSC	fr,d			decrease fr and skip if zero
DECFSC	fr
DECFSC	fr,W

GOTO	addr9			goto address

INCF	fr,d			increase fr
INCF	fr
INCF	fr,W

INCFSC	fr,d			increase fr and skip if zero
INCFSC	fr
INCFSC	fr,W

IORLW	lit			or literal and W
IORWF	fr,d			or fr and W
IORWF	fr
IORWF	fr,W

MOVF	fr,d			move fr
MOVF	fr
MOVF	fr,W
MOVLW	lit			move literal to W
MOVWF	fr			move W to fr

NOP				no operation

OPTION				move W in Optionregister

RETLW	lit			return from subroutine with literal in W
RETLW				return from subroutine with clear W

RLF	fr,d			rotate fr left
RLF	fr
RLF	fr,W
	
RRF	fr,d			rotate fr right
RRF	fr
RRF	fr,W

SLEEP				sleep mode

SUBWF	fr,d			sub fr from W
SUBWF	fr			
SUBWF	fr,W

SWAPF	fr,d			swap nibbles from fr
SWAPF	fr
SWAPF	fr,W

TRIS	port_fr			move W to Tristate register
TRISA
TRISB
TRISC

XORLW	lit			literal xor W 
XORWF	fr,d			fr xor W
XORWF	fr
XORWF	fr,W


Dirk Dsterberg, duesterb@unixserv.rz.fh-hannover.de
                 http://linux.rz.fh-hannover.de/~duesterb
