- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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)
THEN
AL ← AL + 6;
CF ← old_CF or (Carry from AL ← AL + 6);
AF ← 1;
ELSE
AF ← 0;
FI;
IF ((old_AL > 99H) or (old_CF = 1))
THEN
AL ← AL + 60H;
CF ← 1;
ELSE
CF ← 0;
FI;
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.
Thank you.
- Tags:
- Intel® Advanced Vector Extensions (Intel® AVX)
- Intel® Streaming SIMD Extensions
- Parallel Computing
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page