gccassemblymicroblaze

define register alias for register


How to define register alias in assembler file ('.S') for microblaze? So I could write instructions with this alias like

addi    ctx, r0, 0x08       

for ARM it was ctx .req r12. Neither .req or .register works for microblaze.

File is compiled with GCC.


Solution

  • Maybe not ideal but as GCC preprocesses assembly files so you can simply use C macro:

    #define ctx r12