Completely Solved C, C++ Programs Assignment.




The SBS-1 System-Operating Instructions

Filed Under:

Operating Instructions: 
What It Does
The things we can do with the basic SBS-1 kit are:
• Examine the contents of all memory and register locations.
• Deposit program steps or data in RAM or register locations.
 • Execute programs or subroutines upon command.
• Reset (start) the monitor upon command.
• Interrupt and start operation at a location we specify upon command.

  We may select either the keyboard and display on the board or a CRT terminal as the console device (optional interface) by operating a switch. Keyboard/display operation and CRT terminal operation are described separately in the following paragraphs. 
  Two of the keyboard buttons continue to function in CRT terminal mode as well as keyboard/display mode. These are the RESET and the VECT INTR keys. 

  The Buttons and Displays: 
 Keyboard/display operation is done by pressing keys on the keyboard. Responses are displayed either by echoing the key pressed or by prompting us with a message or prompt. When the RESET button is pressed the monitor is ready to accept commands. For numeric arguments the valid range is from 1 to 4 hexadecimal digits for address information and 1 to 2 hexadecimal digits for register and memory data information. Longer numbers may be entered bur in each case only the last four of the last two digits entered will be accepted. 

 Whenever the monitor expects a command the display shows the prompt “1” at the left edge of the address field (possibly along with an error message). When the monitor expects a parameter, a decimal point will be displayed at the right edge of the field into which the argument will be placed. A parameter will be either an address or a byte of data, which is used during the execution of a command. In the description of the command modes, upper case letters enclosed in () are the command keys. 

  RESET 
 The RESET key causes a hardware reset and starts the monitor again. The message “SBS1” will be displayed across the address and data field of the display if we are in the display-keyboard mode. If we are in CRT terminal mode the sign on message: SBS-8085 VER 1” will be displayed. The monitor is ready to accept a command after a reset and saves no information about the state of any user program before the reset. 

 Substitute Memory (SUBST MEM) 
 (SUBST MEM) address (NEXT) data (NEXT) data…(NEXT) data (EXEC). 
The substitute memory command allows us read the contents of ROM memory and to examine and modify the contents of ROM memory locations. 

The address argument denotes the contents of the memory address to be examined and may be from 1 to 4 hex digits. If we enter longer numbers only the last 4 digits entered are used. As soon as the number is terminated by a next key the content of the location is shown is the data field, along with a decimal point at the right edge of the field. Entering a new number will cause that number to be displayed in the data field. However the contents of the memory location will not be changed until an (EXEC) or (NEXT) key is pressed. 

Pressing (NEXT) will place the contents displayed in the data field into the displayed memory address. Then the address and contents of the next higher memory location will automatically be shown. Pressing (EXEC) will place the contents of the contents displayed in the data field into memory address displayed in the address field and will also terminate the command. Pressing (NEXT) while the address FFFF is being displayed will cause address 0000 to be displayed. 

Whenever the command changes the contents of a memory location, it also verifies whether the change has occurred correctly. If the contents of the location do not agree with the new value (i.e. if the memory location is in ROM or is non-existent) an error message is displayed. 

  Examine Registers (EXAM REG) 
 (EXAM REG) reg name (NEXT) data (NEXT) data…(EXEC). The examine command allows us to display and modify the contents of the 8085 CPU registers. Pressing the EXAM REG key blanks both the address and data fields, and displays decimal point at the right edge of the address field. At this point we must press a register key (register names are denoted by legends on the keyboard). Any other key will display an error message. If a register key is pressed the name of the register will appear in the address field and the contents of the register will be displayed in the data field along with a decimal point at the right hand edge. Entering a number will cause the number to be displayed in the data field, however the contents of the register will not be changed until an EXEC or NEXT key is pressed. 

Pressing NEXT will place the contents displayed in the data field into the register named in the address field, then will display the name and contents of the next register in sequence. Pressing EXEC will place the contents displayed in the data field in the register named in the address field, and will also terminate the command. Pressing NEXT while register PCL is being displayed has the same effect as pressing EXEC. The format of the 1 register in the lower 4 bits of the accumulator following execution of a RIM instruction. A “1” in an interrupt mask field denotes a masked condition. A “0” must be entered to use the interrupt. The format for the1 register is: 
                                  B7       B6       B5       B4          B3        B2        B1       B0
                                  0          0          0          0           1E        M7.5    M6.5    M5.5
           
            M         Interrupt Mask
            1E        Interrupt Enable Flag

  Register Display Sequence 

Key/Display Code      Register
I                                   Interrupt mask
H                                 CPU register H
L                                  CPU register L
SPH                             Most significant byte of stack pointer
SPL                             Least significant byte of stack pointer
PCH                            Most significant byte of program counter
PCL                             Least significant byte of stack pointer

The format for flag byte is:

            B7       B6       B5       B4       B3       B2       B1       B0
            S          Z          X         AC      X         P          X         C
S-Sign
Z-Zero
AC-Aux. Carry
P-Parity
C-Carry
X-Undefined
GO:
            (GO) Address (EXEC)

 Pressing the GO key causes the content of the program counter (PCH and PCL) to be displayed in the address field, along with a decimal point at the right edge of the field. The program counter is available for change and any number entered (a number is optional) becomes the new contents of the program counter. 

 Pressing the EXEC key transfers control of the CPU to the address in the address field (contents of the program counter). Before the transfer of control, the address and data display fields are cleared, and an ‘E’ is displayed at the left edge of the address field. Pressing any other key but EXEC generates an error message. The monitor again regains control of the CPU only after a RESET or after execution of an RST0, RST2 or JMP 0000 instruction. 

VECT INTR (Vector Interrupt) 
 1. The VECT INTR key is similar to the GO key in the respect that it takes control away from the monitor and gives it to another program. The interrupt key causes immediate recognition of RST 7.5 interrupt and control passes to location 003CH in the monitor. This location contains an unconditional branch to instruction location 20CEH in user RAM. We may place an instruction we wish in location 20CE thru 20D) (e.g. branch to a keyboard interrupt routine). The monitor does not regain control without specific action (a RESET, or a RST), RST1, or JMP 0 program instruction). In branching back to the monitor, unless the RST1 instruction is executed, the monitor loses all past information of user program. Since an interrupt is recognized by the hardware, the monitor cannot clear the display; thus the display may remain unchanged after interrupt. 

 Two conditions must be satisfied for the Vector Interrupt feature to be enabled. 
1. Interrupts must be enabled (by executing an E1 instruction) 
2. RST 7.5 must be unmasked (mask reset by the SIM instruction or by modifying the I-register). 

BRP (Break Point) 
 This key (BREAK POINT) is used for program debugging. Using this key, we can execute our program part by part and examine the register contents and memory location in between. As soon as we press BRP key, SA (starting address) will be displayed on the data field. We enter the staring address of our program and press EXEC key. Now EA (End Address) will be displayed in the data field. We enter the address up to which we want to execute our program and press EXEC key. The execution will be done up to the end address and now we can examine the register contents and memory locations. If there be any bug in our program the CPU will be in an infinite loop and to come out of the loop we will have to press VECT INTR button. (If we do not want to use BRP key, we can break our program by placing RST1 instructions at selected RAM locations where we want to examine the CPU status.) 

Error Conditions: Illegal Key 
 If a key is pressed which is illegal in its contest (e.g. a command key is pressed when monitor is expecting the number) the command is aborted and an error is displayed. The monitor is then again ready to accept a new command. The error message “Err” is cleared when a new command key pressed, thus we can cancel a command before we press NEXT or EXEC by pressing any illegal key. 

  Memory Substitution Key
 If the substitute memory commands determine that the contents of a memory location were not changed correctly (i.e. location is in ROM or non-existent) the command is aborted and an error message is displayed. The monitor is again ready to accept another command.


Back to main directory:  Microprocessor    Hardware Practical


Get Free Programming Tutorials and Solved assignments