alias vending d0 alias hash r15 alias qty r14 alias index r13 alias accum r12 alias scanslot r11 define LASTSLOT 100 define MAXINDEX 55 define MODULUS 54 # magic define MEMORYHASH HASH("StructureLogicMemory") define DISPHASH HASH("StructureConsoleLED5") 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: get qty db 8 move hash HASH("display waspaloy") jal display get qty db 41 move hash HASH("display stellite") jal display get qty db 53 move hash HASH("display steel") jal display get qty db 11 move hash HASH("display solder") jal display get qty db 30 move hash HASH("display silver") jal display get qty db 10 move hash HASH("display silicon") jal display get qty db 40 move hash HASH("display nickel") jal display get qty db 43 move hash HASH("display lead") jal display get qty db 35 move hash HASH("display iron") jal display get qty db 21 move hash HASH("display invar") jal display get qty db 5 move hash HASH("display inconel") jal display get qty db 22 move hash HASH("display hastelloy") jal display get qty db 18 move hash HASH("display gold") jal display get qty db 44 move hash HASH("display electrum") jal display get qty db 46 move hash HASH("display copper") jal display get qty db 47 move hash HASH("display constantan") jal display get qty db 0 move hash HASH("display astroloy") jal display yield move sp 0 clear: push 0 blt sp MAXINDEX clear move scanslot 0 nextslot: ls hash vending scanslot PrefabHash ls qty vending scanslot Quantity mod sp hash MODULUS add sp sp 1 pop accum add accum accum qty push accum empty: s db Setting scanslot add scanslot scanslot 1 ble scanslot LASTSLOT nextslot j start display: sbn DISPHASH hash Setting qty move r0 2 # green bge qty 40 setcolor move r0 5 # yellow bge qty 20 setcolor move r0 4 # red setcolor: sbn DISPHASH hash Color 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.