Simplified Instructional Computer
Simplified Instructional Computer
(SIC )
• SIC comes in two versions
– The standard model
– An XE version - “extra equipments” , “extra expensive”
• These two versions has been designed to be
upward compatible
• An object program for the standard SIC will also
execute properly on a SIC/XE system
SIC Machine Architecture
• Memory
– 1 byte = 8-bit
– 1 word=3 consecutive bytes
– Addressed by the location of their lowest numbered byte
– Total 32,768 (2^15) bytes SIC does not have any stack.
It uses the linkage register to store the
– Memory is byte addressable return address.
It is difficult to write the recursive
program.
Registers- Five registers (24 bits in length) A programmer has to maintain memory
for return addresses when we write
Mnemonic Number Special use
more than one layer of function call.
A 0 Accumulator - used for arithmetic operations
X 1 Index Register- used for addressing
L 2 Linkage register- the Jump to Subroutine (JSUB) instruction stores the
return address in this register
PC 8 Program Counter - contains the address of the next instruction to be
fetched for execution
SW 9 Status Word - contains a variety of information, including a Condition Code (CC)
SIC Machine Architecture
• Data Formats
Integers: stored as 24-bit binary numbers;
2’s complement representation is used for negative values
Characters: stored as 8-bit ASCII codes
No floating-point hardware N ⇔ 2^n – N
Eg : if n = 4, -1 ⇔
• Instruction Formats - standard version of SIC 2^4 – 1 = (1111)2.
001110100110010001010010
3 A 6 4 5 2
OP CODE 6452
X
9 2 B 8 0 0
OP CODE 3800
X
011101110111011101110111
7 7 7 7 7 7
OP CODE 7777
X
LDA M 00 A=M
LDCH M 50 A[RMB] = [RMB]
LDL M 08 L=M
LDX M 04 X=M
STA M 0C M=A
STCH M 54 M[RMB] = A[RMB]
STL M 14 M=L
STSW M E8 M = SW
STX M 10 M=X
Notations used
A - Accumulator M - Memory CC - Condition Code
PC - Program Counter RMB - Right Most Byte L - Linkage Register
Arithmetic and Logical Instruction
MNEMONIC OPERAND OPCODE EXPLANATION
ADD M 18 A=A+M
SUB M 1C A=A–M
MUL M 20 A=A*M
DIV M 24 A=A/M
Logical Instruction
AND M 40 A = A AND M
OR M 44 A = A OR M
Compare Instruction
COMP M 28 compares A and M
X=X+1;
TIX M 2C
compare X with M
Notations used
A - Accumulator M - Memory CC - Condition Code
Jump Instructions
MNEMONIC OPERAND OPCODE EXPLANATION
J M 3C PC = M
JEQ M 30 if CC set to =, PC = M
RSUB 4C PC = L
Notations used
A - Accumulator M - Memory CC - Condition Code
PC - Program Counter RMB - Right Most Byte L - Linkage Register
I/O instructions
MNEMONIC OPERAND OPCODE EXPLANATION
TD M E0 test device specified by M
WD M DC device specified by M[RMB] = S[RMB]
RD M D8 A[RMB] = data specified by M[RMB]
Notations used
A - Accumulator M - Memory CC - Condition Code
PC - Program Counter RMB - Right Most Byte L - Linkage Register
Assembler Directives
Pseudo-Instructions
Not translated into machine instructions
Providing information to the assembler
Syntax ADDRESS MEMORY
Label START value 0000 ---
0001 ---
Label BYTE value
: :
Label WORD value 1 BYTE
EOF 2A56 E FOR
Label RESB value 2A57 O
EACH
CHARACT
Label RESW value 2A58 F
ER
: :
Label: name of operand FIVE 3000 05
value: integer, character 3001 00 3
3002 00 BYTES
: :
Eg. EOF BYTE C’EOF’
DATA1 3100 --- 3X4=
B1 BYTE X’4156’ 12
: ---
FIVE WORD 5 310B ---
BYTES
DATA1 RESW 4 DATA1 310C ---
DATA2 RESB 5 : --- 5
BYTES
3110 ---
Assume that to memory location named FIVE and CHARX
contains data 5 and ‘Z’ respectively. Write sequence of
statement to transfer content of location FIVE and CHARZ to
location ALPHA and C1 respectively
START 1000
1000 LDA FIVE load 5 into A
1003 STA ALPHA store in ALPHA
1006 LDCH CHARZ load ‘Z’ into A
1009 STCH C1 store in C1
100C RSUB
ZERO WORD 0
K100 WORD 100 INPUT DEVICE NUMBER
INDEV BYTE X’F1’ 100-BYTE BUFFER FOR INPUT RECORD
RECORD RESB 100 ONE-WORD CONSTANTS
END
LDA ZERO
STA INDEX GAMMA(I)=ALPHA[I]+BETA[I]
Data Formats
The same data format as the standard version
However, provide an addition 48-bit floating-point data type
• fraction: between 0 and 1
• exponent: Value between 0 to2047
• sign: 0=positive, 1=negative
• Instruction formats
- Since the memory used by SIC/XE may be 2^20 bytes, the
instruction format of SIC is not enough.
Solutions
– Use relative addressing
– Extend the address field to 20 bits
SIC/XE instruction formats
Addressing Modes
Addressing Modes: Address Computation
Addressing Modes: Address Computation
Addressing Modes: Address Computation
Addressing Modes: Address Computation
Find EA corresponding to following instructions. Assume (X)= 2500
1) 17202D 2) 92B800 3) 777777
000101110010000000101101
1 7 2 0 2 D
OPCODE n i x b p e
Displacement 02 D
Assume (PC) = 3
OPCODE=00010100=14
Format = 3
n i = 1 1 (DIRECT ADDRESS)
P=1
EA= (PC)+ Displacement
=003+02D=0030
http://cis.csuohio.edu/~jackie/cis335/sicxe_address.txt
27