Delphi Embedded Assembly [16]-hexadecimal Representation

Source: Internet
Author: User
About hexadecimal:

There are 7 hexadecimal (week), 60 hexadecimal (hour), and 10 hexadecimal (arithmetic) in life.
The computer needs to use 10-, 16-, 2-, and 8.
It is used less in hexadecimal notation, but there are also file attributes on Unix servers, for example.

Binary Systems are easy to recognize by computers. The binary system is easy to recognize by humans. It is said that the binary system originated from ten fingers.

Why do computers use octal and hexadecimal?
Because: 23 = 8; 24 = 16; this is easier to convert to binary.
It can be seen from this that the conversion between binary and 10 is relatively complicated.

The following example illustrates the hexadecimal representation. All seven functions return an integer of 255:

 // decimal function fun0: integer; ASM mov eax, 255end; // a d (case-insensitive) function fun1 can be added after the decimal number: integer; ASM mov eax, 255 dend; // The binary value is followed by B (case-insensitive) function fun2: integer; ASM mov eax, 11111111 bend; // Add O (case-insensitive) function fun3: integer to the end of octal sequence; ASM mov eax, 377 oend; // Add $ function fun4: integer to the front of hexadecimal sequence; ASM mov eax, $ ffend; // The hexadecimal format can also be followed by H (case-insensitive) function fun5: integer; ASM mov eax, 0ffh {using this method, the first digit cannot be a letter, otherwise, it will be considered as an identifier} end; // Delphi that does not compile  Code  only supports representing the hexadecimal function fun6 with $: integer; begin result: = $ ff; end; // Test Procedure tform1.button1click (Sender: tobject); begin showmessage (inttostr (fun0 )); {255} showmessage (inttostr (fun1); {255} showmessage (inttostr (fun2); {255} showmessage (inttostr (fun3 )); {255} showmessage (inttostr (fun4); {255} showmessage (inttostr (fun5); {255} showmessage (inttostr (fun6); {255} end;

   

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.