home.social

#geminipro — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #geminipro, aggregated by home.social.

  1. ChatGPT-o1 was able to describe this 6502 assembly language function:

    ```
    Here is a 6502 assembly language routine. The ROM_COUT routine prints the character stored in the A register. Generate a comment for this routine describing what it is for, and any inputs and outputs. Also indicate which registers are used and would have to be saved before calling the routine.

    routine:
    LDY #$00
    LDA ($B0),Y
    TAX

    .a:
    DEX
    BPL .b
    RTS

    .b:
    INY
    LDA ($B0),Y
    JSR ROM_COUT
    JMP .a
    ```

    The response seems accurate to me:

    ```
    ; Routine: Print Length-Prefixed String from Memory Address in $B0/$B1
    ;
    ; Description:
    ; This routine outputs a length-prefixed string to the console using the ROM_COUT subroutine.
    ; The string is stored in memory at the address specified by the zero-page pointers $B0 (low byte) and $B1 (high byte).
    ; The first byte at this address represents the length 'n' of the string, followed by 'n' characters to be printed.
    ;
    ; Inputs:
    ; - $B0/$B1: Zero-page pointers containing the 16-bit address of the length-prefixed string.
    ;
    ; Outputs:
    ; - The string is printed to the console, character by character, via the ROM_COUT routine.
    ;
    ; Registers Used (and modified):
    ; - A (Accumulator): Used to load string length and characters.
    ; - X: Used as a counter to keep track of remaining characters to print.
    ; - Y: Used as an index to traverse the string in memory.
    ;
    ; Note:
    ; - If the calling code requires the values in registers A, X, or Y after this routine executes,
    ; it should save and restore them before and after the call, respectively.
    ```

    As a second data point, Gemini got it wrong, claiming that the string had to be null-terminated, and that the string had to be located at $B0.

    Claude (Sonnet) also claimed the string had to be null-terminated, but did see that the string's address was at $B0.

    #6502asm #GeminiPro #ChatGPTo1 #Claude3