Under Windows: Big-endian alignment and small-end alignment

Source: Internet
Author: User

What is the smallest unit of memory in your computer? is byte, which is bytes.
A data type greater than byte is stored in memory in order of precedence.

high memory address put an integer high, low memory address put an integer low, this way is called inverted put, the term is called small end alignment . both the computer X86 and the mobile arm are small-aligned.

high memory address put an integer low, lower memory address put an integer high, this way is called positive, the term is called big- endian alignment . many UNIX server CPUs are in the big-endian alignment.

Define a variable A of type int, and under VS2017 you can see how it is arranged in memory as follows:

So how do you look at the memory under the VS2017 compiler?

1. First open the VS2017 compiler, create a good project, and write the test code in.

2, debugging the time to do the corresponding breakpoint , and then click Start Debugging.

The steps are: On the tab click: Debug (D)--Start Debugging (S)

After: debug (D)--Window (W)--Memory (M)--memory (1) 1

3. Enter the address you want to view in the address bar of the Memory 1 window , and the value of the Auto window to see the address.

Operation results such as:

Indicates that the Windows system is stored in memory for a data type larger than byte : small-aligned.

Under Windows: Big-endian alignment and small-end alignment

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.