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 0 ->x clear x R x R. add x increment x x 1 x subtract x R. decrement x x 1 x if x R then. Compare 100 CCR else if x R then 001 CCR else if x R then 010 CCR jump x goto goto x if CCR. 100 jumpgt jumpeq goto x if CCR. 010 x jumplt x goto x if CCR. 001 goto x if CCR 010 jumpneq x in x store input in x (out X output halt

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

1 Expert Approved Answer
Step: 1 Unlock

Pseudo code begin read xy read code if code1 begin if xy display x is larger else display y is ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!