Write an assembly language program using MS Visual Studio to calculate each of t
ID: 3702927 • Letter: W
Question
Write an assembly language program using MS Visual Studio to calculate each of the following equations. You are only allowed to use registers within the CPU (this includes the general purpose registers) for calculations. Variables are allowed only to display the results as you can't reference any CPU registers in printfO. 1) X = 2*(2A-B) + C 2) Y (2C + 1)-(A-2B) 3) Z (2A+C)-B Chose your own values for A, B, and C. Show how your program handle negative number correctly Use integers for your variables. Do individual work.Explanation / Answer
1
ANSWER
Let the value of A=10 , B=20 , C=30 .
start: mov al,2 : al=2
mov bh,A : bh=A
mul bh : al*bh , mul operation always multiply with al register.
mov ch,B : ch=B
sub al,ch : al=ch
mov dh,C : dh=C
add al,dh : al+dh
mov X,al : X=al
int 21d
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.