subject

Add to the end of user_echo. asm. Enable the program to read an ASCII character from the keyboard (using TRAP_GETC) and output it to the ASCII display (using TRAP_PUTC). Repeat this process in a loop until the user presses the key. Consider which type of loop is appropriate (for, while, do-while). As an aside, the process of taking in a key and displaying right back to a user is known as "echoing" their keystroke. Make certain to test your code BEFORE starting problem #2. ;;; The following code will output "Type Here>" on the ASCII display
;;; then it will then read one character from the keyboard
;;; and output it back to the display
;;; HINT: you could simplify this with a directive called ".STRINGZ" - see your textbook!
CONST R0, x54 ; ASCII code for T
TRAP x01 ; this calls "TRAP_PUTC" in os. asm
CONST R0, x79 ; ASCII code for y
TRAP x01
CONST R0, x70 ; ASCII code for p
TRAP x01
CONST R0, x65 ; ASCII code for e
TRAP x01
CONST R0, x20 ; ASCII code for space
TRAP x01
CONST R0, x48 ; ASCII code for H
TRAP x01
CONST R0, x65 ; ASCII code for e
TRAP x01
CONST R0, x72 ; ASCII code for r
TRAP x01
CONST R0, x65 ; ASCII code for e
TRAP x01
CONST R0, x3E ; ASCII code for >
TRAP x01
;; To-Do
;; add code to "loop" reading characters from keyboard and outputting them to display
;; until the "enter" key is pressed
;; pseudocode of algorithm you must implement for problem #1
;; ;; loop until (R0 == enter)
;; read character from keyboard into R0 using TRAP_GETC
;; write character from R0 to ASCII display using TRAP_PUTC
;; repeat loop...
;; loop_end
END

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:30
Sally is editing her science report about living things. she needs to copy a paragraph from her original report. order the steps sally needs to do to copy the text to her new document.
Answers: 1
question
Computers and Technology, 23.06.2019 08:00
Match the items with their respective descriptions.
Answers: 1
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
Add to the end of user_echo. asm. Enable the program to read an ASCII character from the keyboard (u...
Questions
question
Social Studies, 29.04.2021 21:40
question
Mathematics, 29.04.2021 21:40
Questions on the website: 13722362