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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!