Editing IC10
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 596: | Line 596: | ||
main: | main: | ||
yield | yield | ||
− | #read plant data from the Tray | + | #read plant data from the Tray |
ls r0 dTray 0 Mature | ls r0 dTray 0 Mature | ||
− | #harvestable plants return 1, young plants return 0 | + | #harvestable plants return 1, young plants return 0 |
− | #nothing planted returns -1 | + | #nothing planted returns -1 |
beq r0 -1 plantCrop | beq r0 -1 plantCrop | ||
beq r0 1 harvestCrop | beq r0 1 harvestCrop | ||
ls r0 dTray 0 Seeding | ls r0 dTray 0 Seeding | ||
− | #seeds available returns 1, all seeds picked returns 0 | + | #seeds available returns 1, all seeds picked returns 0 |
− | #plants too young or old for seeds returns -1 | + | #plants too young or old for seeds returns -1 |
beq r0 1 harvestCrop | beq r0 1 harvestCrop | ||
j main | j main | ||
plantCrop: | plantCrop: | ||
− | #stop the planting if no seeds available | + | #stop the planting if no seeds available |
− | #otherwise it will plant nothing repeatedly | + | #otherwise it will plant nothing repeatedly |
ls r0 dHarvie 0 Occupied | ls r0 dHarvie 0 Occupied | ||
beq r0 0 main | beq r0 0 main |