I'm currently writing a x86 code emulator.
So I need to know detailed instruction's operation.
I was writing a DAA instruction, detailed operation is like this,
old_AL ← AL;
old_CF ← CF;
CF ← 0;
IF (((AL AND 0FH) > 9) or AF = 1)
AL ← AL + 6;
CF ← old_CF or (Carry from AL ← AL + 6);
AF ← 1;
AF ← 0;
IF ((old_AL > 99H) or (old_CF = 1))
AL ← AL + 60H;
CF ← 1;
CF ← 0;
I'm just wondering about whether constant 0x99 is correct or not.
Somebody(from the internet) said 0x9F was right, but the intel manual says 0x99 is right.
Which one is correct?
I need exactly answer from Intel hardware engineering contacts.
- Intel® Advanced Vector Extensions (Intel® AVX)
- Intel® Streaming SIMD Extensions
- Parallel Computing
If the threshold value is 9FH, that meant an input value of 9AH will become A0H, which is not a packed BCD value in one byte.
With the threshold value of 99H, 9AH will be adjusted by DAA into 00H, which is the wrapped result one would expect out of 1 byte packed BCD.