CPS4200 System Programming Spring 1 Systems Programming Chapter 1 Background I
CPS4200 System Programming Spring Introduction What is System software? –Programs that support the operation of a computer –Support the use of the computer itself –Usually related to the architecture of the machine
CPS4200 System Programming Spring 3 System Software Assembler –System software that performs the fundamental functions of translating mnemonic operation codes (language) to their machine equivalents. Linker –Software that combines two or more separate object programs and resolve references between them
CPS4200 System Programming Spring 4 System Software Loaders –System program that performs the loading of the object program into memory for execution Macro Processor –System program that replaces each macro instruction with the corresponding group of source language statements.
CPS4200 System Programming Spring 5 System Software Text Edit –Program (system or application) that allows the creation, revision, saving and printing of a document. Utility Programs –System programs that allow the user to perform tasks that are not available with the original operating system.
CPS4200 System Programming Spring 6 System Software Communications Software –Software that transmits and receives data either character by character (block by block) over communication lines. Screen Saver –Interrupt driven software that saves the elements of the screen of a monitor Terminal Emulation Software –Real time program that must service both the key board and the communication hardware
CPS4200 System Programming Spring 7 Major Topics Assembler Loader Linker Macro processor Operating system Relationship between system software and machine architecture Design of an assembler, operating systems…. System Programming
CPS4200 System Programming Spring System Software and Machine Architecture System software is machine dependent Some of the design, logic, techniques and process are machine independent A simplified Instructional Computer (SIC) is a hypothetical machine that has been designed to include the hardware features most often found on real machine. It will be used to begin the design of system software.
CPS4200 System Programming Spring The Simplified Instructional Computer (SIC) Two version: –standard model - SIC and –XE (Extra Equipment) version - SIC/XE
CPS4200 System Programming Spring SIC Machine Architecture Standard Model - SIC Memory: –8-bit byte; byte address –3 consecutive bytes form a word (24 bits) –Total 32,768 (2 15 )bytes in computer memory Register –5 registers, each 24 bits (See next slide)
CPS4200 System Programming Spring SIC Machine Architecture Register Mnemonic Number special use A0Accumulator, used for arithmetic operation X1Index register; used for addressing L2Linkage register; the Jump to subroutine (JSUB) instruction stores the return address in this register PC8Program counter; contains the address of the next instruction to be fetched for execution SW9Status word; contains a variety of information, including a Conditions Code (CC)
CPS4200 System Programming Spring SIC Machine Architecture Data Format: –Integer: 24-bit binary numbers –Negative number: 2’s complement representation –Character: 8-bit ASCII codes –No floating hardware
CPS4200 System Programming Spring SIC Machine Architecture Instruction Formats: –24-bit format X indicates indexed-addressing mode. –Example? opcode 8 x 1 15 address
CPS4200 System Programming Spring SIC Machine Architecture Addressing Modes: –The target address is calculated from the address given in the instruction. –Parentheses are used to indicate the contents of a register or a memory location. For, Example, (X) represents the contents of register X. ModeIndicationTarget address calculation Directx=0TA = address Indexx=1TA = address + (X)
CPS4200 System Programming Spring SIC Machine Architecture Instruction Set: –Load and store (LDA, LDX, STA, STX..) –Integer arithmetic operation: (ADD, SUB, MUL, DIV). All arithmetic operation involve register A and a word in memory. –Compare the value in register A with a word in memory: COMP, it sets a condition code: Condition code: CC indicate the result ( ) –Condition jump: (JLT, JEQ, JGT) can test the setting of CC and jump accordingly. –Jumps to subroutine: JSUB and places the return address in register L. RSUB returns by jumping to the address contained in register L.
CPS4200 System Programming Spring SIC Machine Architecture Input and output –Transferring 1 byte at a time to or from the rightmost 8 bits of register. –Each device is assigned an unique 8-bit code. Test Device (TD): test whether the addressed device is ready to send or receive a byte. The condition code is set to indicate the result of this test. ( “<” means ready, “=” means not ready) The program needing to transfer data must wait until the device is ready. Read Data (RD) or Write Data (WD)
CPS4200 System Programming Spring SIC/XE Machine Architecture Memory: –1 megabyte address (2 20 Byte) Register –9 registers, each 24 bits, additional registers are: Mnemonic Number special use B3Base register; used for addressing S4General working register - no special use T5General working register - no special use F6Floating-point accumulator (48 bits)
CPS4200 System Programming Spring SIC/XE Machine Architecture Data Formats: –In addition to 24-bit format, there is a 48-bit floating – point data type –For normalized floating-point numbers, the high-order bit of the fraction must be 1. –The exponent has value e and the fraction have value f, the absolute value of the number represented is – f * 2 (e- 1024) with bias 1024 exponent 11 s 1 36 fraction
CPS4200 System Programming Spring SIC/XE Machine Architecture Instruction Formats: –The standard instruction format (15 bits address) is no longer suitable due to larger memory available.