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
| old | syntax | new | syntax |
|---|---|---|---|
ld | ld r? id LogicType | l | l r? id LogicType |
sd | sd id LogicType r? | s | s id LogicType r? |
getd | getd r? id address | get | get r? id address |
putd | putd id address value | put | put id address value |
label | label d? name | alias | alias 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.
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.
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
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,putandalias, 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