alias autolathe d0 #alias stacker d1 alias larre d2 alias export d3 alias ringmaster d5 # the IC containing the coordinating RAM alias address r15 alias qty r14 alias hash r13 #alias latheptr r12 alias lockerIndex r11 define lockerStation 4 define MODULUS 55 move sp MODULUS add sp sp 5 s db Setting sp # start: s db Setting -1 yield get r0 ringmaster 120 bne r0 4 -2 # wait for our turn to control LArRE s db Setting -2 harvest: ls r0 export 0 Occupied #j survey # debug blez r0 survey put ringmaster 120 3 # hand off to the trucker j start survey: s larre Setting lockerStation move address 0 zeroram: # zero out the survey RAM put db address 0 add address address 1 blt address MODULUS zeroram jal waitLarreIdle move lockerIndex 0 inventory: # count up how many of each item there are #s db Setting lockerIndex s larre TargetSlotIndex lockerIndex ls hash larre 255 OccupantHash beqz hash emptyInventory mod address hash MODULUS ls r1 larre 255 Quantity get qty db address add qty r1 qty put db address qty emptyInventory: add lockerIndex lockerIndex 1 blt lockerIndex 30 inventory s db Setting 19 handOff: s db Setting 79 put ringmaster 120 1 # fabber takes over j start waitLarreIdle: #s db Setting 10 yield l r0 larre Idle blez r0 waitLarreIdle #s db Setting 11 j ra # # sum up the quantity of each item in the system # |
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.