SIC also stands for Single Instruction Computer, this is a
instruction set architecture where the is only one
intruction.
RISC taken to the most extreme point...
One possible instruction for such a SIC would be
SBN : Substract and Branch on Negative.
SBN works the following way : it takes three
operands, the first (a) being a
pointer, the second (b) being a pointer, and the third (c) being again a pointer. SBN
substracts the value pointed by b from the value pointed by a. When the result is non-negative, it will fetch the next instruction, else it will
fetch the instruction at c. In
c-implementation this gives :
In SIC-ASM :
SBN a,b,c
In c :
*a=*a-*b;
if(a < 0){
PC=c;
} else {
PC++;
}
It can be proved that any more useable instruction can be
implemented by a sequence of SBNs
For instance,
mov A,B could be written as :
SBN A,A,1 //A set to 0
SBN T,T,1 //T set to 0
SBN T,B,1 //T set to -B
SBN A,T,1 //A set to -T which is --B which is B
jmp A could be written as :
SBN 0,1,A //0-1 < 0 hence will jump to A