Question
2. Each part of this problem contains a design with an until loop. Assume that sum references a doubleword in the data segment and that
2. Each part of this problem contains a design with an until loop. Assume that sum references a doubleword in the data segment and that count is in the ECX register. Give a fragment of 80x86 code that implements the design. I need to have this in assembly language (.asm file).
(a) sum := 0;
count := 1;
repeat
add count to sum;
add 1 to count;
until (sum > 5000);
(b) sum := 0;
count := 1;
repeat
add count to sum;
add 1 to count;
until (sum > 5000) or (count = 40) ;
*(c) sum := 0;
count := 1;
repeat
add count to sum;
add 1 to count;
until (sum 5000) and (count > 40);
(d) count := 30;
sum := 50;
repeat
add count to sum;
subtract 1 from count;
until (count = 0) or (sum 400);
(e) count := 30;
sum := 50;
repeat
subtract count from sum;
add 3 to count;
until (count > 50) and (sum 600);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started