Example
; Branch to subroutines in SwitchTable selected by Switch value.
; This example only works for code located
; program space:
SwitchTable:
.word
.word
MOVL
MOVZ
MOV
XB
SwitchReturn:
Switch0:
XB
Switch1:
XB
Switch0
Switch1
.
.
XAR2,#SwitchTable
AR0,@Switch
AL,*+XAR2[AR0]
*AL
.
.
.
SwitchReturn,UNC
.
.
SwitchReturn,UNC
in upper 64K of
; Switch address table:
; Switch0 address
; Switch1 address
; XAR2 = pointer to SwitchTable
; AR0
= Switch index
; AL = SwitchTable[Switch]
; Indirect branch using AL
; Subroutine 0:
; Return: branch
; Subroutine 1:
; Return: branch
XB pma,COND
6-371
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?