Question
can someone explain what this program is and what each line means also an explanation of the whole code, this is for the little mans
can someone explain what this program is and what each line means also an explanation of the whole code, this is for the little mans computer. please reply ASAP this is due at 7. Thanks
loop INP
STA NUM1
INP
STA NUM2
LDA NUM1
SUB NUM2
BRZ eq
BRP gt
LDA two
OUT
BRA loop
eq LDA one
OUT
BRA loop
gt LDA zero
OUT
BRA loop
NUM1 DAT
NUM2 DAT
zero DAT 1
one DAT 0
two DAT -1
-------------------------------
2nd program
INP
STA first
INP
STA second
INP
STA third
SUB first
BRP branch1
LDA first
STA temp
LDA third
STA first
LDA temp
STA third
branch1 LDA
SUB second
BRP branch2
LDA second
STA temp
LDA third
STA second
LDA temp
STA third
branch2 LDA third
OUT
LDA first
SUB second
BRP branch3
LDA second
OUT
LDA first
OUT
HLT
branch3 LDA first
OUT
LDA second
OUT
HLT
first DAT
second DAT
third DAT
temp DAT
-----------------
THANKS
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