stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 103

Day 103 of 365 · Advanced · Month 4: Network in detail

Recognising deprecated instructions

ld, sd, getd, putd and label still run but are deprecated. l, s, get and put take the ReferenceId themselves, alias replaces label.

Lesson 13 min Week 15

What you learn today

  • Know ld, sd, getd, putd and label
  • Replace them with l, s, get, put
  • Convert old code

In the workshop and in old forums you find scripts that look different: ld, sd, getd, putd, label. The instructions still run, but the game lists them as deprecated. They no longer belong in new code.

What the old instructions do

oldsyntaxnewsyntax
ldld r? id LogicTypell r? id LogicType
sdsd id LogicType r?ss id LogicType r?
getdgetd r? id addressgetget r? id address
putdputd id address valueputput id address value
labellabel d? namealiasalias name d?

The d variants were meant for devices addressed by their ReferenceId. Today l, s, get and put take the ReferenceId themselves when it sits in a register or a define. That makes the old counterpart redundant.

label used to set the caption of a pin. Today alias does that: an alias on a pin shows up on the screws of the IC housing.

Converting old code

The conversion is almost mechanical. The operands stay in the same order, only the instruction name changes:

ld temp id Temperature      # old
l temp id Temperature       # new
sd id On 1                  # old
s id On 1                   # new
label d0 Sensor             # old
alias Sensor d0             # new, order reversed

With label and alias the order flips: first the name, then the pin.

Warning

Deprecated does not mean forbidden. The game keeps running the instructions, but the checker in the IC10 coder warns. If an update removes them one day, your chip will not start any more and reports UnrecognisedInstruction.

Tip

When you take over an old script, convert it right away and test it in the simulator afterwards. Add the device checks from the last few days while you are at it: old scripts rarely have any.

Diagram

Program layout in the proven style # --- Heat warning --- define LIMIT 303.15 # 30 C define SENSOR HASH("…") alias temp r0 alias hot r1 start: yield … j start 1 · define everything tunable 2 · alias names for registers 3 · main loop with yield, endless
The conversion is almost mechanical: swap the instruction name, the operands stay. Only with label and alias the order flips.

Exercise

Task

The editor holds an old script with ld, sd, getd, putd and label. A gas sensor hangs on d0, a wall heater on d1, a second IC housing as a log on d2.

  • Convert it to l, s, get, put and alias, the behaviour stays the same (heater on below 20 °C, counter of heating ticks at address 0 of the log chip, r5 = counter value).
  • Add the device check: without a sensor the heater is off. Without the log chip the chip keeps heating. Never an error.

Hints

Hint 1

ld → l, sd → s, getd → get, putd → put, the operands stay the same.

Hint 2

label d0 Sensor becomes alias sensor d0.

Hint 3

Checks: bdns heater start, bdse sensor read, otherwise heater off. Before the log bdns logchip start.

Quiz

4 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere