Meta-Computer (Concise)[ Home ] [ Previous ] [ Next ]{ Σπ } Here is the program code (concise version) of the meta-computer, beginning with its instruction set, followed by an assembly language program, then followed by high-level language code. N is the op code, and Siz is the instruction length, in multiples of 4 bits. Instruction Set: N Siz Op Arg Function = === === === ======== 0 1 CPM Copy V := M(I) = I-th byte of M 1 1 CPL Copy L(I) := V 2 1 CLX Zero out M: length = 2 ^ 65,536 bits 3 1 CLY Zero out I: length = 65,536 bits 4 1 SHY Shrink length of I by 1 bit 5 1 EXY Expand length of I by 1 bit 6 1 INX Increment M 7 1 INY Increment I 8 1 DEX Decrement M 9 1 DEY Decrement I A 2 BNX A Branch if M non-zero to addr A B 2 BNY A Branch if I non-zero to addr A C 2 BZX A Branch if M is zero to addr A D 2 BZY A Branch if I is zero to addr A E 1 RUN Activate current lattice, start new lattice F 1 HLT Halt Assembler Hex Codes ========= ========= 0 CLX 2 1 CLY 3 2 SHY 4 3 SHY 4 4 SHY 4 5 CPM 0 6 CPL 1 7 INY 7 8 BNY 5 B 9 5 A RUN E B INX 6 C BNX 1 A D 1 E HLT F High-Level Language Program: M := 0 20 I := 0 40 V := M(I) L(I) := V I := I + 1 IF I <> 0 GOTO 40 ACTIVATE L M := M + 1 IF M <> 0 GOTO 20 HALT The set of all possible meta-computer programs, in which the maximum length of each program is 16 4-bit values or 64 bits, has 2 ^ 64 members. For every member of this set, the meta-computer runs that program (they all run simultaneously). Only those programs that begin with the above assembly language program (in machine code form), or some equivalent program that does the same thing, actually work. Note that not all meta-computer programs actually halt (some have infinite loops). Consequently, each program runs on a separate copy of the meta-computer's hardware, or if they all share the same hardware, then they have their own private copies of each register.
|