Character - Machine Organization - Home Work, Slides of Computer Science

Some concept of Machine Organization are Anatomy, Cache Access Time, Instruction Formats, Instruction Formats, Instruction Formats, Multidimensional Meshes, Network Processors, Snooping Protocol. Main points of this lecture are: Character, Polling, Keyboard, Monitor, Program, Identify, Snapshots, Some Simulator, Snapshots, Interrupts

Typology: Slides

2012/2013

Uploaded on 04/30/2013

ekaan
ekaan 🇮🇳

4.5

(4)

54 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
HW 10
1) Write an LC-3 assembly program to echo characters typed on a keyboard to the
monitor until a “null” character is typed (or maybe an ESC, since there is no
‘Null” on the keyboard). Use polling to test for the keyboard and the monitor
being ready.
Verify your program runs correctly. Document this with some simulator
snapshots. Of course, identify why you chose these snapshots and what the
snapshots are displaying.
2) Modify your program to use interrupts to service the keyboard. The keyboard
service routine will now echo the character to the monitor using polling to test
for the monitor being ready to receive another character. Let it run forever,
i.e. don’t check for a “null” or an ESC. Your program needs to have a stack!
The Keyboard is the only device that has interrupt capability in the LC-3
simulator. The Keyboard’s Interrupt Vector # is x0180. You must load that
Interrupt Vector with the location of your interrupt service routine, and don’t
forget to set the interrupt enable bit in the Keyboard Status Register.
Also, when the interrupt Service Routine begins to be executed, the service
routine should immediately disable further interrupts (so that you won’t get
another interrupt before you service the present one). You can disarm the
interrupts by either reading the device data register, or by turning off the
interrupt enable bit (and then, of course, turning it back on just before you
leave the service routine). Reading the data register is the simplest.
Verify your program runs correctly. Document this with some simulator
snapshots. Of course, identify why you chose these snapshots and what the
snapshots are displaying.
Docsity.com

Partial preview of the text

Download Character - Machine Organization - Home Work and more Slides Computer Science in PDF only on Docsity!

HW 10

  1. Write an LC-3 assembly program to echo characters typed on a keyboard to the monitor until a “null” character is typed (or maybe an ESC, since there is no ‘Null” on the keyboard). Use polling to test for the keyboard and the monitor being ready.

Verify your program runs correctly. Document this with some simulator snapshots. Of course, identify why you chose these snapshots and what the snapshots are displaying.

  1. Modify your program to use interrupts to service the keyboard. The keyboard service routine will now echo the character to the monitor using polling to test for the monitor being ready to receive another character. Let it run forever, i.e. don’t check for a “null” or an ESC. Your program needs to have a stack!

The Keyboard is the only device that has interrupt capability in the LC- simulator. The Keyboard’s Interrupt Vector # is x0180. You must load that Interrupt Vector with the location of your interrupt service routine, and don’t forget to set the interrupt enable bit in the Keyboard Status Register.

Also, when the interrupt Service Routine begins to be executed, the service routine should immediately disable further interrupts (so that you won’t get another interrupt before you service the present one). You can disarm the interrupts by either reading the device data register, or by turning off the interrupt enable bit (and then, of course, turning it back on just before you leave the service routine). Reading the data register is the simplest.

Verify your program runs correctly. Document this with some simulator snapshots. Of course, identify why you chose these snapshots and what the snapshots are displaying.

Docsity.com