Assembly Robot I have written a simple AI in a simulated assembly environment. The environment contained a small level with objects, a robot to navigate around in said level and a simulated computer with 256 bytes of memory and no registers. With these limited resources I wrote a behavior for my robot using assembly code and some commands the environment provided for specific actions. In the end the robot has one final flaw that I haven't been able to deal with and that seems to be a bug in the framework. To explain: I found out when I was comparing the type of the object the robot scanned to the top priority type: assembly code: ;battery PUSH8 type ;push int variable "type" to the stack PUSH8 #8 ;push an integer 8 to the stack if_eq8 ;compare both jnz cmpbatterypriority ;if the comparisant checks out jump to the function "cmpbatterypriority" In this example the type was equal to #2 and while 0x00 was pushed to the stack to indicate the comparison had failed, the program still jumped to "cmpbatterypriority" and never removed the the 0x00 from the stack not only causing my robot to not behave like it should but also stack overflow since the 0x00 is not popped off the stack. This is my robot code in a text file (I called it Rigel, I like naming things after stars)
0 Comments
Leave a Reply. |
AuthorFlorian Gaeremynck Archive
June 2019
Categories
All
|