Register comparisons
Almost every decision in PIC assembly uses comparisons. The PIC18 has no CMP instruction — you subtract (or MOVF for zero) and read STATUS.
Three cases
Section titled “Three cases”| Case | Method |
|---|---|
| Equal to zero | MOVF A,F → test Z |
| Equal registers | MOVF B,W / SUBWF A,W → Z |
| Less / greater | Same subtract → C (and Z) |
Partial exam mapping
Section titled “Partial exam mapping”| Page | Exam topic |
|---|---|
| C and Z flags | Theory: explain C and Z |
| Equal to zero | Theory: why MOVF,F |
| Between registers | REG1>REG2, C/Z table |
Next: C and Z flags.
Introduction — Register comparisons
Based on: Clase Tema 4 y 5.pdf
0 of 0 answered
Sign in with CALETAS to sync this result across devices.
Sign in with CALETAS