Mnemonic | Description | Status | Function | Obs |
movf fr, d | Move file register | fr => d | see macro: mov f, d | |
movwf fr | Move W to file register | w => fr | macro: mov w, fr | |
movlw k | Move literal to W | k => W | macro: movl k, w |
Mnemonic | Description | Status | Function | Obs |
oprwf fr,d | logic / arithmetic operation with a file register and W |
Z(all),C,DC
(add,sub) |
fr opr W => d | only add, sub affect C,DC macro: opr fr, d |
Mnemonic | Description | Status | Function | Obs |
oprlw k | logic / arimetic operation with a literal and W |
Z(all),C,DC
(add,sub) |
k opr W => W | only add, sub affect C,DC
macro:oprl k,w |
Mnemonic | Description | Status | Function | Obs |
clrw | Clear accumulator W | 0 => W | ||
clrf fr | Clear file register fr | 0 => fr | ||
decf fr,d | Decrement file register fr | fr - 1 => d | ||
incf fr, d | Increment file register fr | fr + 1 => d | ||
comf fr,d | 1's complement file register fr | not fr => d | ||
rlf fr, d | Rotate file register fr left thru C | C <= fr(7), fr(i) <= fr(i-1), fr(0) <= C | ||
rrf fr, d | Rotate file register fr right thru C | C => fr(7), fr(i) => fr(i-1), fr(0) => C | ||
bcf fr, b | Bit clear on file register fr | 0 => fr(b) | ||
bsf fr, b | Bit set on file register fr | 1 => fr(b) | ||
swapf fr,d | swap halves of fr | (fr(0:3) <=> fr(4:7)) => d | ||
nop | No operation |
Mnemonic | Description | Status | Function | Obs |
goto addr | branch to addr | addr => PC(0:10) | ||
call addr | call routine at addr | PC => TOS addr => PC(0:10) |
||
decfsz fr,d | Decrement fr, skip if zero | fr - 1 => d, skip if 0 | ||
incfsz fr,d | Increment fr, skip next instr if zero | fr + 1 => d, skip next instr if 0 | ||
btfsc fr,b | Bit test fr, skip if clear | skip next instr if fr(b) =0 | ||
btfss fr,b | Bit test fr, skip if set | skip next instr if fr(b)=1 | ||
return | return from subroutine | TOS => PC | ||
retlw k | return with literal in w | k =>w, TOS => PC | ||
retfie | return from interrupt | TOS => PC, 1 => GIE |
Mnemonic | Description | Status | Function | Obs |
addcf fr, d | Add carry to fr | btfsc 3, 0 incf f,d | ||
subcf fr, d | Subtract carry from fr | btfsc 3, 0 decf fr,d | ||
negf fr, d | Negate file register fr | comf fr, 1 incf fr,d | ||
b addr | Branch to addr | goto adddr | ||
bz addr | Branch on Zero to addr | btfsc 3, 2 goto addr | ||
bnz addr | Branch on No Zero to addr | btfss 3, 2 goto addr | ||
bc addr | Branch on Carry to addr | btfsc 3, 0 goto addr | ||
bnc addr | Branch on No Carry to addr | btfss 3, 0 goto addr | ||
skpc | Skip on Carry | btfss 3, 0 | ||
skpnc | Skip on No Carry | btfsc 3, 0 | ||
skpz | Skip on Zero | btfss 3, 2 | ||
skpnz | Skip on No Zero | btfsc 3, 2 | ||
clrz | Clear Zero flag | bcf 3, 2 | ||
setz | Set Zero flag | bsf 3, 2 | ||
clrc | Clear Carry flag | bcf 3, 0 | ||
setc | Set Carry flag | bsf 3, 0 | ||
tstf fr | Test file register fr | movf fr, f | ||
xchg fr1, fr2 | Exchange file regs fr1 & fr2 | movf fr2, 0 xorwf fr1,1 xorwf fr1, 0 xorwf fr1, 1 movwf fr2 |
Macro uses only w as temporary variable See:mymacros.inc |
|
decbnz fr,addr | Decrement file register, if # 0 branch to addr |
decfsz fr goto addr |
In:mymacros.inc |
Copyright © Célio Guimarães
Institute of Computing - Unicamp - Brazil
Last Update: Nov 29, 2001 by celio