__ASM__
 
Syntax

__ASM__   ( expression )
Description


__ASM__ tells the compiler to compile the expression into the program

expression is a number, and represents the 16 bit opcode that is added to the code.

We currently don't have a symbollic assembler and the user has to generate the expression that represents an ARM Thumb opcode.  Details on the Thumb opcodes can be found here .

Example
 
 


For the Cortex parts, the BASIC compiler saves the value computed in the last statement in R7.  These registers uses are subject to change.

R4 is used in index operations and pointers

R6 is normally the second operand in expression evaluation, and is combined with R7 to produce the last value of an expression

R5 is used in some string operations

R9 can be used as a temporary variable in complex expressions that require intermediate values to be saved on the stack.

Differences from other BASICs

See also