pasm to clpru porting guide for PRU

335 views
Skip to first unread message

Mark A. Yoder

unread,
Jul 19, 2016, 2:20:47 PM7/19/16
to BeagleBoard
I'm converting some PRU assembly code from pasm to clpru and finding there are some differences.  An earlier thread noted some differences between the two (Use LDI, not MOV for loading constants for example).

Has anyone made a porting guide?  For example:

#define CH1BIT r30.t8 
converts to
   .asg    r30.t8,     CH1BIT

Thanks...

--Mark

Mark A. Yoder

unread,
Jul 20, 2016, 9:51:53 AM7/20/16
to BeagleBoard
Well I couldn't find one, so I made one.  http://elinux.org/EBC_Exercise_30_PRU_porting_pasm_to_clpru

Please add to it.

--Mark

Greg

unread,
Jul 23, 2016, 1:05:19 PM7/23/16
to BeagleBoard
There is in fact difference notes published by TI.  Perhaps difficult to locate!

Look in the README.txt file located in the command line package.
This is in the directory ti-cgt-pru_2.1.2.

Here is an excerpt:


Assembler

-------------------------------------------------------------------------------
Instructions
-------------------------------------------------------------------------------
The syntax for instruction mnemonics is very similiar to the existing PASM
assembler. Exceptions are listed here:

1. MOV instruction
   MOV is only supported for register to register moves. The LDI instruction
   must be used to load a literal into a register. 

2. LDI instruction
   LDI can only be used to load a 16-bit constant into a register. To load a
   32-bit constant, you must use the LDI32 instruction.

3. MVI instruction
   MVI is only supported on core revisions 2 and 3. The existing PASM assembler
   supports the instruction in a limited form for v1 using pseudo operations.

4. ZERO instruction
   ZERO is only supported on v2 and v3 cores. For v1, the user should use
   LDI r0, 0.

5. LFC, SFC, and SCAN
   These instructions are not supported. If support is needed we can add them.

6. Operands with a '&' prefix
   The existing PASM assembler accepts operands with or without the & 
   symbol: LBBO &r0 or LBBO r0. The assembler in this release requires the
   & for these operands. 

There is a bit more than the above.

Regards,
Greg


Mark A. Yoder

unread,
Jul 26, 2016, 12:12:13 PM7/26/16
to BeagleBoard
Reply all
Reply to author
Forward
0 new messages