[3 marks each] Each part of this problem gives a pseudo-code fragment with an if
ID: 3597594 • Letter: #
Question
[3 marks each] Each part of this problem gives a pseudo-code fragment with an if-structure, and some assumptions about its variables. Give an assembly code fragment that is equivalent to the pseudo-code. Assume that general-purpose registers eax-edx are available for any task. Pseudo-Code Assumptions a) if count > value count andvalue are 32-bit, signed integers count is in eax, and value s in memory . then count : 0 end if; b)|If a+b=c 32-bit, signed a,b and c are integers, in memory checkis in ah . then check := 'Y, else check := 'N' end if; c)| if (c- a') and (c = 1A') and (cExplanation / Answer
a)
cmp eax,value
jg label_one
label_one : mov eax,0
jg: jump if greater. used for signed variables. cmp will substract eax and value. and set t he condition flag.
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.