Jump to content

Some questions(8086 instruction set)

- - - - -

  • Please log in to reply
3 replies to this topic

#1
fondi

fondi

    Newbie

  • Members
  • PipPip
  • 19 posts
1).What do aaa and daa instructions in 8086 instruction set do? What are their applications on real world programming?
2).What are the applications of the PF (parity flag) in the 8086 status register? When do people use them?

Thanks :P

Edited by fondi, 25 September 2009 - 08:31 AM.


#2
Guest_h4x_*

Guest_h4x_*
  • Guests
in my opinion those among many many other things are legacy from 70's and 80's.

#3
kresh7

kresh7

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 661 posts
AAA Stands for - (ASCII adjust AL after addition) it Changes contents of AL to valid unpacked decimal. The high order nibble is zeroed.

DAA Stands for - (Decimal adjust AL after addition) - Dunno xD
Posted Image

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
The parity flag is useful for checking whether there's an odd or even number of bits set in the last arithmetic operation. As for DAA, I got this from Intel's instruction reference manual:

Quote

Adjusts the sum of two packed BCD values to create a packed BCD result. The AL
register is the implied source and destination operand. The DAA instruction is only
useful when it follows an ADD instruction that adds (binary addition) two 2-digit,
packed BCD values and stores a byte result in the AL register. The DAA instruction
then adjusts the contents of the AL register to contain the correct 2-digit, packed
BCD result. If a decimal carry is detected, the CF and AF flags are set accordingly.

sudo rm -rf /




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users