Question
Compare AB, AC, BC, winner gets one point each time. As you get a point you shift your address in memory (become second, third as
Compare AB, AC, BC, winner gets one point each time. As you get a point you shift your address in memory (become second, third as you realize you are greater).
______________
LOAD firstaddr
STORE winsA
STORE winsB
STORE winsC
__________________
INPUT
STORE A
INPUT
STORE B
INPUT
STORE C
____________________
compareAB, LOAD A
SUBT B
SKIPCOND 000
JUMP AGB
LOAD winsB
ADD One
STORE winsB
JUMP compareAC
___________________
AGB, LOAD winsA
ADD One
STORE winsA
____________________
compareAC, LOAD A
SUBT C
SKIPCOND 000
JUMP AGC
LOAD winsC
ADD One
STORE winsC
JUMP compareBC
_________________
AGC, LOAD winsA
ADD One
STORE winsA
___________________
compareBC, LOAD B
SUBT C
SKIPCOND 000
JUMP BGC
LOAD winsC
ADD One
STORE winsC
JUMP print
___________________
BGC, LOAD winsB
ADD One
STORE winsB
___________________
print, LOAD A
STOREI winsA
LOAD B
STOREI winsB
LOAD C
STOREI winsC
_____________________
LOAD first
OUTPUT
LOAD second
OUTPUT
LOAD third
OUTPUT
___________________
HALT
_________________
winsA, hex 0
winsB, hex 0
winsC, hex 0
A, DEC 0
B, DEC 0
C, DEC 0
first, dec 0
second, dec 0
third, dec 0
One, DEC 1
firstaddr, hex 03E
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started