I gave it this:
clear lda #96 clearA ldx #1024 loop sta ,x+ cmpx #1536 bne loop rts
…and ChatGPT gave me this:
clearsubroutine in this code is used to clear the screen and initialize it with a grid of green squares. The subroutine begins by loading the value
96into the accumulator register
LDAinstruction. This value represents the color value for green, which will be used to fill the screen with green squares.
LDXinstruction is used to load the value
Xregister. This value is the memory address of the top left corner of the screen, and it will be used as the starting point for the
POKEoperations that will be used to fill the screen with green squares.
looplabel marks the start of a loop that will be used to fill the screen with green squares. Inside the loop, the
STA ,X+instruction is used to store the value in the accumulator register
Aat the memory location pointed to by the
Xregister, and then increment the
Xregister by one. This has the effect of setting the value at the current memory location to the color value for green, and then moving to the next memory location on the screen.
CMPXinstruction is then used to compare the value in the
Xregister to the value
1536. If the
Xregister is less than
1536, it means that there are still memory locations on the screen that need to be filled with the color value for green. In this case, the
BNEinstruction is used to branch to the
looplabel, causing the loop to be repeated and the next memory location on the screen to be filled with the color value for green.
If the– ChatGPT AI
Xregister is equal to
1536, it means that all of the memory locations on the screen have been filled with the color value for green, and the loop can be exited. In this case, the
BNEinstruction will not be executed, and the
RTSinstruction will be executed, causing the subroutine to return to the main program. This completes the execution of the
Now, it may have figured some of this out because I previously fed it a longer (and fully commented) bit of 6809 code that contained that routine as one of its several functions. That’s the only way I can see it knew the screen location and a green block.
I’ll be impressed when you can send them a binary file and they completely disassemble it and comment the disassembly with fairly reasonable accuracy!
You should see some of the crazy interactions I had with it last night, posted to my Facebook page. It outright made stuff up about one of my programs, and when I called it out, it apologized and corrected itself. Wild.
I need to put together some videos of what this thing can do. It takes care and guidance, but it actually writes stuff. It turns requests in to code, that works. It’s done a few things I wouldn’t have even thought to do.
Pingback: CoCo Nation News stories for Episode 291, December 10, 2022 -