# 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 start: alias sorterfern d0 alias sorterpotato d1 alias sorterwheat d2 alias sorterrice d3 alias sorterwheat2 d5 define FERNSEEDHASH -1990600883 define POTATOSEEDHASH 1005571172 define WHEATSEEDHASH -654756733 define RICESEEDHASH -1691151239 yield move polarity 1 move target FERNSEEDHASH # fern seed alias sorter d0 jal dosort move target POTATOSEEDHASH # potato seed move polarity 0 alias sorter d1 jal dosort move target WHEATSEEDHASH # wheat seed alias sorter d2 move polarity 1 jal dosort move target RICESEEDHASH # wheat seed alias sorter d3 move polarity 0 jal dosort move target WHEATSEEDHASH # wheat seed alias sorter d5 move polarity 1 jal dosort j start dosort: bdns sorter ra 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. bne target inputhash 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.