Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Course Objective
Going behind the scenes, gain a deep understanding of how computers actually work. Understanding the relationship between system software and machine architecture. Understanding how system software help program development (compilers, assemblers, linkers and loaders), and and program execution (OS, process management, file management, device management).
Text Book
System Software, An Introduction to Systems Programming, Leland L. Beck, Addison-Wesley ,1996 Windows System Programming, Johnson M. Hart, Third Edition, Addison-Wesley, 2005.
System Programming
Background Assemblers Loaders and Linkers Macro Processors Other System Software
Outline
Introduction System Software and Machine Architecture The Simplified Instructional Computer (SIC)
SIC Machine Architecture SIC/XE Machine Architecture SIC Programming Examples
1.1 Introduction
System Software consists of a variety of programs that support the operation of a computer.
APPLICATION SOFTWARE:
It is a set of program written in specific language for special purposes. E.g. Payroll system, accounting package.
Utility Software
A program that performs a very specific task, usually related to managing system resources. Operating systems contain a number of utilities for managing disk drives, printers, and other devices. Utilities
Text editors Compilers Loaders Linker Debugger Assembler Operating system System Software
S/w to create Program Development Environment
yText Editor
Text editor:
Software that permits the creation and editing of text (i.e. application programs). Compiler: Translates programs written in a high level language to machine level language (i.e from source code to object code ) (i.e Assembler: Translates programs written in assembly language to machine level language. (i.e from opcode to object (i.e code) Static Linker: Combines and resolves references between object programs and creates the executable code. (Links object programs) Debugger : It is used to debug executable programs and their (low-level) (lowrelated object code and source program.
Source Program
Object Module
Other Object Modules Link Editor (Linker)
Load time
Executable File
System Library
Loader
Dynamically Loaded System Library
Execution time
Running Program
Computer hardware + OS
One characteristic in which most system software differs from application software is machine dependency.
System Software
- Some are
Code optimization techniques Subprogram linking General design and logic of an assembler
SIC / XE Arch
VAX Arch
Power PC Arch
Cray T3 Arch
Registers
Mnemonic Number Special use 0 A Accumulator; used for arithmetic operations X L PC SW 1 2 8 9
Index register; used for addressing Linkage register; JSUB Program counter Status word, including CC
Data Formats
No floating-point hardware on the standard version of SIC Integers are stored as 24-bit binary number 2 s complement representation for negative values Characters are stored using 8-bit ASCII codes +3=00000011 -3 =11111100+1=11111101
8 1 15
Instruction Formats
op od
dd
Addressing Modes
There are two addressing modes available Indicated by x bit in the instruction (X) represents the contents of Index Register X
Op od
od Direct Indexed d x=0 x=1
dd
on Target address calculation TA=address TA=address+(X)
Instruction Set
Format 3 load and store: LDA, LDX, STA, STX, etc. integer arithmetic operations: ADD, SUB, MUL, DIV, etc.
All arithmetic operations involve register A and a word in memory, with the result being left in the register
Input and Output Input and output are performed by transferring 1 byte at a time to or from the rightmost 8 bits of register A Each device is assigned a unique 8-bit code. The Test Device (TD) instruction tests whether the addressed device is ready to send or receive a byte of data Read Data (RD) from Input Device Write Data (WD) to Output Device
11
36 fraction
s exponent
f*2(e-1024)
Format 2 (2 bytes)
8 op 4 r1 4 r2
Format 3 (3 bytes)
6 op 1 1 1 1 1 1 n i x b p e 12 disp
Format 4 (4 bytes)
6 op 1 1 1 1 1 1 n i x b p e 20 address
Load and store new registers (LDB, STB, etc.) Floating-point arithmetic operations (ADDF, SUBF, MULF, DIVF) Register move (RMO) Register-to-register arithmetic operations (ADDR, SUBR, MULR, DIVR) Special supervisor call instruction (SVC) generating interrupt to communicate with the OS
Base relative b = 1, p = 0 = (B) + disp = (PC) + disp PC relative b = 0, p = 1 Only with format 3 i = 1, n = o i = o, n = 1 TA = operand value = (disp); format 3 = (address); format 4
i = 0, n = 0; b,p,e are part = disp[15bits]; Upward of the address field compatible with SIC
1 1 0 0 0 0 (disp [12bits] ) 1 1 0 0 0 1 (address [20bits] ) 1 1 0 0 1 0 ( (PC) + disp) 1 1 0 1 0 0 ( (B) + disp) 1 1 1 0 0 0 (disp + (X) ) 1 1 1 0 0 1 (address + (X) ) 1 1 1 0 1 0 (disp + (PC) + (X) ) 1 1 1 1 0 0 (disp + (B) + (X) )
Mnemonic opcode
SIC
Assembler directives for defining storage
Address labels
SIC/XE
Immediate addressing makes program faster due to fewer memory reference
SIC
SIC