Programming the KENBAK-uino
Here I (silently) program the Kenbakuino with a simple program which just adds 1 to the displayed number, in an infinite loop. It's too fast to really see, the LEDs are a blur, so I use one of my extensions to slow it down. Note that when entering the program, sometimes I choose to use the CLR button to reset the number to 000 before entering a new value, other times I modify what's already there.
The operations are
003 (enter 3 octal)
SET (sets the address to 3)
004
STOR (this sets the memory at the address (3) to 4 and increments the address. Location 3 is the program counter and it's now set to point at the next byte, the start of the program)
103 (this is the "ADD constant to register A" op-code)
STOR
CLR (set the entry to 000)
001 (this is the constant to add to A)
STOR
134 (this is the "STORE A at address" op-code)
STOR
CLR (set the entry to 000)
200 (this is the address to store A, 200 is the output register)
STOR
344 (this is the "JUMP unconditionally to address" op-code)
STOR
CLR (set the entry to 000)
004 (this is the address to jump back to -- the start of the program)
STOR
STRT (the program runs, but too fast to see)
STOP (stop the program)
BIT-4+STOP (slows the CPU down)
STRT (the incrementing is visible now)
Programming the KENBAK-uino
Here I (silently) program the Kenbakuino with a simple program which just adds 1 to the displayed number, in an infinite loop. It's too fast to really see, the LEDs are a blur, so I use one of my extensions to slow it down. Note that when entering the program, sometimes I choose to use the CLR button to reset the number to 000 before entering a new value, other times I modify what's already there.
The operations are
003 (enter 3 octal)
SET (sets the address to 3)
004
STOR (this sets the memory at the address (3) to 4 and increments the address. Location 3 is the program counter and it's now set to point at the next byte, the start of the program)
103 (this is the "ADD constant to register A" op-code)
STOR
CLR (set the entry to 000)
001 (this is the constant to add to A)
STOR
134 (this is the "STORE A at address" op-code)
STOR
CLR (set the entry to 000)
200 (this is the address to store A, 200 is the output register)
STOR
344 (this is the "JUMP unconditionally to address" op-code)
STOR
CLR (set the entry to 000)
004 (this is the address to jump back to -- the start of the program)
STOR
STRT (the program runs, but too fast to see)
STOP (stop the program)
BIT-4+STOP (slows the CPU down)
STRT (the incrementing is visible now)