(This version is not complete)
Teeny.I.S.C or Teeny Instruction set computer is my own IA designed for learning
The instruction set is as compact as possible It consists of
jmp
jz
jc
hlt
nop
add
sub
nand
copy
movx
rloadrl
rstorerl
loadrl
storerl
rloadi
loadi
This implementation doesn't concern itself with the implementation of the IA as it would be physically for now
This project provides a simulation, assembler, disassembler. All 3 are currently under development but are ready for use. However before using you will have to put togather your simulation by assembling the components in python (CLI and utilities in works).
Tisc has a very basic architecture which is not designed with real world usage in mind.
TISC is a register machine with 6 developer accessible register which are further divided into 4 standard and 2 result registers.
0 | 1 | |
---|---|---|
00 | x | y |
01 | z | w |
10 | rl | rh |
11 | ipl | iph |
x's register code is 000
, y's is 001
and so on, the last two registers
can not be accessed.
x, y, z, w are standard registers, note how these registers can be addressed using 2 bits only
The TISC CPU defines a 16 bit address bus, a seperate 8 bit pin
and an extra r
pin which maybe used as the 17th address bit or
as it was intended to be used, that is as a selector between ROM and RAM.
The r
pin is directly controlled by the programmer by specifying the
r
pin state in the IO instructions
At maximum, the first tisc version (this one) can only address 128 KiB
memory
The Arithmetic and Logic unit is a small part with only 4 capabilities, copying, adding, substractinga and nand-(ing). ALU opcodes are
{
"add": 0,
"sub": 1,
"nand": 2,
"copy": 3,
}
-
The
jmp
instruction has the following format00000010 [offset LSB] [offset MSB]
it is a relative jump with the address being stored in little endian -
The
jz
instruction is written as00010010 [offset LSB] [offset MSB]
It jumps only if the last executed ALU instruction resulted in a zero. -
Written as
00100010 [offset LSB] [offset MSB]
It jumps only if the last executed ALU instruction resulted in a carry/borrow -
HALT stops the machine, written as
00001111
- No operation, simply increment instruction pointer.
-
add two register contents and store the result in first register.
0100xxyy
xx
is the 2 bit register code for the first register whileyy
is the register for the second register -
Subtract two register contents and store result in first register.
Written as
0101xxyy
-
nand two register's content and store in first register. written as
0110xxyy
-
copy 2nd register's
yy
value into first registerxx
. Written as01110000
-
Swap two register's contents. written as
10xxxyyy
xxx
,yyy
are 2 3bit register codes for 2 registers invluding the result registers -
rloadrl
orloadrl
loads the memory pointed to by the rl-rh register pair into the specified register. Written as110xxx0r
xxx
is the 3 bit register code,r
is ther
pin output. -
rstorerl
orstorerl
stores the value in the specified register to the location described by rl-rh register pair. Written as111xxx0r
xxx
is the 3 bit register code,r
is ther
pin output. -
rloadi
orloadi
Loads the value from the instruction pointer, typically from program memory into the specified register. Written as110xxx1r
xxx
is the 3 bit register code,r
is ther
pin output.
TASM, TeenyASM is a lightweight extremely primitive assembly for TISC. Syntax will be documented here soon
DISTASM is the disassebler for compiler TASM memory files, currently it gives only a rudimentary output
This is a submodule specific to Tasm, it simplifies packing of bits into python integers
This software is released free of charge without any warranties or guaranties. The author reserves all rights. (For now)