The pointer begins at memory location 3. It can be moved left or right infinitely. IO is memory mapped. To read from the console, toggle the bit at location 0 twice without moving or hitting a loop; this will read one bit from the console into location 2. To write to the console, toggle the bit at location 1 twice without moving or hitting a loop; this will write one bit from location 2 to the console. Since all console IO is bytewise, all reads and writes to the console are buffered (8 bits).
|Toggles the bit at the current location and sets the toggle flag.
|If the toggle flag is clear, move the pointer right. If the toggle flag is set, move the pointer left. Either way, clear the toggle flag.
|If the bit at the current location is 1, jump forward to the matching
f. Also, clear the toggle flag.
|If the bit at the current location is 0, jump backward to the matching
d. Also, clear the toggle flag.
asaasaasssasaasssasaaaasssasaasssasaaaaaaaasssasaaaasssasaaaasssasaasssasaasssasaasssasaasssasaaaasssasaasssasaaaasssasaaaaaasssas aaaasssasaasssasaaaasssasaaaaaasssasaaaasssasaasssasaaaaaaaasssasaaaasssasaasssasaasssasaaaasssasaaaaaaaasssasaasssasaaaaaaaaaaaas ssasaaaaaasssasaasssasaaaaaasssasaasssasaaaasssasaasssasaaaaaaaasssasaasssasaaaaaasssasaaaasssasaasssasaaaasssasaaaasssasaasssasaa aasssasaaaaaasssasaaaasssasaaaasssasaasssasaaaaaaaasssasaasssasaaaaaaaasssasaa
Move the pointer right, regardless of toggle bit (note: may perform I/O at low addresses)
Move the pointer left, regardless of toggle bit (note: may perform I/O at low addresses)
Toggle the bit at the current location and clear the toggle flag