|
This table is designed to help the CVASM16 user to understand source code written in Microchip format. It can also be a valuable reference when converting source to TechTools format. When doing this, keep in mind that CVASM16 will accept ALL of Microchip's instruction set, but not Microchip's directives and macros. f = File Register w = Working Register or "W"
Microchip Description TechTools Equivalent ____________________________________________ Byte-oriented File Register operations ____________________________________________
ADDWF f,0 Add f into w ADD W,f ADDWF f,1 Add W into f ADD f,w ANDWF f,0 And f into w AND W,f ANDWF f,1 And W into f AND f,w CLRF f Clear f CLR f CLRW Clear W CLR W COMF f,0 Complement f, store in w MOV W,/f COMF f,1 Complement f, store in f NOT f DECF f,0 Decrement f, store in w MOV W,--f DECF f,1 Decrement f, store in f DEC f DECFSZ f,0 Decrement f into w, skip if 0 MOVSZ W,--f DECFSZ f,1 Decrement f into f, skip if 0 DECSZ f INCF f,0 Increment f into w MOV W,++f INCF f,1 Increment f into f INC f INCFSZ f,0 Increment f into w, skip if 0 MOVSZ W,++f INCFSZ f,1 Increment f into f, skip if 0 INCSZ f IORWF f,0 Or W and f into w OR W,f IORWF f,1 Or W and f into f OR f,W MOVF f,0 Move f into w MOV W,f MOVF f,1 Move f to itself TEST f MOVWF f Move W to f MOV f,W NOP No operation NOP RLF f,0 Rotate f left w/carry, in w MOV W,<<fr RLF f,1 Rotate f left w/carry, in f RL f RRF f,0 Rotate f right w/carry, in w MOV W,>>f RRF f,1 Rotate f right w/carry, in f RR f SUBWF f,0 Subtract W from f in w MOV W,f-W SUBWF f,1 Subtract W from f in f SUB f,W SWAPF f,0 Swap nibbles of f in w MOV W,<>f SWAPF f,1 Swap nibbles of f in f SWAP f XORWF f,0 Xor W and f in w XOR W,f XORWF f,1 Xor W and f in f XOR f,W
__________________________________________ Bit-oriented File Register operations* __________________________________________
BCF f,b Bit clear f CLRB bit BSF f,b Bit set f SETB bit BTFSC f,b Bit test f, skip if clear SNB bit BTFSS f,b Bit test f, skip if set SB bit
____________________________________ Literal and Control operations ____________________________________
ADDLW lit Add literal into W ('xx) ADD W,#lit ANDLW lit And literal into W AND W,#lit CALL addr Call to address ('5x) CALL addr8 ('xx) CALL addr11 CLRWDT Clear WDT and prescaler CLR WDT GOTO addr Go to address ('5x) JMP addr9 ('xx) JMP addr11 IORLW lit Or literal into W OR W,#lit MOVLW lit Move literal into W MOV W,#lit OPTION Move W into OPTION ('5x) MOV !OPTION,W RETFIE Return from interrupt ('xx) RETI RETLW lit Return with literal in W RETW lit Return, clearing W ('5x) RET RETURN Return from subroutine ('xx) RET SLEEP Clear WDT and enter sleep mode SLEEP SUBLW lit Subtract W from literal ('xx) MOV W,#lit-W TRIS port Move W into port's TRIS ('5x) MOV !port,W XORLW lit Xor literal into W XOR W,#lit
____________________________________ Special Instructions ____________________________________
ADDCF f,0 Add carry to f, store in w ¹ ADDCF f,0 ADDCF f,1 Add carry to f, store in f ¹ ADDB f,C ADDDCF f,0 Add digit carry to f,store in w ¹ ADDDCF f,0 ADDDCF f,1 Add digit carry to f,store in f ¹ ADDB f,DC B k Branch ('5x) JMP addr9 ('xx) JMP addr11 BC k Branch on Carry ¹ ('5x) JC addr9 ('xx) JC addr11 BDC k Branch on Digit Carry ¹ ('5x) JB DC,addr9 ('xx) JB DC,addr11 BNC k Branch on No Carry ¹ ('5x) JNC addr9 ('xx) JNC addr11 BNDC k Branch on No Digit Carry ¹ ('5x) JNB DC,addr9 ('xx) JNB DC,addr11 BNZ k Branch on No Zero ¹ ('5x) JNZ addr9 ('xx) JNZ addr11 BZ k Branch on Zero ¹ ('5x) JZ addr9 ('xx) JZ addr11 CLRC Clear Carry CLC CLRDC Clear Digit Carry CLRB DC CLRZ Clear zero CLZ LCALL k Long Call ¹ ('5x) LCALL addr11 ('xx) LCALL addr13 LGOTO k Long Goto ¹ ('5x) LJMP addr11 ('xx) LJMP addr13 MOVFW k Move f into W MOV W,f NEGF f,0 Negate f, store in w ¹ NEGF f,0 NEGF f,1 Negate f, store in f ¹ NEGF f,1 SETC Set carry STC SETDC Set digit carry SETB DC SETZ Set zero STZ SKPC Skip if carry SC SKPDC Skip if digit carry SB DC SKPNC Skip if not carry SNC SKPNDC Skip if not digit carry SNB DC SKPNZ Skip if not zero SNZ SKPZ Skip if zero SZ SUBCF f,0 Subtract carry from f, in w ¹ SUBCF f,0 SUBCF f,1 Subtract carry from f, in f ¹ SUBB f,C SUBDCF f,0 Sub digit carry from f, in w ¹ SUBDCF f,0 SUBDCF f,1 Sub digit carry from f, in f ¹ SUBB f,DC TSTF f Test f TEST f
*
(alternate for bit operand) bit = file register.bit
|

