Академический Документы
Профессиональный Документы
Культура Документы
The purpose of this course is to provide background in fundamental types of system software, particularly assemblers, loaders, macro processors, and linkage editors. The course uses a simplified instructional computer (SIC and SIC/XE) to illustrate machine level system software requirements.
A major objective of the course will be for students to design and implement a working (cross) assembler for SIC and part of SIC/XE.
Concerned
Application programs
Machine independent Solves a specific problem Machine dependent Support computers operation
Systems programs
Application Programs
C/C++, Java, Perl, Python, Fortran, PL/1, LISP, Prolog, Pascal, C#, Ruby Programs to sort, search, etc.
Systems Programs
Compiler
Assemblers
Linkers
Loaders
OS
1 5 CZ 1
one word variable one word constant one byte constant one byte variable
RESW RESB
1 1
SIC / SICXE
Simple Instruction Computer Simple Instruction Computer Extended Designed to be similar to real computers Designed to avoid unnecessary detail
CHARACTERISTICS OF
SIC
Bytes 8 bits Word 3 bytes (24 bits) Byte addressable Words addressed by lowest byte 32767 (215) bytes of total memory
A 0 Accumulator; used for arithmetic X 1 Index register; used for addressing L 2 Linkage resister; used for return address PC 8 Program counter; address of next inst. SW 9 Status word; variety of information including a condition code (CC)
Integer
5 -5 000000000000000000000101 111111111111111111111011
24 bit
8 bit opcode 1 bit addressing mode 15 bit address
Compare
Jump instructions
Subroutine Linkage
Input/Output - SIC
RD read data, when the device is ready WD write data Transfers 1 byte at a time to or from the rightmost 8 bits of register A. Each device has a unique 8-bit code as an operand.
CHARACTERISTICS OF
SIC/XE
Bytes 8 bits Word 3 bytes (24 bits) Byte addressable Words addressed by lowest byte 1 meg (220) bytes of total memory (more memory leads to a change in instruction formats and addressing modes
A 0 Accumulator; used for arithmetic X 1 Index register; used for addressing L 2 Linkage resister; used for return address PC 8 Program counter; address of next inst. SW 9 Status word; variety of information including a condition code (CC)
B 3 Base register, used for addressing S 4 General register no special use T 5 General register no special use F 6 Floating-point accumulator (48 bits)
Integers 24 bit binary 2s complement Characters 8 bit ASCII Floating point 48 bit floating point
24 bit integer
Fraction is a value between 0 and 1 The binary point is immediately before the high order bit which must be 1 The exponent is an unsigned binary number between 0 and 2047
Suppose the exponent is e and the fraction is f The number is f * 2 (e+1024) 0 sign is positive 1 is negative 0 is all bits including sign are 0
Integer
5 = 000000000000000000000101 -5 = 111111111111111111111011
Character A 01000001
Float
6 bit opcode
TA = (B)+disp
0 disp 4095 disp is a n unsigned integer PC relative b=0,p=1 TA = (PC)+disp -2048 disp 2047 disp is a 2s complement integer (?) is the contents of register ? if b=0, p=0 then disp is an absolute address
Any addressing mode can be combined with indexed addressing. i.e. if bit x is a 1 then (X) is added in the target address calculation.
Add, SUB, MUL, DIV, ADDF, SUBF, MULF, DIVF, ADDR, SUBR, MULR, DIVR
COMP compares A with a word in memory Sets the CC in the SW JLT, JEQ, JGT based on the CC as set by COMP JSUB jumps to subroutine, places return address in L
Compare
Jump instructions
Subroutine Linkage
Input/Output SIC/XE
RD read data, when the device is ready WD write data Transfers 1 byte at a time to or from the rightmost 8 bits of register A. Each device has a unique 8-bit code as an operand. I/0 channels SIO, TIO, HIO
Direct Addressing b = p = 0
Relative Addressing
b = 1, p = 0
TA = disp
b = 0, p = 1
Immediate
i = 1, n = 0
Indirect
i = 0, n = 1
Simple
SIC/XE instruction