-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decimal adjustment (DAA) result error #18
Comments
@baikunth2a Can you share an example that is failing? The output you are observering and the expected one will be good to know. |
@debjitbis08 Thanks for responding. Please observe the result of following program. |
@baikunth2a This is happening because the From the documentation, DAA operates as follows:
Hope this helps. |
Hi, I'm facing a similar issue with DAA. Here is my code to convert hex to bcd: ; jmp start ;code loop: ADI 01H skip: DCR C When I insert FF at 2050, the expected output is 55 at 2060 and 02 at 2061; instead I'm getting 13 at 2060 and 0B at 2061. I cross checked my code on these websites: |
Hi, I'm facing a similar issue with DAA. Here is my code to convert hex to
bcd:
`;
jmp start
;code
start: LDA 2050H
MOV C, A
MVI D, 00H
MVI A, 00H
loop: ADI 01H
DAA
JNC skip
INR D
skip: DCR C
JNZ loop
MOV L, A
MOV H, D
SHLD 2060H
hlt`
When I insert FF at 2050, the expected output is 55 at 2060 and 02 at 2061;
instead I'm getting 13 at 2060 and 0B at 2061. I cross checked my code on
these websites:
https://www.tutorialspoint.com/8085-program-to-convert-hex-to-bcd
https://www.zseries.in/embedded%20lab/8085%20programs/hex%20to%20bcd%20conversion.php#.X6Efq3xR201
…On Fri, Oct 23, 2020, 11:31 AM Debjit Biswas ***@***.***> wrote:
@baikunth2a <https://github.com/baikunth2a> Can you share an example that
is failing? The output you are observering and the expected one will be
good to know.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQYBATKWH45FPI6WJOQSXHLSMEKDFANCNFSM4R4BEVVQ>
.
|
@abhishekUpmanyu that's because the AC flag was set by Just load 02H in C and see the result. The expected result is 02H, but due to the |
@jarp0l After |
It adds 06 to any numbers (i.e. although the number is less than 0xA) to adjust decimal using
DAA
after onceDAA
executed for number greater than 0x9.The text was updated successfully, but these errors were encountered: