~maddie/STT-TIL

7aee439c46bde17aeb2ef4e4b63bd06b725fd157 — kn0000 2 months ago master
initial commit, not finished, just for backup
2 files changed, 268 insertions(+), 0 deletions(-)

A .gitignore
A interpreter
A  => .gitignore +1 -0
@@ 1,1 @@
*.stt

A  => interpreter +267 -0
@@ 1,267 @@
0010000000 imm
0000000000
0010000000
0000000000 placeholder addr, will be address of initialisation code
0100000000 jump
0000000000; DENEST
0000000111 seven, addr of next instruction
1110000000 immediate on rs
0010000000 
1110000000
0000000001 address of lower half of i
1110000101 pop to mem
1110000000
0010000000
1110000000
0000000000 address of upper half of i
1110000101 pop to mem, pop rs to i
0110000000 immediate; NEXT
0010000000
0110000000
0000000000 address of upper i
0110000100 push from mem
0110000000 imm
0010000000
0110000000
0000000001 low i
0110000100 push; fetch i
0110000111
0110000111 dup addr
0110000000 imm
0000000010 two
0110001000 clear carry
0010101100 add
0110000000 imm
0010000000
0110000000
0000000001 low i
0110000101 pop
0110000000 imm
0000000000 zero
0010101100 add
0110000000 imm
0010000000
0110000000
0000000000 high i
0110000101 pop; increment i by two
0110000111
0110000111 dup addr
0110000000 imm
0000000001 one
0110001000 clc
0010101100 add
0110000011 move stack
0110000000 imm
0000000000 zero
0010101100 add
1110000011 move stack; increment addr
0110000100 push
0110000011 mvstack
0110000100 push
1110000011 mvstack; deref both addrs, fetches wa
0110000000 imm
0010000000
0110000000
0010000011 low wa
0110000101 pop
0110000000 imm
0010000000
0110000000
0000000010 high wa
0110000101 pop
0110000000 imm; RUN
0010000000
0110000000
0000000010 high wa
0110000100 push
0110000000 imm
0010000000
0110000000
0000000011 low wa
0110000100 push; fetch wa
0110000111
0110000111 dup addr
0110000000 imm
0000000010 two
0110001000 clear carry
0010101100 add
0110000011 move stack
0110000000 imm
0000000000 zero
0010101100 add
1110000011 move stack
0110000000 imm
0010000000
0110000000
0000000011 low wa
0110000101 pop
0110000000 imm
0010000000
0110000000
0000000010 high wa
0110000101 pop; increment wa by two
0110000111
0110000111 dup addr
0110001000 clear carry
0110000000 imm
0000000001 one
0010101100 add
0110000011 mov stack
0110000000 imm
0000000000 zero
0010101100 add
1110000011 mov stack
0110000100 push
0110000011 mov stack
0110000100 push; deref wa
0100000000 unconditional jump; end of RUN
1110000000 imm; start of NEST
0010000000 
1110000000
0000000000 high i
1110000100 push
1110000000 imm
0010000000
1110000000
0000000001 low i
1110000100 push; push i to return stack
0110000000 imm
0010000000
0110000000
0000000010 high wa
0110000100 push
0110000000 imm
0010000000
0110000000
0000000000 high i
0110000101 pop
0110000000 imm
0010000000
0110000000
0000000011 low wa
0110000100 push
0110000000 imm
0010000000
0110000000
0000000001 low i
0110000101 pop; move wa to i
0110000000 imm
0000000000
0110000000
0000010001 seventeen, addr of NEXT
0100000000 unconditional jump; end of NEST
0000000111 start of EXECUTE, string
0000001110 E
0000100001 X
0000001110 E
0000001100 C
0000011110 U
0000011101 T
0000001110 E
0000000000
0000000000 link address; zero to indicate end of dictionary
0000000000
0010100100 code addr; address of next instruction
0110000000 imm
0010000000
0110000000
0000000011 low wa
0110000101 pop
0110000000 imm
0010000000
0110000000
0000000010 high wa
0110000101 pop; move address from data stack to wa
0110000000 imm
0000000000
0110000000
0001000111 addr of RUN
0100000000 unconditional jump
0110000111 over; start of LONG-DEREF internal subroutine
0110000111 dup addr
0110000000 imm
0000000001 one
0110001000 clr carry
0010101100 add
0110000011 mov stack
0110000000 imm
0000000000 zero
0010101100 add
1110000011 mov stack
0110000100 push
0110000011 mov stack
0110000100 push
1110000011 mov stack
1100000000 jump from return stack; end of LONG-DEREF internal
0000001010 ten; string, start of LONG-DEREF dictionary entry
0000010101 L
0000011000 O
0000010111 N
0000010000 G
0000111101 -
0000001101 D
0000001110 E
0000011011 R
0000001110 E
0000001111 F
0000000000
0010011000 link addr; links to EXECUTE
0000000000
0011010010 code addr; next instruction
1110000000 imm
0000000000
1110000000
0000010001 addr of NEXT on rs
0110000000 imm
0000000000
0110000000
0010110011 addr of LONG-DEREF internal
0100000000 unconditional jump; end of LONG-DEREF
0000001110 fourteen, string; start of REFRESH-SCREEN
0000011011 R
0000001110 E
0000001111 F
0000011011 R
0000001110 E
0000011100 S
0000010001 H
0000111101 -
0000011100 S
0000001100 C
0000011011 R
0000001110 E
0000001110 E
0000010111 N
0000000000
0011000011 link to LONG-DEREF
0000000000
0011101110 code address, next instruction
0110000000 imm
0000000001 one
0110000000 imm
0111111111
0110000000
1111111111 screen update addr
0110000101 pop; updates screen
0110000000 imm
0000000000
0110000000
0000010001 addr of NEXT
0100000000 unconditional jump; end of REFRESH-SCREEN
0000001011 start of MOVE-BUFFER (length from to -- )
0000010110 M
0000011000 O
0000011111 V
0000001110 E
0000111101 -
0000001011 B
0000011110 U
0000001111 F
0000001111 F
0000001110 E
0000011011 R
0000000000
0011011011 link to REFRESH-SCREEN
0000000000
0100001010 code addr