Download ARM Instruction Set

Transcript
Thumb Instruction Set
5.7
Thumb to ARM State Exchange—BX
Switches from Thumb to ARM state are performed using the BX instruction. This has the syntax:
BX
dest
where dest is a register in the range 0 to 15.
This instruction transfers control to the address contained in bits 1 to 31 of dest , in the processor
state determined by bit 0:
Bit 0 = 0
Bit 0 = 1
enters ARM state
remains in Thumb state
Thumb code symbols automatically have bit 0 set when they are declared. The BX instruction
uses this fact to allow transparent state changes. The caller does not need to know what state
the callee executes in, as this information is contained in the destination label. Provided the link
register is correctly set up and the called routine returns with a BX LR instruction, the called
routine will return to the correct execution state on completion.
5.7.1
Effect on condition codes
The BX instruction does not affect the condition codes.
5.8
Software Interrupt
This operation performs a software interrupt. The return address is written into the link register.
The processor is then switched to ARM state and control is transferred to location 8 (the SWI
vector) in supervisor (SVC) mode.
The syntax is:
SWI
SWI-No
where SWI-No is a software interrupt number in the range 0 to 255.
5.8.1
Effect on condition codes
The SWI instruction does not affect the condition codes.
5-16
Reference Manual
ARM DUI 0020D