Chat freely about anything...

User avatar
By Makuna
#16229 Has anyone found any reference to assembly language yet? I have a small piece of code that needs tight control on the timing and compiler tends to kick out some varied code with the smallest of changes.
User avatar
By ulumu
#16232 To write assembler code inside C:

Code: Select allvoid foo()
{
  asm("  nop");
  asm("  movi.n  a0, 100");
  asm("myloop:");
  asm("  addi     a0, a0, -1");
  asm("  bnez.n   a0, myloop");
}


You can also checkout the assembler code of your compiled C obj:
Code: Select allxtensa-lx106-elf-objdump -d -s <obj-file>


Xtensa architecture documentation (including assembler instruction set)
http://ip.cadence.com/uploads/pdf/xtens ... ndbook.pdf

Hope this help.