Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6099347
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:15:47+00:00 2026-05-23T13:15:47+00:00

I am reading ARM assembly book by JR Gibson, chapter 5. In explanation to

  • 0

I am reading ARM assembly book by JR Gibson, chapter 5. In explanation to integer ADD and SUB instructions the table is given for flag updation after calculation of result.

What I am not able to understand is the flag update for unsigned integer addition for 2 integers A, B where A and B are “not both 0” and the result is 2^31-1 < result < 2^32(i.e between 0x7FFFFFFF, 0x100000000)

It states that the above results in flags N=1, Z=0, C=0, V=X (don’t care) being set and instruction mnemonic extensions being interpreted as

EQ = No, NE = Yes, CS = No, CC = Yes, MI = Yes, PL = No, VS, VC = X, HI = No, LS = Yes, LT, GT, LE = X

Why unsigned addition resulting in within 32 bit range value causes setting of N bit (and hence MI and LS are Yes)

What I was expecting is N flag can be set since 31st bit is 1 (counting from bit 0), but the result is anyway positive (i.e PL = Yes, since it is within range 2^31-1 ~ 2^32).

Am I not understanding some thing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:15:48+00:00Added an answer on May 23, 2026 at 1:15 pm

    The N flag is always set to the bit 31 of the result. The processor does not care whether you add or subtract signed or unsigned numbers – the resulting bit pattern is the same in both cases. Similarly, the PL/MI suffixes just check for the N flag; they don’t care whether you consider numbers signed or unsigned.

    Signedness is important for multiplication and division, that’s why those instructions have two mnemonics.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading this book ARM System Developers Guide by Elsevier and I came
reading the SCJP book, I've found something like this in the chapter 1 self-test
Reading the Scala by Example book and there is this example when Martin explains
So I've never done any assembly programming (although I did some reading/reasoning out the
I am having trouble reading serial data from ARM LPC2378 microcontroller. Will I have
Reading the book I found the following: The way of thinking when you model
Reading 'ARM Architecture' on Wikipedia and found the following statement: Registers R0-R7 are the
Reading along with the agile book, it says this in a footnote: ... You
Reading through a paper for the ARM Cortex-M3 CPU I found this line confusing:
Reading the Jon Skeet book, I have found (some time now) the use of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.