• Home
  • About i²
  • Programming
  • Gallery
  • Build Log
i² 8-Bit Relay Computer

Programming i²

Picture
i²'s instruction set is a modified version of Jon Stanley's RC2 ISA to include different ALU functions and to compensate for the reduced address bus width.

The program store is a ST M48Z02-150PC1 non-volatile static RAM chip with the extra address lines linked to DIP switches allowing commonly used programs to be saved in different areas. i² is programmed though the switches on the control panel byte by byte making the dip switches a useful feature.

Below are some example programs written for i². If you want to write your own feel free to email it to me using the contact link on the home page and I will upload a video of it running on i².


Windows Compiler

Picture
I have written a small program which allows you to type out the program in assembler and it then will convert it to machine code. It saves a lot of time when writing larger programs. Even with the added help of the compiler,
program's still have to be entered into i² by hand.


Multiplication Program

0    0011 1000    BR NOW
1    0000 0101    "5" (Start)

2    0000 0000    MEM1
3    0000 0000     MEM2
4    0000 0000     MEM3

5    0101 1000    MOV B TO C
6    0110 0000    STOR c TO ADDR
7    0000 0010    "2" (MEM1)
8    0110 0000    STOR C TO ADDR
9    0000 0100    "4" (MEM3)
10    1011 1000    DEC A
11    0110 0000    STOR C TO ADDR
12    0000 0011    "3" (MEM2)
13    0111 0000    LOAD ADDR TO A
14    0000 0010    "2" (MEM1)
15    0111 1000    LOAD ADDR TO B
16    0000 0100    "4" (MEM3)
17    1000 0000    A+B
18    0110 0000    STOR C TO ADDR
19    0000 0100    "4" (MEM3)
20    0111 0000    LOAD ADDR TO A
21    0000 0011    "3" (MEM2)
22    1011 1000    DEC A
23    0110 0000    STOR C TO ADDR
24    0000 0011    "3" (MEM2)
25    0001 0000    BR ZERO
26    0001 1101    "29" (DISPLAY RESULT)
27    0011 1000    BR NOW
28    0000 1101    "13" (REPEAT)

29    0110 1000    LOAD ADDR TO C
30    0000 0100    "4" (MEM3)
31    0110 0000    C TO RAM
32    1111 1111    (Nixie 1)
33    1100 0000    HALT       

Fibonacci Sequence

0    0111 1000    RAM TO B
1    0000 0001    "1" (Seed)
2    0111 0000    RAM TO A
3    0000 0000    "0" (Seed)

4    0101 1000    B TO C
5    0110 0000    C TO RAM
6    1111 1111    (Nixie 1)
    
8    1000 0000    ADD (Loop Begin)
9    0110 0000    C TO RAM
10    1111 1111    (Nixie 1)
11    0100 0000    C To A
12    1000 0000    ADD
13    0110 0000    C TO RAM
14    1111 1110    (Nixie 2)
15    0100 1000    C TO B
16    0011 1000    BRANCH ALWAYS (Loop)
17    0000 1000    "8"
Powered by Create your own unique website with customizable templates.