How would I write out a program in LC-3 assembly language that prompts users for
ID: 3672883 • Letter: H
Question
How would I write out a program in LC-3 assembly language that prompts users for decimal value input and converts it to 16-bit binary following the provided flow chart below? It must determine whether the input is negative as well. LF is line feed.
Read in a string and convert it into a two's complement binary integer and then print out the binary representation. Start MASK FILL x8000 FILL 24000 FILL x2000 int 0 flag = 0 GETC flag= 1 yes MASK x8000 x4000 x2000 is char no is char no digit-char-48 int-int x 10 + digit yes is flag yes int !int int-int1 no 1st MASK address count= 15 is count no yes Load MASK digit-int AND MASK is digit 0 Print 0 yes no MASKptr = MASKptr + 1 count- count -1 End Print "1" Note: This flow chart assumes the user only enters a first, if at all, and then only 0-9, ended with an 'enter" keyExplanation / Answer
Please find the link for source code below. :
https://drive.google.com/file/d/0BzN28N5RAjX_bzJ0Nl9TS1hfdFU/view?usp=sharing
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.