We are currently experiencing issues with email delivery; this is being resolved as quickly as possible.

stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Glossary & quick reference

Learn · IC10

Glossary & quick reference

Terms from alias to yield – and every instruction with its syntax at a glance.

Terms

alias

Gives a register or pin a name.

Lesson 9: define and alias: code with names
Batch mode

How lb/lbn combine many values: Average, Sum, Minimum, Maximum, Count.

Lesson 11: Batch modes and the NaN trap
Checker (linter)

Part of the IC10 coder that shows errors and traps while you type.

Lesson 17: Debugging and common traps
Data network

Every device connected to the housing by data cable. lb/lbn/sb/sbn reach them without pins.

Lesson 10: HASH() and named devices: lbn and sbn
db

The housing itself as a device. Has its own values such as Setting and its own stack.

Lesson 1: Chip and housing
define

Gives a fixed number a name. Costs no register.

Lesson 9: define and alias: code with names
Game version

Compacted version without comments and blank lines so a program fits the limits.

Lesson 17: Debugging and common traps
Hash / HASH()

A number computed from a name (CRC32). HASH("…") computes it when loading – for prefabs and device names.

Lesson 10: HASH() and named devices: lbn and sbn
Hysteresis

Control with two thresholds so a device does not keep switching on and off.

Lesson 12: Hysteresis: heating without flicker
IC housing

The structure the chip goes into. Needs power and a data cable, has the pins d0–d5.

Lesson 1: Chip and housing
IC10

The programmable chip (integrated circuit). Sits in the IC housing and runs your program.

Lesson 1: Chip and housing
Jump (absolute/relative)

j, beq, bgt … jump to a label. br… instructions and jr jump by a number of lines.

Lesson 7: Labels and jumps
Kelvin

Temperature unit in the game. 0 °C = 273.15 K.

Lesson 3: Math: move, add, sub, mul, div
Label

Jump target: a name with a colon, alone on its line.

Lesson 7: Labels and jumps
LogicSlotType

Name of a value in a slot, e.g. Occupied or Quantity.

Lesson 14: Slots: what sits in the compartments
LogicType

Name of a device value, e.g. Temperature, On or Setting. Case matters.

Lesson 5: LogicTypes: what devices reveal
Main loop

The part of the program between the start label and j start that repeats forever.

Lesson 6: yield and the main loop
NaN

“Not a number”. Appears e.g. with Average and no matching device. Catch it with snan/bnan.

Lesson 11: Batch modes and the NaN trap
Pin (d0–d5)

Fixed device slots on the housing, assigned with a screwdriver. Six of them.

Lesson 4: Reading and switching devices: l and s
Prefab

Internal name of a device type, e.g. StructureGasSensor.

Lesson 10: HASH() and named devices: lbn and sbn
ra

Return address (r17). jal stores the line after the call here.

Lesson 16: Subroutines with jal and ra
ReferenceId

Fixed number of every device. Readable with l r0 d0 ReferenceId and usable as a device reference.

Lesson 4: Reading and switching devices: l and s
Register

Storage slot for one number. r0–r15 are free, sp and ra have special jobs.

Lesson 2: Registers and numbers
Slot

Compartment of a device, numbered from 0.

Lesson 14: Slots: what sits in the compartments
sp

Stack pointer (r16). Points to the next free slot on the stack.

Lesson 15: The stack: push, pop, peek
Stack

512 extra storage slots per chip, usable as a pile (push/pop) or directly (get/put).

Lesson 15: The stack: push, pop, peek
Subroutine

Block of code called with jal that returns with j ra.

Lesson 16: Subroutines with jal and ra
Tick

One game computation step, 0.5 seconds. At most 128 instructions per tick.

Lesson 6: yield and the main loop
yield

Ends the current tick. Belongs in every main loop.

Lesson 6: yield and the main loop

Instructions by group

Short version of all current instructions. The full description lives in the IC10 coder under “Docs”.

Program

SyntaxMeaning
alias name r?|d?Gives a register or pin a readable name of your own.
define name valueGives a fixed number a name.
hcfStops the chip immediately with an error.
sleep aPauses the chip for a number of seconds.
yieldPauses the chip for exactly one tick (0.5 seconds).

Math

SyntaxMeaning
abs r? aMakes a positive (absolute value).
acos r? aAngle (radians) whose cosine is a.
add r? a bAdds two numbers: a + b.
asin r? aAngle (radians) whose sine is a.
atan r? aAngle (radians) whose tangent is a.
atan2 r? a bAngle (radians) to a point from y (a) and x (b).
ceil r? aRounds a up to the next whole number.
clamp r? a min maxLimits a to the range from min to max.
cos r? aCosine of an angle in radians.
div r? a bDivides a by b: a / b.
exp r? aComputes e to the power of a.
floor r? aRounds a down to the next whole number.
lerp r? a b cBlends between a and b by the ratio c (0 to 1).
log r? aNatural logarithm of a (base e).
max r? a bTakes the larger of two numbers.
min r? a bTakes the smaller of two numbers.
mod r? a bRemainder of a division: a mod b.
move r? aCopies a number or a register's content into a register.
mul r? a bMultiplies two numbers: a * b.
pow r? a bRaises a to the power of b.
rand r?Creates a random number from 0 up to just below 1.
round r? aRounds a to the nearest whole number.
select r? a b cPicks b if a is not 0, otherwise c.
sgn r? aSign of a: -1, 0 or 1.
sin r? aSine of an angle in radians.
sqrt r? aTakes the square root of a.
sub r? a bSubtracts b from a: a - b.
tan r? aTangent of an angle in radians.
trunc r? aCuts off the decimal part of a.

Compare

SyntaxMeaning
sap r? a b cSets the register to 1 if a and b are approximately equal (tolerance c).
sapz r? a bSets the register to 1 if a is (practically exactly) 0, otherwise to 0.
sdns r? deviceSets the register to 1 if no device is set on the pin, otherwise to 0.
sdse r? deviceSets the register to 1 if a device is set on the pin, otherwise to 0.
seq r? a bSets the register to 1 if a is exactly equal to b, otherwise to 0.
seqz r? aSets the register to 1 if a is exactly 0, otherwise to 0.
sge r? a bSets the register to 1 if a is greater than or equal to b, otherwise to 0.
sgez r? aSets the register to 1 if a is greater than or equal to 0, otherwise to 0.
sgt r? a bSets the register to 1 if a is greater than b, otherwise to 0.
sgtz r? aSets the register to 1 if a is greater than 0, otherwise to 0.
sle r? a bSets the register to 1 if a is less than or equal to b, otherwise to 0.
slez r? aSets the register to 1 if a is less than or equal to 0, otherwise to 0.
slt r? a bSets the register to 1 if a is less than b, otherwise to 0.
sltz r? aSets the register to 1 if a is less than 0, otherwise to 0.
sna r? a b cSets the register to 1 if a and b clearly differ (tolerance c).
snan r? aSets the register to 1 if a is NaN (not a valid number), otherwise to 0.
snanz r? aSets the register to 0 if a is NaN, otherwise to 1 – so 1 = valid.
snaz r? a bSets the register to 1 if a is not (practically exactly) 0, otherwise to 0.
sne r? a bSets the register to 1 if a is not equal to b, otherwise to 0.
snez r? aSets the register to 1 if a is not 0, otherwise to 0.

Branch

SyntaxMeaning
bap a b c lineJumps to a label if a is approximately equal to b.
bapal a b c lineCalls a subroutine if a is approximately equal to b (return address in ra).
bapz a b lineJumps to a label if a is (practically exactly) 0.
bapzal a b lineCalls a subroutine if a is (practically exactly) 0 (return address in ra).
bdns device lineJumps to a label if no device is set on the connection.
bdnsal device lineCalls a subroutine if no device is set (return address in ra).
bdnvl device logicType lineJumps to a label if the device cannot provide this value.
bdnvs device logicType lineJumps to a label if the device cannot accept this value.
bdse device lineJumps to a label if a device is set on the connection.
bdseal device lineCalls a subroutine if a device is set (return address in ra).
beq a b lineJumps to a label if a equals b.
beqal a b lineCalls a subroutine if a equals b (return address in ra).
beqz a lineJumps to a label if a equals 0.
beqzal a lineCalls a subroutine if a equals 0 (return address in ra).
bge a b lineJumps to a label if a is greater than or equal to b.
bgeal a b lineCalls a subroutine if a is greater than or equal to b (return address in ra).
bgez a lineJumps to a label if a is greater than or equal to 0.
bgezal a lineCalls a subroutine if a is greater than or equal to 0 (return address in ra).
bgt a b lineJumps to a label if a is greater than b.
bgtal a b lineCalls a subroutine if a is greater than b (return address in ra).
bgtz a lineJumps to a label if a is greater than 0.
bgtzal a lineCalls a subroutine if a is greater than 0 (return address in ra).
ble a b lineJumps to a label if a is less than or equal to b.
bleal a b lineCalls a subroutine if a is less than or equal to b (return address in ra).
blez a lineJumps to a label if a is less than or equal to 0.
blezal a lineCalls a subroutine if a is less than or equal to 0 (return address in ra).
blt a b lineJumps to a label if a is less than b.
bltal a b lineCalls a subroutine if a is less than b (return address in ra).
bltz a lineJumps to a label if a is less than 0.
bltzal a lineCalls a subroutine if a is less than 0 (return address in ra).
bna a b c lineJumps to a label if a is not approximately equal to b.
bnaal a b c lineCalls a subroutine if a is not approximately equal to b (return address in ra).
bnan a lineJumps to a label if a is not a number (NaN).
bnaz a b lineJumps to a label if a is not 0.
bnazal a b lineCalls a subroutine if a is not 0 (return address in ra).
bne a b lineJumps to a label if a does not equal b.
bneal a b lineCalls a subroutine if a does not equal b (return address in ra).
bnez a lineJumps to a label if a does not equal 0.
bnezal a lineCalls a subroutine if a does not equal 0 (return address in ra).
brap a b c offsetJumps d lines forward or back if a is approximately equal to b.
brapz a b offsetJumps c lines forward or back if a is (practically exactly) 0.
brdns device offsetJumps a lines forward or back if no device is set.
brdse device offsetJumps a lines forward or back if a device is set.
breq a b offsetJumps c lines forward or back if a equals b.
breqz a offsetJumps b lines forward or back if a equals 0.
brge a b offsetJumps c lines forward or back if a is greater than or equal to b.
brgez a offsetJumps b lines forward or back if a is greater than or equal to 0.
brgt a b offsetJumps c lines forward or back if a is greater than b.
brgtz a offsetJumps b lines forward or back if a is greater than 0.
brle a b offsetJumps c lines forward or back if a is less than or equal to b.
brlez a offsetJumps b lines forward or back if a is less than or equal to 0.
brlt a b offsetJumps c lines forward or back if a is less than b.
brltz a offsetJumps b lines forward or back if a is less than 0.
brna a b c offsetJumps d lines forward or back if a is not approximately equal to b.
brnan a offsetJumps b lines forward or back if a is NaN (not a number).
brnaz a b offsetJumps c lines forward or back if a is not 0.
brne a b offsetJumps c lines forward or back if a does not equal b.
brnez a offsetJumps b lines forward or back if a does not equal 0.
j lineAlways jumps to a label - no condition.
jal lineCalls a subroutine and remembers the way back in ra.
jr offsetAlways jumps a fixed number of lines forward or back.

Devices

SyntaxMeaning
l r? device logicTypeReads a value from a device into a register.
lr r? device reagentMode reagentHashReads how much of an ingredient (reagent) a device has or needs.
ls r? device slotIndex logicSlotTypeReads a value from a slot of a device.
rmap r? d? reagentHashFinds the item a device accepts for a given ingredient (reagent).
s device logicType valueWrites a value from a register to a device.
ss device slotIndex logicSlotType valueWrites a value to the item sitting in a slot of a device.

Batch

SyntaxMeaning
lb r? deviceHash logicType batchModeReads a value from all devices of one type on the data network.
lbn r? deviceHash nameHash logicType batchModeReads a value from all devices of one type with a given name.
lbns r? deviceHash nameHash slotIndex logicSlotType batchModeReads a slot value from all devices of one type with a given name.
lbs r? deviceHash slotIndex logicSlotType batchModeReads a slot value from all devices of one type on the data network.
sb deviceHash logicType valueWrites a value to all devices of one type on the data network.
sbn deviceHash nameHash logicType valueWrites a value to all devices of one type with a given name.
sbs deviceHash slotIndex logicSlotType valueWrites a slot value to all devices of one type on the data network.

Memory

SyntaxMeaning
clr d?Clears the whole memory (stack) of a device on a pin.
clrd idClears the memory (stack) of a device via its ReferenceId.
get r? device addressReads a number from a device's memory, e.g. another chip.
peek r?Reads the top number of the stack without removing it.
poke address valueWrites a number to a specific place in the stack.
pop r?Takes the top number off the stack and puts it in a register.
push aPuts a number on top of the stack.
put device address valueWrites a number into a device's memory, e.g. another chip.

Bits

SyntaxMeaning
and r? a bBitwise AND: only bits that are 1 in both a and b.
ext r? a b cExtracts a bit field from a: starting at bit b, c bits long.
ins r? a b cInserts the lowest c bits of a into the register at bit b.
nor r? a bBitwise NOT-OR: bits that are 0 in both a and b.
not r? aBitwise NOT: flips every bit of a.
or r? a bBitwise OR: bits that are 1 in a or in b.
rol r? a bRotates the bits of a left by b places.
ror r? a bRotates the bits of a right by b places.
sla r? a bShifts the bits of a left by b places (same as sll).
sll r? a bShifts the bits of a left by b places.
sra r? a bShifts the bits of a right, keeping the sign.
srl r? a bShifts the bits of a right, filling in zeros on the left.
xor r? a bBitwise exclusive OR: bits that differ between a and b.
Esc
↑ ↓ selectEnter open/ opens search anywhere