Question: LCM Program START INP / / Input the first number STA NUM _ A / / Store first number in address NUM _ A INP
LCM Program
START INP Input the first number
STA NUMA Store first number in address NUMA
INP Input the second number
STA NUMB Store second number in address NUMB
CheckFirstNum
LDA NUMA Load the first number
BRP SECONDNUM Branch to SECONDNUM, if first number is positive
LDA NEGATIVEONE Load
OUT Output
BRA CHECKNEGATIVE Branch to CHECKNEGATIVE to continue
CheckSecondNum
LDA NUMB Load the second number
BRP CHECKDIVISION Branch to CHECKDIVISION, if second num is positive
LDA NEGATIVEONE Load
OUT Output
BRA CHECKNEGATIVE Branch to CHECKNEGATIVE to continue
CheckNegative
LDA NUMA Load the first number into ACC
BRP CHECKSECNEG Branch to CHECKSECNEG, if first num is positive
LDA NUMA load the first number again into ACC
STA LOCATIONA Store it in LOCATIONA
CheckSecondNegative
LDA NUMB Load the second number into ACC
BRP CHECKDIVISION Branch to CHECKDIVISION, if sec number is positive
LDA NUMB Load the second number again into ACC
STA LOCATIONB Store it in LOCATIONB
BRA CHECKDIVISION Branch to CHECKDIVISION
CheckDIvision
LDA NUMA Load the first number into ACC
DIV NUMB Divide ACC by the second number
STA QUOTIENT Store the Quotient
LDA QUOTIENT Load the Quotient
MUL NUMB Multiply the quotient by the second number
SUB NUMA Subtract the first number
BRZ OUTPUTRESULT If the result is then branch to OUTPUTRESULT
LDA ZERO Load in ACC
OUT Output as result
BRA START Branch to the start to input new values
Output results
LDA QUOTIENT Load the quotient
OUT Output quotient
END HLT HALT the program
NUMA DAT Memory space for the first number
NUMB DAT Memory space for the second number
QUOTIENT DAT Memory space to store quotient
LOCATIONA DAT Temporary storage for first number
LOCATIONB DAT Temporary storage for second number
NEGATIVEONE DAT Store
ZERO DAT Store
please explain all of this to me and create a flow chart
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
