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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>C compiler option: --call (-m)Menu entry1. Select C/C++ Compiler » Code Generation.2. Set the option Select call mode to Use PC-relative calls (default) or to Use 32-bit indirect calls.Command line syntax--call={far|near}-m{f|n}DescriptionTo address the memory of the <strong>ARM</strong>, you can use two different call modes:farnear32-bit indirect calls. Though you can address the full range of memory, theaddress is first loaded into a register after which the call is executed.26-bit PC-relative call.The PC-relative call is directly coded into the B instruction.This way of calling results in higher execution speed. However, not the full rangeof memory can be addressed with near calls.If you compile your C source with near calls but the called address cannot be reached with a nearcall, the linker will generate an error.It is recommended to use the near addressing mode unless your application needs calls to addressesthat fall outside a 256 MB region.ExampleConsider the following function q which calls function p:extern int p(int a, int b, int c, int d){return a+b+c+d + a*b*c*d;}extern int iii;void q(void){iii=p(42,43,44,45);}With --call=near, this results intoq: .type func298

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

Saved successfully!

Ooh no, something went wrong!