Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

[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 (c

Explanation / 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.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote