The Simple Computing System is a prototype to show the entire working of the computer, in terms of memory, compiler, etc.. Please download the SCS.zip, from step 5, unzip it and run the exe, to understand more clearly what this system does.
-
To start with, the Simple Computing System has an assembly-level programming language. The program in this language is converted into bits, which are used by the Operating System to get the things done. The following instruction set defines the language.
Source Code
|
Meaning
|
Source Code
|
Meaning
|
DIRECT MODE
|
Retrieval from and storage to memory
|
LDAD xxx
|
ACC1 = Mem[xxx]
|
STAD xxx
|
Mem[xxx] = ACC1
|
Operations on accumulator
|
ADAD xxx
|
ACC1 = ACC1 + Mem[xxx]
|
SBAD xxx
|
ACC1 = ACC1 - Mem[xxx]
|
MULD xxx
|
ACC1 = ACC1 * Mem[xxx]
|
DIVD xxx
|
ACC1 = ACC1 / Mem[xxx]
|
MODD xxx
|
ACC1 = ACC1 % Mem[xxx]
|
NEGA
|
ACC1 = -ACC1
|
SHRA
|
Shift ACC1 bits to right
|
SHLA
|
Shift ACC1 bits to right
|
RTRA
|
Rotate ACC1 bits to right
|
RTLA
|
Rotate ACC1 bits to left
|
Operations on memory
|
CLRM xxx
|
Mem[xxx] = 0
|
INCM xxx
|
Mem[xxx] = Mem[xxx]+1
|
DECM xxx
|
Mem[xxx] = Mem[xxx]-1
|
NEGM xxx
|
Mem[xxx] = -Mem[xxx]
|
Jump Instructions
|
JUMP xxx
|
IP = xxx
|
JMEQ xxx
|
If EQ = 1 then IP = xxx
|
JMNE xxx
|
If EQ = 0 then IP = xxx
|
JMLT xxx
|
If LT = 1 then IP = xxx
|
JMGE xxx
|
If LT = 0 then IP = xxx
|
JMLE xxx
|
If(LT = 1 or EQ = 1) then IP = xxx
|
JMGT xxx
|
If(LT = 0 and EQ = 0) then IP = xxx
|
JMOV xxx
|
If OV = 1 then IP = xxx
|
JMNO xxx
|
If OV = 0 then IP = xxx
|
Setting and Clearing bits
|
STOV
|
OV = 1
|
CLOV
|
OV = 0
|
STEQ
|
EQ = 1
|
CLEQ
|
EQ = 0
|
STLT
|
LT = 1
|
CLLT
|
LT = 0
|
Miscellaneous
|
NOPN
|
No operation
|
HALT
|
Halt
|
Input/Output
|
INAC
|
Get input into ACC1
|
OUTA
|
Show ACC1
|
INPD xxx
|
Get input into Mem[xxx]
|
OUTD xxx
|
Show Mem[xxx]
|
Compare accumulator
|
CMPA xxx
|
If ACC1 = Mem[xxx] then EQ = 1, else EQ = 0;
If ACC1 < Mem[xxx] then LT = 1, else LT = 0
|
INDIRECT MODE
|
Retrieval from memory
|
LDAI xxx
|
ACC1 = xxx
|
|
|
Operations on accumulator
|
ADAI xxx
|
ACC1 = ACC1 + xxx
|
SBAI xxx
|
ACC1 = ACC1 - xxx
|
MULI xxx
|
ACC1 = ACC1 * xxx
|
DIVI xxx
|
ACC1 = ACC1 / xxx
|
MODI xxx
|
ACC1 = ACC1 % xxx
|
|
|
Input/Output
|
OUTI xxx
|
Show xxx
|
|
|
Compare accumulator
|
CMAI xxx
|
If ACC1 = xxx then EQ = 1, else EQ = 0;
If ACC1 < xxx then LT = 1, else LT = 0
|
The Registers used are: 6 Accumulators(ACC1 for the user's immediate use, ACC2, ACC3, ACC4, ACC5, ACC6 for internal binary arithmetic), Instruction Pointer(IP), Instruction Register(IR), Operand part register(OPNDW), 5 bits(EQ: equal bit, LT: less than bit, OV: overflow bit, INFLAG: input flag, OUTFLAG: output flag).
-
The user has to enter all the numbers in the decimal format for the ease of use. All the opcodes and operands are then converted into bits. the memory is also organized into bits. All the arithmetic is binary arithmetic, so when the memory or the accumulators are required by to be seen by the user, their contents are shown in equivalent hexadecimal and decimal format. The complete project can thus be used to make the working of computer clear to the students of Assembly Language Programming, Logic Design and even Computer Architecture. The program code for the conversion of source code into object code can also be used for basic Compiler Design courses.
-
The programs can be entered from the console or from the file with the extension ".dgf". This may also send the compile time errors if there are any.
-
The programs can be run in one go or step-by-step. The runtime errors, like division by zero, memory out of bound, etc., are displayed.
-
You can download the SCS.zip from here. This contains SCS.exe.
-
Run the SCS.exe. On being prompted to enter a file name, enter a file name as "p1.dgf", or "f77.dgf", etc..
© Vineet Sharda
|