Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Assembly (http://www.programmingforums.org/forum20.html)
-   -   Flag Question (http://www.programmingforums.org/showthread.php?t=15383)

Grich Mar 10th, 2008 6:56 PM

Flag Question
 
Another question from me. Although I am a noob at assembly, I love learning it.:D

My questions are:
  • What are flags?
  • When are they used?

Thanks in advance guys.

Benoit Mar 10th, 2008 7:12 PM

Re: Flag Question
 
Flags are just a collection of bits that tell you different things about the current state of the processor. For example, if you do a byte addition and the result is greater than 255, then the carry flag will be set. The zero flag is also popular, to signify that the result of a computation is zero. The sign flag tells you if a number is interpreted as signed or unsigned. Most CPU's have atleast those three.

mrynit Mar 10th, 2008 8:06 PM

Re: Flag Question
 
flags can be single bit registers, or memory mapped registers.
they are used in conditional operations. branch on negative/zero/positive


All times are GMT -5. The time now is 9:43 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC