Question: Write pseudocode for a program which allows the user to input two numbers (X and Y) and a code C. If the code has value
Write pseudocode for a program which allows the user to input two numbers (X and Y) and a code
C. If the code has value 1, the program should output the larger of X and Y and otherwise output the smaller. Now convert your pseudocode to an assembly language program use the attached image to help.
Message load x x -> R R -> x store x clear x 0 -> x add x R + x -> R increment x x + 1 -> x R - x -> R subtract x x - 1 -> x if x > R then decrement x compare x 100 -> CCR elseif x < R then 001 -> CCR elseif x = R then 010 -> CCR jump x goto x jumpgt x goto x if CCR = 100 %3D jumpeq x goto x if CCR = 010 jumplt x goto x if CCR 001 goto x if CCR != 010 jumpneq x in x store input in x out x output x halt
Step by Step Solution
3.54 Rating (151 Votes )
There are 3 Steps involved in it
Pseudo code begin read xy read code if code1 begin if xy display x is larger else display y is ... View full answer
Get step-by-step solutions from verified subject matter experts

