After the following MASM code is executed: mov eax,11 mov ebx,3 mov ecx,10 add e
ID: 3854933 • Letter: A
Question
After the following MASM code is executed:
mov eax,11
mov ebx,3
mov ecx,10
add eax,ebx
sub eax,ecx
What is the value in the eax register (in decimal)?
What is the value in the ebx register (in decimal)?
What is the value in the ecx register (in decimal)?
Suppose that result is declared as DWORD, and the following MASM code is executed:
mov eax,23
mov ebx,14
mov ecx,6
label5:
add eax,ebx
add ebx,2
loop label5
mov result,eax
What is the value stored in the memory location named result?
After the following MASM code is executed:
mov eax,212
mov ebx,17
mov edx,0
div ebx
What is the value in the eax register (in decimal)?
What is the value in the ebx register (in decimal)?
What is the value in the edx register (in decimal)?
Explanation / Answer
Mov eax,11---->a=11,
Mov abx,3------->b=3,
Mov ecx,10----->c=10,
Add eax,ebx--->eax=11+3+14,ebx=3,
Sub eax,ecx--->eax=14-10=4,ecx=10.
Decimal value of eax=4,
Decimal value of ebx=3,
Decimal value of ecx=10
Mov eax,23
Mov ebx,14
Mov ecx,6
label5:
add eax,ebx
add ebx,2
loop label5
mov result,eax
At the end of 1st loop
Decimal value of eax=37
Decimal value of ebx=16
Decimal value of ecx=5
At the end of 2nd loop
Decimal value of eax=53
Decimal value of ebx=18
Decimal value of ecx=4
At the end of 3rd loop
Decimal value of eax=71
Decimal value of ebx=20
Decimal value of ecx=3
At the end of 4th loop
Decimal value of eax=91
Decimal value of ebx=22
Decimal value of ecx=2
At the end of 5th loop
Decimal value of eax=113
Decimal value of ebx=24
Decimal value of ecx=1
At the end of final loop
Decimal value of eax=137
Decimal value of ebx=26
Decimal value of ecx=0
As Ecx value is 6 loop repeats 6 times
Decimal value in result = 137.
mov eax,212
mov ebx,17
mov edx,0
div ebx
Decimal value of eax=12
Decimal value of ebx=17
Decimal value of edx=8//edx stores remainder of the devision
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.