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

"Real" ARM instructions generated by the assembler

Note: This was originally posted on 2nd December 2010 at http://forums.arm.com

Not 100% sure this is the right place to post a question like this but...

I'm tasked with a simple question of setting bit 11 of R2 to 1 and bits 10 & 12 to 0. This was accomplished in these 2 instructions:

ORR R2,R2, #&800
BIC R2,R2, #1400

I'm now asked:

"Work out the real ARM instructions generated by the assembler in your answer to Q4. You may express these instructions as assembler, but they must use the precise value of C, and an appropriate rotate."

I thought I just did some real assembly language? What does the assembler do here? What's this nonsense about C?

Arn't instructions generally:

Op, Rd, Rn, shift C

Also am I right in thinking you can only perform a even ror and rol (that is you cannot have ror #3 , but you can have lsr #3??)

Thanks
Parents
  • Note: This was originally posted on 3rd December 2010 at http://forums.arm.com


    Not 100% sure this is the right place to post a question like this but...

    I'm tasked with a simple question of setting bit 11 of R2 to 1 and bits 10 & 12 to 0. This was accomplished in these 2 instructions:

    ORR R2,R2, #&800
    BIC R2,R2, #1400

    I'm now asked:

    "Work out the real ARM instructions generated by the assembler in your answer to Q4. You may express these instructions as assembler, but they must use the precise value of C, and an appropriate rotate."

    I thought I just did some real assembly language? What does the assembler do here? What's this nonsense about C?

    Arn't instructions generally:

    Op, Rd, Rn, shift C

    Also am I right in thinking you can only perform a even ror and rol (that is you cannot have ror #3 , but you can have lsr #3??)

    Thanks


    Hi, the best way to go would be to ask for the clarifications from your teacher/lecturer (I'm assuming it's some sort of a home work or similar).

    If the above is impossible for whatever reasons then all we can do is guess.
    My guess is that what is meant by 'real ARM instructions' is the actual instruction in its hexadecimal representation (like, 0x0E005412) or even binary represenation where you can show what bits represent the Op, what bits represent the Rd, etc. Do you have the ARM ARM (ARM  Architecture Reference Manual) - it's all explained there. BTW, what does the '&' mean in your ORR instruction, is it a typo?
    I'm not sure what is meant by C in your task but it's definitely not the 'C' language :) It probably refers to something expressed as C in your educational materials - re-read them (just guessing, of course).
Reply
  • Note: This was originally posted on 3rd December 2010 at http://forums.arm.com


    Not 100% sure this is the right place to post a question like this but...

    I'm tasked with a simple question of setting bit 11 of R2 to 1 and bits 10 & 12 to 0. This was accomplished in these 2 instructions:

    ORR R2,R2, #&800
    BIC R2,R2, #1400

    I'm now asked:

    "Work out the real ARM instructions generated by the assembler in your answer to Q4. You may express these instructions as assembler, but they must use the precise value of C, and an appropriate rotate."

    I thought I just did some real assembly language? What does the assembler do here? What's this nonsense about C?

    Arn't instructions generally:

    Op, Rd, Rn, shift C

    Also am I right in thinking you can only perform a even ror and rol (that is you cannot have ror #3 , but you can have lsr #3??)

    Thanks


    Hi, the best way to go would be to ask for the clarifications from your teacher/lecturer (I'm assuming it's some sort of a home work or similar).

    If the above is impossible for whatever reasons then all we can do is guess.
    My guess is that what is meant by 'real ARM instructions' is the actual instruction in its hexadecimal representation (like, 0x0E005412) or even binary represenation where you can show what bits represent the Op, what bits represent the Rd, etc. Do you have the ARM ARM (ARM  Architecture Reference Manual) - it's all explained there. BTW, what does the '&' mean in your ORR instruction, is it a typo?
    I'm not sure what is meant by C in your task but it's definitely not the 'C' language :) It probably refers to something expressed as C in your educational materials - re-read them (just guessing, of course).
Children
No data