-
December 12th, 2005, 12:15 AM
#1
Check this little assignment...
Dear Gurus!
I'm just begginner level student of assembly and I found the following question in my assignment. However, I've solved it but I want confirmation about its correctness, and if it isn't correct, please do it. (These results have been achieved by using NASM assembler).
Problem: Fill out the corresponding values in HEX in the register table after the execution of each instruction.
Code:
Instructions AL Carry Flag
mov al, 5dh
shr al, 3
mov al, 3ch
sar al, 6
mov ax, 12d4h
rol ax, 7
rcr ax, 2
sar ax, 1
Solution:
Instructions AL Carry Flag
mov al, 5dh 5d 0
shr al, 3 0b 1
mov al, 3ch 3c 1
sar al, 6 00 1
mov ax, 12d4h 12d4 1
rol ax, 7 00 0
rcr ax, 2 00 0
sar ax, 1 00 0
Highly thanx.
Mood.
-
December 12th, 2005, 08:55 AM
#2
Re: Check this little assignment...
Unfortunately, starting with line 'rol ax, 7' your results appear to be incorrect. I will not write you correct results here, jus will let you rethink this problem again . You can complete this task with writing program and debugging it with some debugger (TD, Visual Studio inline assembly, or maybe there is some debugger coming with NASM?).
Regards,
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
December 12th, 2005, 11:30 PM
#3
Re: Check this little assignment...
Dear Hobson!
I've checked again this assignment and the solution with some changes is here. Now please check it critically. Actually, I want to get full marks in this assignment.
Code:
Instructions AL Carry Flag
mov al, 5dh
shr al, 3
mov al, 3ch
sar al, 6
mov ax, 12d4h
rol ax, 7
rcr ax, 2
sar ax, 1
Solution:
Instructions AL Carry Flag
mov al, 5dh 5d 0
shr al, 3 0b 1
mov al, 3ch 3c 1
sar al, 6 00 1
mov ax, 12d4h d4 1
rol ax, 7 09 1
rcr ax, 2 82 0
sar ax, 1 41 0
Thanx a lot.
Mood
-
December 13th, 2005, 02:35 AM
#4
Re: Check this little assignment...
Now your solution seems to be OK. I wish you full marks for this assignment, but I think that it would be really good if you learn how to check this by yourself using debugger.
Regards,
Hob
B+!
'There is no cat' - A. Einstein
Use [code] [/code] tags!
Did YOU share your photo with us at CG Members photo gallery ?
-
December 13th, 2005, 05:50 AM
#5
Re: Check this little assignment...
Dear Hobson!
Being student of very beginner level, I'm trying to understanding the debugger's usage, but I'm not confirmed about the results, so I drop a request for check.
However, thanx a lot for guiding.
Mood.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|