Assembly Instruction Reference Guide
Assembly Instruction Reference Guide
What it does: Adds an 8-bit literal value to the W register. Syntax: [label] ADDLW k Operands: 0 ≤ k ≤ 255
Operation: (W) + k → (W) Status Affected: C, DC, Z Example:
≤ 127, d ∈ {0,1} Operation: (W) + (f) → (destination) Status Affected: C, DC, Z Example:
What it does: Adds the W register to the contents of register f. Syntax: [label] ADDWF f,d Operands: 0 ≤ f
What it does: Performs a bitwise AND between an 8-bit literal and the W register. Syntax: [label] ANDLW k
Operands: 0 ≤ k ≤ 255 Operation: (W) AND k → (W) Status Affected: Z Example:
Operands: 0 ≤ f ≤ 127, d ∈ {0,1} Operation: (W) AND (f) → (destination) Status Affected: Z Example:
What it does: Performs a bitwise AND between W register and register f. Syntax: [label] ANDWF f,d
What it does: Clears a specific bit in register f. Syntax: [label] BCF f,b Operands: 0 ≤ f ≤ 127, 0 ≤ b ≤ 7
Operation: 0 → (f<b>) Status Affected: None Example:
What it does: Sets a specific bit in register f. Syntax: [label] BSF f,b Operands: 0 ≤ f ≤ 127, 0 ≤ b ≤ 7
Operation: 1 → (f<b>) Status Affected: None Example:
What it does: Tests a bit in register f and skips the next instruction if that bit is set. Syntax: [label] BTFSS
f,b Operands: 0 ≤ f ≤ 127, 0 ≤ b ≤ 7 Operation: skip if (f<b>) = 1 Status Affected: None Example:
What it does: Tests a bit in register f and skips the next instruction if that bit is clear. Syntax: [label] BTFSC
f,b Operands: 0 ≤ f ≤ 127, 0 ≤ b ≤ 7 Operation: skip if (f<b>) = 0 Status Affected: None Example: