Computers and Technology

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

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, coollid876
To increase sales, robert sends out a newsletter to his customers each month, letting them know about new products and ways in which to use them. in order to protect his customers' privacy, he uses this field when addressing his e-mail. attach bcc forward to
Answers: 2
image
Computers and Technology, 22.06.2019 15:50, minideeri
The file sales data. xlsx contains monthly sales amounts for 40 sales regions. write a sub that uses a for loop to color the interior of every other row (rows 3, 5, etc.) gray. color only the data area, columns a to m. (check the file colors in excel. xlsm to find a nice color of gray.)
Answers: 2
image
Computers and Technology, 23.06.2019 00:30, Thisisdifinite
Which of the following would you find on a network
Answers: 3
image
Computers and Technology, 23.06.2019 20:00, emmaraeschool
Me ajude por favor , coloquei uma senha e não consigo tira-la no chorme
Answers: 2
Do you know the correct answer?
This program #1, you are required to develop a program that takes a numeric input (0 to 63) and conv...

Questions in other subjects: