Beginner Delphi Embedded Assembly [20]

Source: Internet
Author: User
Tags integer

Var

I:integer;

Begin

The integer type is a 4-byte (32-bit) signed integer, the highest digit is a sign bit, and if it is a positive number, the sign bit is 0, and the sign bit of the negative number is 1

So the maximum Integer value is: 01111111 11111111 11111111 111111112

asm
mov I, 01111111111111111111111111111111B;
end;
ShowMessage(IntToStr(I)); {2147483647}

The negative number of a signed integer equals the inverse code + 1 of the same positive number; The maximum Integer value is:

01111111 11111111 11111111 111111112; Its counter code is:

10000000 00000000 00000000 000000002; The counter code + 1 is after:

10000000 00000000 00000000 000000012

asm
mov I, 10000000000000000000000000000001B;
end;
ShowMessage(IntToStr(I)); {-2147483647}

What is the minimum value of the Integer?

Should be: 10000000 00000000 00000000 000000002

asm
mov I, 10000000000000000000000000000000B;
end;
ShowMessage(IntToStr(I)); {-2147483648}

11111111 11111111 11111111 111111112 is?

asm
mov I, 11111111111111111111111111111111B;
end;
ShowMessage(IntToStr(I)); {-1}

0 of the Integer type is in memory: 00000000 00000000 00000000 000000002

asm
mov I, 00000000000000000000000000000000B;
end;
ShowMessage(IntToStr(I)); {0}

The 10010 binary of the Integer type is: 00000000 00000000 00000000 011001002

asm
mov I, 00000000000000000000000001100100B;
end;
ShowMessage(IntToStr(I)); {100}

Calculate the Integer type-10010:

00000000 00000000 00000000 01100100 of the counter code is:

11111111 11111111 11111111 10011011; The counter code + 1 is after:

11111111 11111111 11111111 10011100

asm
mov I, 11111111111111111111111110011100B;
end;
ShowMessage(IntToStr(I)); {-100}
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.