NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

PRU Assembler Migration

From Texas Instruments Wiki
Jump to: navigation, search
NOTE1: Some of the steps can be easily done using search replace pattern, the way it has been done in text editor vim has been mentioned in dotted box, since regular expression is used, it can be re-used with sed or any other similar tool to achieve similar outcome
NOTE2: Outside the dotted box tokens, assembler directives and file extensions are italicized


  • File extension to be .asm instead of .p
  • Use ; for comments, all characters following it till newline would be comments. Do not use // and /*, */ for comments
  • Labels and directives .set, .macro should start without whitespace, other's mentioned below should start with whitespace
  • Use .set to define symbols, i.e. replace #define <MACRO> by <MACRO> .set
   %s/#define\s*\(\w*\)/\1\t.set/gc
  • Use .asg instead of #define for register definitions, .asg is preferred for register definitions as it can be redefined
   if all of #define was replaced with .set as in the previous step, do following for register definition to use .asg instead of .set (remember to select only register defines)
   %s/\(\w*\)\s*.set\s*\(\w*.\w*\)/\t.asg\t\2,\t\1/gc
  • Conditional compilation usage is different, #ifdef <MACRO> to be replaced by .if $isdefed("<MACRO>") and so on
   %s/#ifdef\s*\(\w*\)/\t.if\t$defined(\1)/gc
   %s/#endif/\t.endif/gc
   %s/#else/\t.else/gc
   %s/#ifndef\s*\(\w*\)/\t.if\t!$defined(\1)/gc
  • Register modifier suffix to be in lowercase, i.e. R0.w1 is okay, but not R0.W1
  • .word is to be used instead of .codeword
  • Replace MOV with LDI (16 bit) or LDI32 (32 bit), wherever constant values and register pointers are used
  • Prefix & along with first operand for LBCO, SBCO, LBBO & SBBO instructions
   %s/\([L,S]B[C,B]O\s*\)\(\w*\)/\1\&\2/gc
  • Replace WBS Rx.y & WBC Rx.y with QBBC <label of current instruction>, Rx, y & QBBS <label of current instruction>, Rx, y respectively. Or to simplify macro for each may be defined corresponding to psuedo op's that was present in PASM
  • Replace QBBC/QBBS <label>, Rx.ty shorthand psuedo-op by QBBC/QBBS <label>, Rx, y
   if substitution symbols are not used for register,
   %s/\(QBB[C,S]\s*\w*,\s*R\w*.\w*\).t\(\w*\)/\1,\t\2/gc
  • Use SET/CLR Rx, Rx.ty instead of SET/CLR Rx.ty
  • Prefix & with the first operand of XIN, XOUT
  • Use JMP instead of QBA - since it has been observed that one bit differs with new assembler
  • .setcallreg directive, CALL & RET psuedo instructions are not supported, instead make use of JAL & JMP. For eg. - macro's may be defined for CALL & RET as JAL <callreg>, <function> and JMP <callreg> respectively
  • Macro definition requires that macro name and .macro keyword be swapped, i.e. .macro <MACRO> should be changed to <MACRO> .macro
  • New assembler doesn't seem to be capable of various combination of operators that are legal C, if errors are encountered due to it, modify expression to have safest (or most unambiguous) operators, i.e. by using parenthesis wherever possible
  • Add below at the beginning of assembly source file
    • .sect ".text"
    • .retain
    • .retainrefs

Reference[edit]

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article PRU Assembler Migration here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article PRU Assembler Migration here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article PRU Assembler Migration here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article PRU Assembler Migration here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article PRU Assembler Migration here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article PRU Assembler Migration here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article PRU Assembler Migration here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article PRU Assembler Migration here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article PRU Assembler Migration here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity