RET, RETFI, RETW

NOTE: These items have been discontinued for a long time.
We no longer support these products or offer alternatives.

We retain these pages so that users can see what their existing tools support and to provide download links to the final documentation and software versions. We have a few replacement parts left, but not many. Available items have an 'ADD to CART' or 'Buy Now' button next to them. Otherwise they are not available.

logo has a few items in stock as well.

 

RET                        Return from subroutine


Words:        1        Cycles:        2                Affects:        none

 

Operation:        The next stack value is moved into the program counter. On '5x devices, W is cleared to 0.

 

Coding:        '5x        RETLW        0

       'xx        RETURN

 

 

RETI                        Return from Interrupt


Words:        1        Cycles:        2                Affects:        none

 

Operation:        The next stack value is moved into the program counter.  Interrupts are enabled by setting the Global Interrupt Enable bit, GIE (INTCON.7).

 

Coding:        'xx        RETFIE

 

 

RETW        literal1,literal2,...      Assemble RET’s which load W with literal data


Words:        ?        Cycles:        2 per RETLW        Affects:        none

 

Operation:        A list of RET's with literal data in the W area is assembled, which can be accessed by JMP PC+W or JMP W instructions. This is useful for lookup tables.

 

Coding:        RETLW        literal1

       (RETLW        literal2)

       (RETLW        ...)

 

Example:        jmp        pc+w        ;Jump to byte at location pc+w

 

       retw        00100011b        ;Return with w holding appropriate

       retw        00h,01h,02h,03h        ;value

       retw        "Enter cycle count"