Question: This is a question for my assignment, please respond with the correct answers. Use the Arc Tool for this question. Will upvote definitely, thanks! Doing
This is a question for my assignment, please respond with the correct answers. Use the Arc Tool for this question. Will upvote definitely, thanks!

Doing I/O using ARC Memory Mapped I/O ARC does not have any explicit I/O instructions. I/O is then done by reading from and writing to pre-defined memory locations in the memory which are assigned to I/O devices. This is known as memory mapped 1/0. Each I/O device has a data port. Similarly, each device has a status port that is used to test the readiness status of the 1/0 device. For the purpose of this lab, we are interested in using the ARC simulator to use: The console output port to display characters The keyboard input port to read characters 1) Please provide comments for all instructions. 2) What is the memory mapped address for the console output and keyboard input? 3) Please identify the specific line of code that prints to console and reads the keystroke. PART B - INPUT: Accepting character from the keyboard The memory addresses associated with the keyboard input I/O device are: - Oxffff0008 is keyboard (input) data port OxffffOOOC is the keyboard (input) status port where bit 7 is the ready flag (0: not ready, 1: ready) Reading a character is achieved by: checking the ready flag to see if the keyboard is ready, i.e., check if the bit 7 is set to 1 loading the character from the keyboard data port ! Read a character from keyboard .begin BASE .equ Ox3fffco COUT .equ Oxo COSTAT .equ Ox4 CIN .equ Ox8 CICTL .equ Oxc !Starting point of the memory mapped region !Oxffff000 Console Data Port !Oxffff0004 Console Status Port. !OxffffO008 Keyboard Data Port Oxffffoooc Keyboard Control Port .org 2048 add %ro, %ro, %r4 sethi BASE. %r4 !Clear r4 InWait: halt Id [%r4 + CICTL), %r1 andcc%r1, 0x80, %r1 be InWait Id [%r4 + CIN], %r3 subcc%r3, 27, %r5 be End ! 27 is Escape ! stop if it is Wait: Id [%r4 + COSTAT], %r1 andcc %r1, 0x80, %r1 be Wait st %r3, [%r4 + COUT] ba InWait End: halt .end Doing I/O using ARC Memory Mapped I/O ARC does not have any explicit I/O instructions. I/O is then done by reading from and writing to pre-defined memory locations in the memory which are assigned to I/O devices. This is known as memory mapped 1/0. Each I/O device has a data port. Similarly, each device has a status port that is used to test the readiness status of the 1/0 device. For the purpose of this lab, we are interested in using the ARC simulator to use: The console output port to display characters The keyboard input port to read characters 1) Please provide comments for all instructions. 2) What is the memory mapped address for the console output and keyboard input? 3) Please identify the specific line of code that prints to console and reads the keystroke. PART B - INPUT: Accepting character from the keyboard The memory addresses associated with the keyboard input I/O device are: - Oxffff0008 is keyboard (input) data port OxffffOOOC is the keyboard (input) status port where bit 7 is the ready flag (0: not ready, 1: ready) Reading a character is achieved by: checking the ready flag to see if the keyboard is ready, i.e., check if the bit 7 is set to 1 loading the character from the keyboard data port ! Read a character from keyboard .begin BASE .equ Ox3fffco COUT .equ Oxo COSTAT .equ Ox4 CIN .equ Ox8 CICTL .equ Oxc !Starting point of the memory mapped region !Oxffff000 Console Data Port !Oxffff0004 Console Status Port. !OxffffO008 Keyboard Data Port Oxffffoooc Keyboard Control Port .org 2048 add %ro, %ro, %r4 sethi BASE. %r4 !Clear r4 InWait: halt Id [%r4 + CICTL), %r1 andcc%r1, 0x80, %r1 be InWait Id [%r4 + CIN], %r3 subcc%r3, 27, %r5 be End ! 27 is Escape ! stop if it is Wait: Id [%r4 + COSTAT], %r1 andcc %r1, 0x80, %r1 be Wait st %r3, [%r4 + COUT] ba InWait End: halt .end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
