• palordrolap@kbin.social
    link
    fedilink
    arrow-up
    4
    ·
    2 months ago

    Wow. I totally forgot that Commodore BASIC ignores spaces in variable names. I do remember that it ignores anything after the first two letters though. That said, there’s a bit more going on here than meets the eye.

    PRINT HELLO WORLD is actually parsed as PRINT HELLOW OR LD, that is: grab the values of the variables HELLOW (which is actually just HE) and LD, bitwise OR them together and then print.

    Since it’s very likely both HE and LD were undefined, they were quietly created then initialised to 0 before their bitwise-OR was calculated for the 0 that appeared.

    Back in the day, people generally didn’t put many spaces in their Commodore BASIC programs because those spaces each took up a byte of valuable memory. That PET2001, if unexpanded, only has 8KB in it.

    </old man rant>

    • Telorand@reddthat.com
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      Neat. Sounds very confusing for future maintenance, but when you only have 512KB of storage, you do what you gotta do!

      • palordrolap@kbin.social
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        512KB? At the risk of going all Four Yorkshiremen, that sounds luxurious.

        Floppy disks held 170KB if you were lucky to have a drive. The PET line, like many 8-bit computers, used a cassette tape drive (yes, those things that preceded CDs for holding and playing music). Capacity depended on the length of the tape. And it took ages to load.

        The PET was fancy because it had a built-in cassette drive. That’s what you can see to the left of the keyboard in the picture.

  • gregorum@lemm.ee
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    2 months ago

    some people just want to see the world

    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS
    BOOBS

  • lefaucet@slrpnk.net
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Everyone’s heard of the “Hello world” being people’s first program, but just as popular among teenaged boys is their second, more advanced program: Boobs! :)