Scrap Mechanic

Scrap Mechanic

Not enough ratings
TIMCpu the modpack 2 calculator code
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
28.110 KB
28 Mar, 2022 @ 5:39am
1 Change Note ( view )

Subscribe to download
TIMCpu the modpack 2 calculator code

In 1 collection by smailovtimofey
TimCPU and other machines
23 items
Description
calculator for TIMCpu the modpack 2

instructions:
0 make sure what TIMCpu and code has same seed
1 output shows one, then enter first number
2 output shows two, then enter operation
(1 - +, 2 - -, 3 - *, 4 - /, else jump to zero)
3 output hows three, then enter second number
4 output shows result

code:
CONS ADD 5 also i can place here any comments
MARK START
COPY 1 OUT
WAIT for user input
COPY INP REG1
COPY 2 OUT
WAIT
COPY INP REG2 operation 1 - + 2 -- 3 -* 4 - /
COPY 3 OUT
WAIT
COPY INP REG3
COPY 0 OUT

TEST REG2 = 1 AD
TEST REG2 = 2 SB
TEST REG2 = 3 ML
TEST REG2 = 4 DV
JUMP START
MARK AD
ADDI REG1 REG3 REG4
JUMP SOL
MARK SB
SUBI REG1 REG3 REG4
JUMP SOL
MARK ML
MULI REG1 REG3 REG4
JUMP SOL
MARK DV
DIVI REG1 REG3 REG4
MARK SOL
COPY REG4 OUT

code compilled:
| num|| OPCODE || ARG1 || ARG2 || RESULT |
| 0||11000000(192)|| 1|| 0|| 00000000( 0)|
| 1||00010000( 16)|| 0|| 0|| 00000000( 0)|
| 2||01000000( 64)|| 0|| 0|| 00000001( 1)|
| 3||11000000(192)|| 2|| 0|| 00000000( 0)|
| 4||00010000( 16)|| 0|| 0|| 00000000( 0)|
| 5||01000000( 64)|| 0|| 0|| 00000010( 2)|
| 6||11000000(192)|| 3|| 0|| 00000000( 0)|
| 7||00010000( 16)|| 0|| 0|| 00000000( 0)|
| 8||01000000( 64)|| 0|| 0|| 00000011( 3)|
| 9||11000000(192)|| 0|| 0|| 00000000( 0)|
| 10||01100000( 96)|| 2|| 1|| 00001111( 15)|
| 11||01100000( 96)|| 2|| 2|| 00010001( 17)|
| 12||01100000( 96)|| 2|| 3|| 00010011( 19)|
| 13||01100000( 96)|| 2|| 4|| 00010101( 21)|
| 14||11100000(224)|| 0|| 0|| 00000000( 0)|
| 15||00000000( 0)|| 1|| 3|| 00000100( 4)|
| 16||11100000(224)|| 0|| 0|| 00010110( 22)|
| 17||00000001( 1)|| 1|| 3|| 00000100( 4)|
| 18||11100000(224)|| 0|| 0|| 00010110( 22)|
| 19||00000010( 2)|| 1|| 3|| 00000100( 4)|
| 20||11100000(224)|| 0|| 0|| 00010110( 22)|
| 21||00000011( 3)|| 1|| 3|| 00000100( 4)|
| 22||01000000( 64)|| 4|| 0|| 00000000( 0)|

https://github.com/timofey260/ScrapCPU compiller
https://github.com/timofey260/ScrapCPU/wiki/TM-Demos other demos