Software: Relative Addressing
-
; Here’s a simple lookup table which is called as a
-
; subroutine. Expects the table offset to be loaded in W.
-
; An example call looks like this:
-
; movlw 0x04 ; Load W with 4
-
; call Table ; Call the table subroutine
-
; movwf Result ; Store the result from the table
-
Table addwf PCL, W ; Jump to (current PCL) + W
-
retlw 0x00 ; Return with 0x00 in W
-
retlw 0x23 ; Return with 0x23 in W
-
retlw 0x33 ; etc.
-
retlw 0x88
Previous slide | Next slide | Back to first slide | View graphic version |