lab8

lab8 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6.004 Computation Structures - 1 - Lab #8 M A S S A C H U S E T T S I N S T I T U T E O F T E C H N O L O G Y DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE 6.004 Computation Structures Lab #8 Instructions 1. Make a private copy of /mit/6.004/bsim/lab8.uasm 2. Run lab8.uasm and look through the code to figure out how it works 3. Modify lab8.uasm as described below and test your changes 4. There is no automated check-in for the lab. When you are ready for checkoff, schedule a short meeting with a TA during his or her lab hours (preferably during the less hectic times early in the week). Bring along a copy of the Lab 8 Writeup which will be filled out during your meeting. If you work from home , remember to upload your program onto Athena so you can demonstrate its operation during the meeting. Step 0: Run lab8.uasm and look through the code Lab8.uasm is a program that implements a simple timesharing system. When you use BSim to load, assemble and then run lab8.uasm, the following prompt should appear in the console pane of the Bsim Display Window: Start typing, Bunky. 00000000> As you type, each character is echoed to the console and when you hit return the whole sentence is translated into Pig Latin and written to the console: 00000000> 6.004 is a fun course 6.004AY ISAY AAY UNFAY OURSECAY 00001F61> The hex number written out as part of the prompt is a count of the number of times one of the user-mode processes has been scheduled while you typed in the sentence.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.004 Computation Structures - 2 - Lab #8 Lab8.uasm implements the following functionality: Kernel-mode interrupt routine for handling input from the keyboard. Incoming characters are stored in a kernel buffer for subsequent use by user-mode programs (see the GetKey() supervisor call). Kernel-mode supervisor call dispatching and a repertoire of call handlers that provide simple I/O services to user-mode programs. Handlers include o Halt() – stop a user-mode process o WrMsg() – write a null-terminated ASCII string to the console. The string immediately follows the WrMsg() instruction; execution resumes with the instruction following the string. For example: WrMsg() .text “This text is sent to the console…\n” …next instruction… o WrCh() – write the ASCII character found in R0 to the console o GetKey() – return the next ASCII character from the keyboard in R0; this call does not return to the user until there is a character available. o
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

lab8 - MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online