Constants in ARM microprocessor

Source: Internet
Author: User
Constants in ARM microprocessor

When learning constants in ARM microprocessor, I had been very ignorant. I checked them online and finally figured it out. I recorded them first.

The original words in the book are::
"A constant is an eight-digit constant that shifts the even digits (0, 2, 4, 8 ,... , 26, 28, 30. Fixed 32-bit instruction encoding during arm instruction. It is impossible to directly use 32-bit to represent the immediate number, the number of integers expressed in the preceding indirect method must be 12 bits in the instruction code (eight bits represent constants, and four bits represent loops shifted to the right ). In this way, not every 32-bit constant is a valid number immediately, and only the result obtained through the preceding constructor is a valid number immediately.
Valid constants: 0xff, 0 × 104, 0xff000, 0xff000000, and 0xf000000f.
Invalid constants: 0x101, 0x102, 0xff1, 0xff04, 0xff003, 0 xffffffff, and 0xf000001f ."
At first I wondered: What is "an eight-bit constant? The conclusion is: any number of 8 bits, that is, 0 × 00 (0000 0000 )~ 0xff (1111 1111) is an 8-bit constant that meets the conditions.
So what is the concept of "moving the even digits right of a loop? In fact, it is to add 0 before the above 8-bit constant. After 32 bits are added, the even bits are shifted to the right.
For example:
For example, after 0x0f (0000 1111) is expanded to 0x0000000f (0000 0000 0000 0000 0000 0000), The right shift of the loop (such as two digits) followed by 0xc0000003 (1100 0000 0000 0000 0000 0000 0000 ). Therefore, 0xc0000003 is also the valid immediate number of an arm.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.