This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

armasm push unknown opcode error

Note: This was originally posted on 8th April 2008 at http://forums.arm.com

Hi,
I am trying to compile a .s file using armasm. But i am getting this error

"VectorTransform.s", line 8: Error: A1163E: Unknown opcode
    8 00000000  PUSH {r2-r12,lr}
"VectorTransform.s", line 9: Error: A1163E: Unknown opcode
    9 00000000  LDM r0!,{r2-r5}

Actual Code:-

..AREA TransPoint,CODE,READONLY
..CODE32
..ENTRY

start
..PUSH {r2-r12,lr}
..LDM r0!,{r2-r5}


(Please treat these dots as space)

Please do let know about any possible solution ASAP.
Parents
  • Note: This was originally posted on 8th April 2008 at http://forums.arm.com

    The reason it doesn't assemble is that your PUSH is missing the base register, and your LDM is missing the direction and increment specifiers.

    PUSH is a macro instruction it is actually an STMFD (Store Multiple to Full Descending stack) under the hood. Remember when assembling an LDM or STM you need to specify the direction and type of the load (ascending or descending / increment base before or after).

    For example - for ARM EABI compliant push / pop stack operations you need a "full descending" stack so use the following pair as your PUSH and POP at the start and end of your functions.

    function_entry
    STMFD   sp!, {r4-r10, lr}; // Equivalent to STMDB

      ; // Useful function code in here

    LDMFD   sp!, {r4-r10, pc}; // Equivalent to LDMIA

    Cheers,

    I
Reply
  • Note: This was originally posted on 8th April 2008 at http://forums.arm.com

    The reason it doesn't assemble is that your PUSH is missing the base register, and your LDM is missing the direction and increment specifiers.

    PUSH is a macro instruction it is actually an STMFD (Store Multiple to Full Descending stack) under the hood. Remember when assembling an LDM or STM you need to specify the direction and type of the load (ascending or descending / increment base before or after).

    For example - for ARM EABI compliant push / pop stack operations you need a "full descending" stack so use the following pair as your PUSH and POP at the start and end of your functions.

    function_entry
    STMFD   sp!, {r4-r10, lr}; // Equivalent to STMDB

      ; // Useful function code in here

    LDMFD   sp!, {r4-r10, pc}; // Equivalent to LDMIA

    Cheers,

    I
Children
No data