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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 15:30, DestinyK8033
Why would a programmer use the logical operator and in an if statement? a: when an action is to be taken that requires both conditions to be falseb: when an action is to be taken that requires both conditions to be truec: when an action is to be taken that requires the first condition to be falsed: when an action is to be taken that requires the second condition to be truei took the test and the answer is b.
Answers: 3
image
Computers and Technology, 23.06.2019 15:30, jasssp
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
image
Computers and Technology, 23.06.2019 21:00, kkpsmith
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
image
Computers and Technology, 24.06.2019 09:50, potatocow
Self contained sequences of actions to be performed are? a. expressions b. algorithms c. functions d. formulas
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 in other subjects: