Low-tech computing for Minetest
Go to file
Izaya f322b55a84 moved to test3d-tools 2017-02-12 01:58:27 +00:00
test3d_t400 moved to test3d-tools 2017-02-12 01:58:27 +00:00
test3d_t410 bugfixes and stuff 2017-02-12 01:57:00 +00:00
test3d_t416 bugfixes and stuff 2017-02-12 01:57:00 +00:00
LICENSE Initial commit 2016-09-12 22:34:23 +10:00
README.md Added a few instructions 2017-01-25 12:13:39 +11:00
modpack.txt Turned the whole thing into a modpack. 2016-10-05 15:59:44 +11:00

README.md

Test3d

Low-tech computing for Minetest

Memory access

Memory access in this mod occurs over digilines, with the channel as the prefix plus the memory address, and the message as either the new value or 'get' to get it returned, so for example:

Prefix Address Value Channel Message
A 1 4 A1 4
Default 15 get DefaultF get

T400

The T400 is a 12-bit stack machine operating at 1Hz (due to ABMs only running once per second). It has a 16-word stack, 0 registers and a very simple instruction set.

Instructions

There are 8 instructions for the T400. Any values encountered by the processor that are not instructions are treated as data and pushed to the stack. While this does make both the code for the emulator and the code for the emulated computer simple, it has the downside that if you really do want the value 4095 you have to add two things together.

ins function mnemonic
4095 push program counter ppc
4094 swap TOS swp
4093 read memory from TOS read
4092 write to memory from TOS write
4091 add TOS add
4090 suptract TOS sub
4089 jump to TOS jmp
4088 skip if TOS = zero sez
4087 jump if TOS = zero jez
4086 jump to subroutine, push pc to retstack jsr
4085 return from subroutine, PC = top of retstack ret
4084 duplicate TOS dup
4083 drop TOS drop

T410

The T410, is, in essence, the write instruction in a block. You put in an address and a value and it tries to write the value to that address.

T416

The T416 is a 16-word memory. It stores 16 ints and is accessed as described in the Memory access section.