furnace
advanced-furnace.mips
arc-furnace-room-control.mips
furnace-calc-pre.mips
furnace-ingot-recipe.mips
furnace-operate.mips
furnace-room-vacuum-pump.mips
hot-cold-waste-tank-manager.mips
hot-tank-filler.mips
pressurize-furnace.mips
waste-tank-to-cold-tank-with-chiller.mips
furnace-waste-chiller.mips

manufacturing
vend-ingots-to-printer.mips
vending-ore-counter-omni-fast.mips
vending-ore-counter-omni-slow.mips
vending-ore-counter-single.mipsr
vending-ore-counter-triple.mips

greenhouse
greenhouse-ac.mips
greenhouse-o2-pressure-display.mips
greenhouse-oxygen-harvest.mips
greenhouse-temperature.mips
harvie-triple.mips
seed-distributer.mips
seed-sorter-old.mips
seed-sorter.mips
stacker-vending-button.mips

atmospherics
base-atmosphere-control.mips
battery-room-atmosphere.mips
battery-room-vent-setter.mips
harvest-cold-atmosphere.mips
harvest-liquid-from-atmosphere.mips
refrigeration-room.mips

mining rocket
rocket-driving.mips
rocket-miner-readout.mips

ore warehousing
ore-sorter-multi.mips
ore-sorter2-multi.mips
gas-rock-sorter.mips
centrifuge-ore.mips

gas handling
gas-filter-chain.mips
co2-tank-pressure-management.mips
fuel-mixer.mips
gas-harvester.mips
gas-mixer-nitrous.mips
n2o-heater.mips
pump-feed-nitrolyzer.mips
show-gas-pressure-triple.mips
manage-coolant-from-atmosphere.mips

doors
weather-gate.mips
door-switch-logic.mips

solar
solar-old.mips
1-axis-solar-panel-control.mips
2-axis-solar-panel-control.mips

biomass fuel
biomass-generator-pipeline.mips
biomass-generator-silo.mips
biomass-recycler.mips
charcoal-stockpile-display.mips

AIMeE
aimee-old.mips
aimee-position-display.mips
aimee.mips


airlock-tank-accelerator-mgmt.mips
batch-solar-control.mips
centrifuge-miner-manager.mips
chamber-liquification-mgr.mips
cooling-gas-buffer-room.mips
cooling-gas-buffer.mips
display-avionics.mips
exhaust-gas-cooler-control.mips
fuel-mixer-n2o.mips
fuel-mixer-o2.mips
larre-config-1.mips
larre-farming-hardcoded.mips
larre-farming-stack.mips
light-console.manager.mips
light-manager.mips
loulan-airlock.mips
loulan-arc-furnace-room.mips
loulan-greenhouse.mips
measure-condensation-rate.mips
nitrolyzer-battery-threshold.mips
nitrous-warmer.mips
power-consumption-triple.mips
radiator-control.mips
simpler-gate.mips
sorter-feeding-autooven.mips
trader-scanner.mips
vend-ingots-to-printer-2.mips

# 2020-Jan
# arc furnace gas capture room control

alias sensor d0
alias pump d1
alias lever d2
alias furnace d3
alias door d4
alias display d5

alias doorOpen r9
alias leverPulled r8
alias pressure r7

idle:
yield

jal updateDisplay

l leverPulled lever Setting
bgtz leverPulled startUp

j idle
#

startUp:
l doorOpen door Open
blez doorOpen startUp2

s door Open 0
yield
j startUp

startUp2:

l leverPulled lever Setting
blez leverPulled powerDown

l r0 furnace Activate
bgtz r0 smelting # have we started smelting yet?

s furnace Activate 1

yield
j startUp2

smelting:
# core furnace monitoring loop
yield

jal updateDisplay
jal pumpGas

l r0 furnace Activate
bgtz r0 smelting # wait until the furnace runs out of stuff to smelt

powerDown:

jal updateDisplay
l pressure sensor Pressure
blez pressure openDoor # do not open the door till all the gas is pumped out
jal pumpGas

yield
j powerDown

openDoor:
# done smelting; gas is pumped out;
# turn off the vent
s pump On 0
# reset the start lever
s lever Open 0
# open the door
s door Open 1

# ready for the next batch
j idle

updateDisplay:
bdns display ra
# if we have a display, show the Reagents count from the furnace
l r0 furnace Reagents
s display Setting r0
j ra

pumpGas:
# if there is any atmosphere in the room, use the active vent to pump it out
l pressure sensor Pressure
sgtz r0 pressure
s pump On r0
j ra

MIPS is the programming language used by IC (integrated circuits) in the game Stationeers. Stationeering web site has a MIPS emulator with syntax highlighting and error detection.