-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The Commodore Plus/4 is a moderately weird/rare machine, so it probably qualifies for the challenge, if I do it in the built-in machine language memory monitor.
A 0332 LDX #$00
A 0334 LDA $034C
A 0337 CMP $0356
A 033A BEQ $0346
A 033C STA ($C8,X)
A 033E INC $0335
A 0341 INC $C8
A 0343 JMP $0334
A 0346 LDA #$4C
A 0348 STA $0335
A 034B BRK
'>' 034C 88 85 8C 8C 8F 92
'>' 0352 8C 84 A1 00`
A is the assemble command, > is the command for directly manipulating bytes in memory (the quotes are just so that github doesn't mis-interpret them as indentation).
The code is placed into memory at the cassette device buffer (which ranges from $0332 to $03F2, 192 free bytes).
Noteworthy memory locations are $00C8-$00C9, this is where the machine keeps track of / points to the address of the cursor's curent place in the video memory.
The main loop is inbetween $0334 and $0343.
It reads a character byte (from between $034C and $0355) to register A.
Next it compares against a zero, and if true, then jumps out of the loop.
Then it stores the content of A indirectly to $00C8.
Lastly, it increments the appropriate bytes, then loops.
Had to increment the lower byte at $00C8 manually, there are probably better ways to do things, I don't remember.
After the main loop, a byte is reset to the default value to match the beginning location of the letters, so when we re-run the code, it does its thing again.
G 0332 runs the code.
The letters appear in inverse, because I was feeling fancy.