# this program manages a cooling buffer, piping cool gas into a destination, and then refilling the buffer from a hot gas supply that needs to be cooled. alias hotgas d0 # sensor alias coolinggas d1 # sensor alias targetkelvin d2 alias outpump d3 alias inpump d4 alias readout d5 alias activesome r15 alias activecool r14 alias activelow r13 alias activegood r12 alias waitingsome r11 alias waitingcool r10 alias target r9 define targetpressure 500 s outpump On 0 s inpump On 0 start: s hotgas On 1 s coolinggas On 1 l target targetkelvin Setting l r1 hotgas Pressure slez r1 r1 # waiting_pressure<=0 l r0 coolinggas Pressure sgt r2 r0 5 or r1 r1 r2 sgtz activesome r0 and activesome activesome r1 slt activelow r0 targetpressure l r0 coolinggas Temperature slt activecool r0 target and activegood activesome activecool bdns readout skipdisplay s readout Setting r0 skipdisplay: # should the output pump be on? s outpump On activegood l r0 hotgas Pressure sgtz waitingsome r0 l r0 hotgas Temperature slt waitingcool r0 target select r0 activegood 0 activelow or r0 waitingcool r0 and r0 waitingsome r0 s inpump On r0 bgtz r0 live bgtz activegood live s hotgas On 0 s coolinggas On 0 sleep 10 live: yield 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.