What you learn today
- Read error numbers
- Cause per code
- Read the error at the housing
The heater in the lab stays cold. The housing says Error IncorrectLogicType at line 14. The game names the error and adds the line. Behind every name there is a fixed number, and the list is short enough to go through once completely.
While loading or while running
There are two moments when an error can happen:
- While loading: before the chip starts, it reads every line. An unknown instruction, a missing operand or a duplicate label stop it before the first line runs.
- While running: the line is valid, but something goes wrong when it runs, for example because no device is plugged into the pin. The chip stays on that line and retries it every tick.
The whole list
| No. | Name | typical cause |
|---|---|---|
| 0 | None | no error |
| 1 | Unknown | error without its own number |
| 2 | IncorrectVariable | unknown name: typo in an alias, define or label |
| 3 | IncorrectVariableType | nothing in the 0.2.6428 game code raises it, so it does not occur |
| 4 | IncorrectLogicType | LogicType misspelt or not readable/writable on the device |
| 5 | IncorrectLogicSlotType | the same for slot types |
| 6 | IncorrectArgumentCount | one operand too many or too few, e.g. batch mode forgotten |
| 7 | DeviceNotSet | practically never: only an unused helper function throws it. An empty pin reports 25 |
| 8 | JumpTagDuplicate | a label appears twice in the code |
| 9 | UnrecognisedInstruction | unknown instruction, also with wrong case |
| 10 | IndexOutOfRange | index outside the allowed range, e.g. a pin above d5 |
| 11 | OutOfRegisterBounds | register above r17, usually via rr indirection |
| 12 | OutOfDeviceBounds | the same via dr indirection |
| 13, 14, 15, 21 | IncorrectReagentMode, UnhandledReagentMode, IncorrectReagentDevice, IncorrectReagentType | around lr: 14 unknown mode, 15 mode does not fit the device (Required on a furnace). The game code does not raise 13 and 21 |
| 16 | ChipCatchingFire | hcf – the chip “catches fire” |
| 17 | StackOverFlow | push beyond the 512 places |
| 18 | StackUnderFlow | pop or peek on an empty stack |
| 19 | ExtraDefine | the same name defined twice |
| 20 | DeviceListNull | housing not on any data network, batch instructions find nothing |
| 22 | DeviceNotSlotWriteable | this slot must not be written |
| 23, 24 | ShiftOverflow, ShiftUnderflow | number too big or too small for a bit instruction, bit position out of range |
| 25 | DeviceNotFound | no device behind the operand: empty pin, unknown ReferenceId |
| 26, 27 | MemoryNotReadable, MemoryNotWriteable | get/put on a device without a matching memory |
| 28, 29, 30 | InvalidStringLength, InvalidStringNull, InvalidStringNonAscii | STR("…") too long, empty or with an umlaut |
| 31, 32, 33 | InvalidPreprocessHash, InvalidProcessBinary, InvalidPreprocessHex | HASH("…"), %… or $… unreadable |
| 34 | LogicTypeIsNone | LogicType None used |
| 35, 36 | PayloadOverflow, PayloadUnderflow | bit field too long in ext/ins (35); the game code does not raise 36 |
| 37 | InvalidInteger | something else where an integer belongs |
| 38 | AliasNotFound | an alias points to nothing usable |
In everyday play you mostly meet 4, 6, 9, 18, 20 and 25. The others are rare, but when they show up, you now know where to look.
The IC10 coder counts lines from 0, like the chip. If the housing says line 14, it is the line numbered 14 in the editor.
Seeing the error from outside
A second chip can watch every housing on the data network. It sees two values: Error is 1 while the housing has an error, otherwise 0. LineNumber is the line the chip is on right now. Because a chip with a runtime error stays on the faulty line, LineNumber is exactly the error line then.
define GEHAEUSE HASH("StructureCircuitHousing") # IC housing
lbn r0 GEHAEUSE HASH("Heizchip") Error Average # 1 = error, 0 = running
lbn r1 GEHAEUSE HASH("Heizchip") LineNumber Average # current line
Error only says yes or no. You do not get the number or the name of the error over the data network, those only appear on the housing itself. And: give the watcher a different name than the chip it watches. Otherwise lbn averages over both housings.
Diagram
Exercise
Task
Build an error watch for the housing “Heizchip”: if it reports an error, the flashing light “Chipfehler” turns on and the display “Fehlerzeile” shows the line. Without an error the light is off and the display shows -1. If the housing is removed, that counts as an error: light on, display -1.
Hints
Hint 1
Read Error and LineNumber with lbn and the hash of StructureCircuitHousing.
Hint 2
If the housing is missing, Error is NaN. snan detects that, select turns it into a 1.
Hint 3
For the display use select twice: first by Error, then by the missing housing.
Quiz
5 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