IP2022 Users ManualInstruction Set Architecture
www.ubicom.com
199
Cycles:
3
Example:
mov w,0x1F0;load W with index
add pcl,w ;add index to the pc
retw #0xFF ;if index is 0,
;return with 0xFF in W
retw #0xFF ;if index is 1,
;return with 0xF0 in W
retw #0xFF ;if index is 2,
;return with 0x0F in W
retw #0xFF ;if index is 3,
;return with 0x00 in W
This example shows an index being read from
data memory location 0x1F0 and being added to
the program counter, which causes a jump into an
array of retw instructions. Depending on what
the index is, one of the retw instructions will be
executed. Each retw instruction returns a
different value in W.