Return Literal to W
W is loaded with the eight-bit literal ‘k’. The program counter (PC) is loaded from the top of the stack (TOS). The high address latch (PCLATH) remains unchanged.
[the_ad id=”3059″]Syntax:
[ label ] RETLW k
Operation:
(k) → (W),
(TOS) → (PC)
Operands:
- k is from 0 to 255
Status Affected: None
Example:
SUB1 ADDWF PCL RETLW 0x07 RETLW 0x08
If W is 1 before a call to SUB1, the value 7 is returned. If W is 2 before a call to SUB1, the value 8 is returned.
[the_ad id=”3059″]