Project 8: Monitor Program

(Two Week Project)

 

1. Goals

 

a.  To learn about system interface through terminal.

b.  To learn how to write a simple monitor program.

c.  To learn about a menu driven system.

d. To learn about the use of buffer.

 

2. Introduction

 

            In this project, you will design a simple monitor that allows examination of memory, machine code programming, downloading from other computers, reading directory, and execution of programs. A monitor is itself a program that provides an interface between the user and computer at the low level. In general, monitors provide a way of loading a program to primary memory (RAM), test memory, examine registers, move or copy memory, and run programs. It also provides all basic input and output (BIOS) functions. The monitor your will write in this project will be very simple, but will have essential commands: 1) memory modify, 2) download, 3) list, 4) run or execute. These are very limited functions, but they will allow you to write any program, examine memories, and run codes, i.e. sufficient to be a complete system.

 

 

3. Project Description

 

Implement a monitor for 68HC11EVB that includes functions: 1) Memory Modify, 2) Download, 3) list, 4) Go using a menu driven system.

 

Details

Systems can be designed as either 1) menu driven or 2) command-line based. Menu driven systems provide a menu to the user for a system function selection, while command-line based systems require direct command entry following the required format or syntax. In general, menu driven systems are more user friendly, but has a weakness in limited options requirement of more memory. We can say that the Buffalo monitor is a command driven system and not user friendly. In this project, you will choose a menu driven system for your implementation. Follow the directions provided below.

 

1) First, write a program that displays your system menu on the terminal:

 

              Mark's Computer    (you may use your name or other choices here)

              1. Memory Modify

               2. Download

              3. List Directory          

              4. Run

              5.  Exit to Buffalo

 

              Enter Selection ?

 

Now, add ``jsr Getchar'' (or jsr ffcd) to the end of the above display routine in order to receive the user's responses from the keyboard (or terminal). Next, you need to implement each function and connect the user’s choice.

 

2) Write ``1. Memory Modify'' routine that works as follows:

Here we will develop a simple but very convenient Memory Modify function that is better than the Buffalo monitor’s version.

 

The first action of Memory Modify function is to obtain the address information of the memory to be accessed from the user. Use a prompt sign to get a proper communication with the user. For example,

 

Address ?

or

Address>

 

When the user enters the address information, save it to a buffer. Allow delete (back-space key) to correct typos by user. Convert the ASCII string into the corresponding HEX number which would be the address information that the user wants to access. You may write it as a subroutine called “GetAddress” and use it over again in other commands.

 

After obtaining the address information, the content of the address is then displayed by the following format. The first 4-digits are used for address; the next two digits followed by some spaces are used for the memory content of the address; the next digit is used for a prompt sign, and the last portion is used for the data that the user will enter.

 

The basic format by an example is:

 

 

 

 

D000  cf   ?  _

 

    This line indicates that the address D000 has the data cf. Then “?” is used to say to the user “how would you like to change?”. (“ _ “ simply represents the cursor position.) Now the user has the following four options:

                 (a) enter one byte data followed by <CR>--- normal entry of data,

         (b) hit <CR>  --- move to the next location without changing the content of the present                              memory,

                 (c) hit ^B (=02) --- go back to previous address,

                 or

                 (d) hit ESC --- go back to the main menu.

 

     The other cases must be simply an error condition in which you display an error message to the terminal. Again, allow the user to correct his/her data entry. If you use a buffer concept, this can be easily implemented.

    

     The following shows the sequence of examples that may occur in the Memory Modify command.

 

     Enter address> C000 <CR>

     C000  ed  ? 34 <CR>

     C001  23  ? 24 <CR>

     C002  45  ? <CR>

     C003  36  ? <^B>         ; go back to previous location

    C002   45  ?  <^B>

    C001   24  ?  <ESC>

 

              Mark's Computer   

              1. Memory Modify

               2. Download

              3. List Directory          

              4. Run

              5.  Exit to Buffalo

 

              Enter Selection ?

 

3) Implement the “2. Download” function.

       Use the code written in the Lab 7.

 

4) Implement the “3. List Directory” function.

       When user makes this selection, your system simply displays the directory of your account. It can be implemented by sending “ls –CF” to the host computer and by displaying the received string to the terminal.

5) Implement the “4. Run” function.

     The Run (or execute) function can be implemented in general by two means: 1) jsr, or 2) jmp. This time, you will implement the "Run" function using "jsr".  In this case, all user programs must be written as a subroutine. The run function is then implemented by,

 

                 (a) jsr GetAddress,       ; a subroutine that gets address information from user

                 (b) jsr 0,x                       ; assumed that the address information is stored in IX-register.

                 (c) jmp menu.

 

6)  Exit to Buffalo can be implemented by the “swi” instruction.

    

 

4. Check-OFF/Report

 

Check-Off Due Date: Nov. 18 Thursday.        

            For check-off prepare a sample program for a demo of the run function. Also, clearly define your memory map, so that you know which area is used for what purpose.

Report Due Date: Nov. 22 Monday

 

This project will be worth 150 points. Penalty for each day late would be 15 points.