Question: First translate the program statements below to the assembly code, then into the hexadecimal code. (5 pts) int X = 4, Y = -10, SUM
First translate the program statements below to the assembly code, then into the hexadecimal code. (5 pts) int X = 4, Y = -10, SUM = 0; if (Y > X) Z = X - Y; else { LOP: SUM += X; Y++; if ( Y != 0 ) goto LOP; } Pseudo code: ORG somewhere load X, inv, inc add with Y 'SPA' if AC is positive (Y > X), skip next jmp to loop (Y is not > X) do 'Z = X - Y' jmp FIN (or 'HLT') LOP, clear AC AGA, add with X 'ISZ Y' (inc Y and if it becomes 0, skip next inst) repeat AGA store to SUM FIN 'HLT' END Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
