943,812 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 1018
  • Assembly RSS
Nov 8th, 2008
0

NEG flags question

Expand Post »
Hi! I have the following code:
asm Syntax (Toggle Plain Text)
  1. mov al, 5d
  2. neg al

When it executes, CF = SF = AF = 1
Ok, I think I understand why
AF (number is bigger than 00001111b ?),
SF (most significant bit is now 1 not 0)

But what I don't understand is why CF?
I thought it happens only if you go out of boundaries, like if result exceedes FF (100h or above can't fit in bit)

Please, help poor begginer
Reputation Points: 110
Solved Threads: 43
Posting Whiz in Training
Sci@phy is offline Offline
279 posts
since Sep 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: simple help tasm
Next Thread in Assembly Forum Timeline: need help with assembler program





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC