Options
=======

-mlink-relax
     Assume that LD would optimize LDI32 instructions by checking the upper 16 bits of the EXPRESSION. If they are all zeros, then LD would shorten the LDI32 instruction to a single LDI. In such case AS will output DIFF relocations for diff expressions.

-mno-link-relax
     Assume that LD would not optimize LDI32 instructions. As a consequence, DIFF relocations will not be emitted.

-mno-warn-regname-label
     Do not warn if a label name matches a register name. Usually assembler programmers will want this warning to be emitted. C compilers may want to turn this off.

Syntax
======

Special Characters
------------------

# and ; are the line comment characters.

PRU Machine Relocations
=======================

%pmem(EXPRESSION)
     Convert EXPRESSION from byte-address to a word-address.  In other words, shift right by two.

%label(EXPRESSION)
     Mark the given operand as a label. This is useful if you need to jump to a label that matches a register name.

          r1:
              jmp r1		; Will jump to register R1
              jmp %label(r1)	; Will jump to label r1

PRU Machine Directives
======================

.align EXPRESSION [, EXPRESSION]
     This is the generic .align directive, however this aligns to a power of two.

.word EXPRESSION
     Create an aligned constant 4 bytes in size.

.dword EXPRESSION
     Create an aligned constant 8 bytes in size.

.2byte EXPRESSION
     Create an unaligned constant 2 bytes in size.

.4byte EXPRESSION
     Create an unaligned constant 4 bytes in size.

.8byte EXPRESSION
     Create an unaligned constant 8 bytes in size.

.16byte EXPRESSION
     Create an unaligned constant 16 bytes in size.

.set no_warn_regname_label
     Do not output warnings when a label name matches a register name. Equivalent to passing the -mno-warn-regname-label command-line option.

Opcodes
=======

AS implements all the standard PRU core V3 opcodes in the original pasm assembler.  Older cores are not supported by AS.

GAS also implements the LDI32 pseudo instruction for loading a 32-bit immediate value into a register.

            ldi32   sp, __stack_top
            ldi32   r14, 0x12345678