subject

This program #1, you are required to develop a program that takes a numeric input (0 to 63) and converts it to binary. You will use the LMC (Little Man Computer) for this program. The LMC is a decimal only machine and outputs 3 digits (000 - 999). Since 2^6 is 64 combinations, 2 numbers will be output.
For example, a 24 is entered, the first digit out is 011, and the second is 000. Another, 33 input yields a 100 001. You can have an infinite loop or a stop input. The output has leading zero suppression. So a blank is considered a zero Here are the starting lines of code for a solution. Please study them and let me know if you have any questions. #line_label instruction value comment
Here are the starting lines of code for a solution. Please study them and let me know if you have any questions.
#line_label instruction value comment
IN
STO INPUT # STORE DATA IN
SUB 64 # CHECK THAT DATA IS IN RANGE
BRP END # NUMBER OUTSIDE RANGE
LDA INPUT # RESTORE WORKING VALUE
SUB 32 # CHECK FOR 32 OR GREATER
BRP SET_32 # SET OUTPUT
RET_32 LDA INPUT # RESTORE WORKING VALUE
SUB 16 # CHECK FOR GREATER THAN 16
BRP SET_16 # SET OUTPUT
RET_16 LDA INPUT # RESTORE WORKING VALUE
SUB 8 # CHECK FOR GREATER THAN 8
BRP SET_8 # SET OUTPUT
SET_16 STO INPUT # STORE VALUE
LDA OUTPUT_2 # LOAD OUTPUT VALUE
ADD TWO # ADD A VALUE OF TWO
STO OUTPUT_2
BR RET_16
SET_32 STO INPUT
LDA OUTPUT_2
ADD FOUR
STO OUTPUT_2
BR RET_32
RET_1 OUT OUTPUT_2
OUT OUTPUT_1
END HALT
OUTPUT_1 DAT 000
OUTPUT_2 DAT 000
INPUT DAT 000
FOUR DAT 100
TWO DAT 010
ONE DAT 001

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Ou listened to a song on your computer. did you use hardware or software?
Answers: 2
question
Computers and Technology, 23.06.2019 20:10
Leo is a recruitment executive for a large company. he has identified new labor resource requirements in both the marketing and production departments. what should be his first step in recruiting candidates for the positions? a. conduct background checks of candidates b. make job offers c. arrange interviews d. conduct reference checks e. place job ads on job sites
Answers: 1
question
Computers and Technology, 24.06.2019 02:40
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
What is a dashed line showing where a worksheet will be divided between pages when it prints? a freeze pane a split box a page break a print title
Answers: 1
You know the right answer?
This program #1, you are required to develop a program that takes a numeric input (0 to 63) and conv...
Questions
question
Social Studies, 29.03.2021 22:10
question
Arts, 29.03.2021 22:10
question
Mathematics, 29.03.2021 22:10
question
Mathematics, 29.03.2021 22:10
question
Biology, 29.03.2021 22:10
Questions on the website: 13722363