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

alias furnace d0
alias hottank d1
alias hotpump d2
alias selector d3
alias coldtank d4
alias coldpump d5
alias targettemp r15
alias targetpressure r14
alias furnacetemp r13
alias furnacemoles r12
alias hottemp r11
alias coldtemp r10
alias hotmoles r9
alias coldmoles r8
alias targetmoles r7
define R 8.3144
move targettemp 700
move targetpressure 150
start:
yield
l r0 furnace On
bnez r0 operate
s coldpump On r0
s hotpump On r0
j start
operate:
l furnacetemp furnace Temperature
ls r0 furnace 0 Quantity #unmelted
beqz r0 ready
sle r0 furnacetemp 400 # not all the inputs have melted.
l r0 furnace Pressure
bgt r0 1500 purge
trick:
s coldpump On 0
s hotpump On r0
s hotpump Setting 10
s furnace SettingInput 100
s furnace SettingOutput 0
j start
ready:
mul r0 targetpressure 1000
div r0 r0 R
div targetmoles r0 targettemp
l furnacemoles furnace TotalMoles
l hottemp hottank Temperature
l coldtemp coldtank Temperature
sub r0 furnacetemp hottemp
mul r0 r0 furnacemoles
sub r1 hottemp targettemp
mul r1 r1 targetmoles
add r0 r0 r1
sub r1 hottemp coldtemp
div coldmoles r0 r1
sub r0 targetmoles furnacemoles
sub hotmoles r0 coldmoles
jal furnacepump
j start
furnacepump:
alias coldvol r4
alias hotvol r3
mul r0 coldmoles R
mul r0 r0 coldtemp
l r1 coldtank Pressure
div r0 r0 r1
# r0=V=nRT/P
mul r0 r0 0.5 # kludge
min coldvol r0 100
mul r0 hotmoles R
mul r0 r0 hottemp
l r2 hottank Pressure
div r0 r0 r2
mul r0 r0 0.5 # kludge
min hotvol r0 100
slt r0 coldvol -1
slt r1 hotvol -1
or r0 r0 r1
bnez r0 depressurize
s coldpump Setting coldvol
sgtz r0 coldvol
s coldpump On r0
s hotpump Setting hotvol
sgtz r0 hotvol
s hotpump On r0
s furnace SettingInput 100
s furnace SettingOutput 0
j ra ##
depressurize:
s coldpump Setting 0
s hotpump Setting 0
alias furnacemoles1 r4
alias furnacemoles2 r3
sub r0 hottemp targettemp
mul r0 r0 targetmoles
sub r1 hottemp furnacetemp
div furnacemoles1 r0 r1 # if we only use hot, how much to leave in furnace
sub r0 coldtemp targettemp
mul r0 r0 targetmoles
sub r1 coldtemp furnacetemp
div furnacemoles2 r0 r1 #if we only use cold, how much to leave in furnace
slt r2 furnacetemp targettemp
select r0 r2 furnacemoles1 furnacemoles2
sub r1 furnacemoles r0 #moles to remove
mul r1 r1 1000
div r1 r1 furnacemoles
blt r1 5 nokludge1
mul r1 r1 0.5 # kludge
nokludge1:
min r1 r1 100
s furnace SettingInput 0
s furnace SettingOutput r1
s furnace On 1
j ra
purge:
s furnace SettingOutput 100
s furnace SettingInput 0
s coldpump Setting 0
s hotpump Setting 0
yield
l r0 furnace Pressure
bgt r0 10 purge
j start

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.