Encyclopedia > OISC

  Article Content

OISC

The OISC is the One Instruction Set Computer, by humorous analogy with RISC (Reduced Instruction Set Computer) and CISC (Complex Instruction Set Computer.) The instruction set of the OISC is even smaller than that of a RISC: it contains exactly one instruction.

Typically, the one instruction performs the 'subtract and branch unless positive' operation, sometimes abbreviated subnp or subleq. The operation has three parameters. subleq(a,b,c) subtracts the contents of memory location a from the contents of b, storing the result back into b, and then, if the result was negative or zero, transferring control to the location specified by the address stored in c.

Other common instructions can be specified in terms of subleq. For example, an unconditional branch is

      JMP c   ==   subleq Z, Z, c

where Z is any location that was previously initialized to contain 0. (The branch is unconditional regardless of whether Z previously contained 0, but to prevent overwriting the contents of Z, a special reserved location should be used.)

In any instruction, the branch can be suppressed by pointing it at the instruction that would have been executed next in any case.

Addition can be performed as reversed subtraction:

     ADD a,b ==   subleq a, Z
                  subleq Z, b
                  subleq Z, Z

(Here all the branches have been suppressed.) The first instruction computes the negation of a and stores it in location Z. The second instruction subtracts -a from b; the third instruction restores the value 0 to Z. A copy instruction can be implemented similarly:

      STO a,b ==  subleq b,b
                  subleq a,Z
                  subleq Z,b
                  subleq Z,Z

Any desired arithmetic test can be built out of the ≤0 relation. For example, a branch-if-zero condition can be assembled from the following instructions:

      BEQ b,c ==  subleq b, Z, L1
                  subleq Z, Z, OUT
               L1:subleq Z, Z
                  subleq Z, b, c
              OUT:...

References

??



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
242

... 2nd century - 3rd century - 4th century Decades: 190s 200s 210s 220s 230s - 240s - 250s 260s 270s 280s 290s Years: 237 238 239 240 241 - 242 - 243 244 245 246 ...

 
 
 
This page was created in 24.4 ms