13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>Note that the built-in function @LSW() must be used on the bitwise negated immediate value becauseall values are interpreted by the assembler as 64-bit signed values. The @LSW() function returns thelowest 32 bits.3.11.3. Thumb 16-bit Generic InstructionsThe <strong>ARM</strong> assembler recognizes the following generic instructions in Thumb mode:ADR Thumb 16-bit genericLoad a PC-relative address into a low register. The address is specified as a target label. The PC-relativeoffset must be less than 1 kB. The target label must be defined locally, must be word-aligned and mustbe in the same code section as the instruction. The assembler will not emit a relocation type <strong>for</strong> the targetlabel. If the offset is out-of-range or the target label is external or in another section, then the assemblergenerates an error message.LDR= Thumb 16-bit genericLoad an address or a 32-bit constant value into a low register. If the constant is in the range [0,255] theassembler will generate a MOV instruction. Otherwise the assembler places the constant or the addressin a literal pool and generates a PC-relative LDR instruction that loads the value from the literal pool.InstructionLDR Rd,=exprReplacementMOV Rd, #exprLDR Rd,ltpool;; codeltpool:.DW exprRemarksIf expr is in rangeIf expr is external or PC-relative, or not inrangeThe PC-relative offset from the LDR instruction to the value in the literal pool must be positive and lessthan 1 kB. By default the assembler will place a literal pool at the end of each code section. If the defaultliteral pool is out-of-range you will have to ensure that there is another literal pool within range by meansof the .LTORG directive.Bcond inversion Thumb 16-bit genericThe PC-relative conditional branch instruction has a range of (-256,+255) bytes.The unconditional versionhas a range of (-2048,+2047) bytes. If the conditional branch target is out-of-range, the assembler willrewrite the conditional branch instruction with an inversed conditional branch and an unconditional branch.InstructionBcond labelReplacement~1:Binv_cond ~1B labelRemarksIf target label out-of-range144

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!