# items that match the hash go to Output 1, # unless Output 1 is blocked alias target r15 alias inputhash r14 alias inputoccupied r13 alias out2occupied r12 alias polarity r11 alias target2 r10 alias chuteoccupied r9 start: alias sorterfern d0 alias sorterrice d1 alias sorterwheat d2 alias chutefern d3 alias chuterice d4 alias chutewheat d5 define FERNSEEDHASH -1990600883 define POTATOSEEDHASH 1005571172 define WHEATSEEDHASH -654756733 define RICESEEDHASH -1691151239 #define FERNHASH 892110467 #define POTATOHASH 1929046963 #define WHEATHASH -1057658015 #define RICEHASH 658916791 define FERNHASH -1990600883 define POTATOHASH 1005571172 define WHEATHASH -654756733 define RICEHASH -1691151239 yield move polarity 1 move target FERNSEEDHASH # fern seed move target2 FERNHASH alias sorter d0 alias chute d3 jal dosort move target RICESEEDHASH # wheat seed move target2 RICEHASH move polarity 0 alias sorter d1 alias chute d4 jal dosort move target WHEATSEEDHASH # wheat seed move target2 WHEATHASH alias sorter d2 alias chute d5 move polarity 1 jal dosort j start dosort: bdns sorter ra move chuteoccupied 0 bdns chute nochute ls chuteoccupied chute 0 Occupied nochute: s sorter Mode 2 ls inputhash sorter 0 PrefabHash ls inputoccupied sorter 0 Occupied ls out2occupied sorter 0 Occupied blez inputoccupied ra #no input, do nothing select r0 polarity 2 1 ls out2occupied sorter r0 Occupied bgtz out2occupied mismatch # uhoh, that output is backed up, use the other. seq r0 inputhash target seq r1 inputhash target2 select r1 chuteoccupied 0 r1 or r0 r1 r0 beqz r0 mismatch s sorter Output polarity j ra mismatch: seqz r0 polarity s sorter Output 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.