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 vend d0
alias display d1
alias displayeach d4
alias memeach d3

alias minhash r15
alias minqty r14
alias currhash r13
alias currqty r12
alias relevant r11
alias slot r10
alias weight r9
alias minqtyadj r8
alias currqtyadj r7

define LASTSLOT 101
define ASTROLOYHASH 412924554
define CONSTANTANHASH 1058547521
define COPPERHASH -404336834
define ELECTRUMHASH 502280180
define GOLDHASH 226410516
define HASTELLOYHASH 1579842814
define INCONELHASH -787796599
define INVARHASH -297990285
define IRONHASH -1301215609
define LEADHASH 2134647745
define NICKELHASH -1406385572
define SILICONHASH -290196476
define SILVERHASH -929742000
define SOLDERHASH -82508479
define STEELHASH -654790771
define STELLITEHASH -1897868623
define WASPALOYHASH 156348098

start:
move minhash 0
move slot 2
minloop:
move currhash  ASTROLOYHASH
move weight 0.6
jal perhash
move currhash  CONSTANTANHASH
move weight 0.6
jal perhash
move currhash  COPPERHASH
move weight 1
jal perhash
move currhash  ELECTRUMHASH
move weight 1
jal perhash
move currhash  GOLDHASH
move weight 1
jal perhash
move currhash  HASTELLOYHASH
move weight 0.6
jal perhash
move currhash  INCONELHASH
move weight 0.6
jal perhash
move currhash  INVARHASH
move weight 0.6
jal perhash
move currhash  IRONHASH
jal perhash
#move currhash  LEADHASH
#jal perhash
#move currhash  NICKELHASH
#jal perhash
move currhash  SILICONHASH
move weight 1
jal perhash
move currhash  SILVERHASH
move weight 1
jal perhash
move currhash  SOLDERHASH
move weight 1
jal perhash
move currhash  STEELHASH
move weight 1
jal perhash
move currhash  STELLITEHASH
move weight 0.6
jal perhash
move currhash  WASPALOYHASH
move weight 0.6
jal perhash

s db Setting minhash
bdns display nodisplay
s display Setting minqty
nodisplay:

yield
j start

perhash:
push ra
jal evalhash
pop ra
div currqtyadj currqty weight
#yield
bdns displayeach over2
s memeach Setting currhash
s displayeach Setting currqty
over2:
slt r0 minqtyadj currqtyadj
and r0 r0 minhash
bnez r0 ra

move minhash currhash
move minqty currqty
move minqtyadj currqtyadj
j ra

evalhash: # input currhash, output currqty
alias scanslot r0
move scanslot 2
move currqty 0
sumloop:
ls r1 vend scanslot PrefabHash
bne r1 currhash notmatch
ls r1 vend scanslot Quantity
add currqty r1 currqty
notmatch:
add scanslot 1 scanslot
bgt scanslot LASTSLOT ra # scanned all the slots
j sumloop

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.