Scrap Mechanic

Scrap Mechanic

Not enough ratings
TIMCpu the modpack 2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
113.396 KB
28 Mar, 2022 @ 12:57am
1 Change Note ( view )

Subscribe to download
TIMCpu the modpack 2

In 1 collection by smailovtimofey
TimCPU and other machines
23 items
Description
Small cpu what can alot of things

Marks

marks is white acii blocks with number on it

0 - prog launcher
green button - Run program
black button - write value to output(2)
gray button - write value(watch screenshot)
orange switch - ignore OPCODE 16 for input

1 - manual memory control unit
orange swich - mmcu toggle(first turn off cpu)
brown and orange buttons - go addres up or down
red button - reset current mem address
brown switch - fast memory clear(orange switch needs to be on, then press red button) - clears all addreses from current address to 0
orange switch on bottom(watch screenshot) - deactivate condition

2 - output value
gray button - reset

3 - input
numpad - write value to input - reg0
logic gate - is value written

4 - main control pannel
green button - Run program
green switch and numbers - toggle counter limit
brown and orange buttons - go limit up or down
red button - reset counter
red switch - power toggle(if power is on, machine will be run programm)
blue switch - jump after end command(if cpu ends with task, jump to next counter position)

for like TIMCpu logic computers work, activate red, blue, and purple switch

!!!for normal timcpu work, activate limiter!!!

5 - seed changer(used for multiple TIMCpu's in world)
orange and brown buttons - change seed

seed used for communication to remote program writer

code understanding with program writer

if you want just write program on it, then use my compiller: https://github.com/timofey260/ScrapCPU

else - use this

program writer

for writing program of program writer, turn off the cpu

all buttons:
orange and brown buttons on left - change seed(seed shows on back side)
red button - write current address with written values
yellow button - reset counter to zero
orange and brown buttons on front side - change counter position
numbers on top side - current counter address
green button - run program
blue switch - cleaner toggle
blue button - clean current counter address(blue switch needs to be on)
orange switch - run fast code cleaner(blue switch needs to be on, then press blue button)
numpads - change arguments


cpu use 4 arguments - OPCODE, ARG1, ARG2, RESULT
every line of code use this arguments

code writing without compiller


OPCODE is 8-bit value
if 8-bit(128) of OPCODE is on, then ARG1 will be a value(else will be register value)
if 7-bit(64) of OPCODE is on, then ARG2 will be a value(else will be register value)
if 6-bit(32) of OPCODE is on, then cpu complete a condition
if OPCODE is 16, and ARG1, ARG2, RESULT is 0, then cpu waits for uer input

math

last 4 bytes used for operation:
if 6-bit(32) of OPCODE is off, then cpu complete a math with ARG1 and ARG2

all math operations:
0001 - add
0010 - sub
0011 - multiply
0100 - divide
0101 - exponentiation
0110 - and
0110 - or
0110 - xor
0110 - not(takes only ARG1)

then return value to RESULT register
if RESULT is 0 then returns to output(2)

REG0 for RESULT is output and for ARG1 and ARG2 is input

Example: 11000000 12 23 00000001 - adds 23 and 12 to REG1
Example: 11000001 200 15 00000000 - subs 200 and 15 to OUTPUT
Example: 11000010 2 2 00000010 - multiply 2 by 2 to REG2
Example: 01000000 2 2 00000010 - adds REG2 and 2 to REG2

condition mode
if 6-bit(32) of OPCODE is on, then cpu complete a condition between ARG1 and ARG2

all conditions:
==
!=
>
>=
<
<=

if condition is right, then program jumps to RESULT(set counter to RESULT value)
else program goes next(counter +1)

Example: 01100000 1 23 00000001 - if REG1 = 23, then jump to 1
Example: 11100000 1 1 00000011 - if 1 = 1, then jump to 3(always jumps to 3)
Example: 01100000 1 23 00000010 - if REG1 != 23, then jump to 2

Links

https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=2778213942 first TIMCpu the modpack
https://github.com/timofey260/ScrapCPU - compiller
https://github.com/timofey260/ScrapCPU/wiki - wiki