Datasheet
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
186
Examples
ADR.W R0, BranchTable_Byte
TBB [R0, R1] ; R1 is the index, R0 is the base address of the
; branch table
Case1
; an instruction sequence follows
Case2
; an instruction sequence follows
Case3
; an instruction sequence follows
BranchTable_Byte
DCB0 ; Case1 offset calculation
DCB((Case2-Case1)/2) ; Case2 offset calculation
DCB((Case3-Case1)/2)
; Case3 offset calcula
tion
TBH [PC, R1, LSL #1] ; R1 is the index, PC is used as base of the
; branch table
BranchTable_H
DCI((CaseA - BranchTable_H)/2) ; CaseA offset calculation
DCI((CaseB - BranchTable_H)/2) ; CaseB offset calculation
DCI((CaseC - BranchTable_H)/2) ; CaseC offset calculation
CaseA
; an instruction sequ
ence follows
CaseB
; an instruc
tion sequence follows
CaseC
; an instruction sequence follows