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 2nd December 2010 at http://forums.arm.com

    My guess is that they want to know the immediate base and rotate values. If in doubt I'd generate full machine code in annotated hex describing each of the fields. I don't know what they mean by "C" either.

    The restriction you're thinking of actually applies to immediates - there are only four bits for the rotate, so it's an 8-bit value rotated by an even number from 0 to 30. This is done so it can roughly span the entire 32-bit space.
Reply
  • Note: This was originally posted on 2nd December 2010 at http://forums.arm.com

    My guess is that they want to know the immediate base and rotate values. If in doubt I'd generate full machine code in annotated hex describing each of the fields. I don't know what they mean by "C" either.

    The restriction you're thinking of actually applies to immediates - there are only four bits for the rotate, so it's an 8-bit value rotated by an even number from 0 to 30. This is done so it can roughly span the entire 32-bit space.
Children
No data