• [TimeWarp] 80′s C64 “Hello World!”

    Posted on February 27th, 2009 admin No comments

    When you beggining with learning new programming lanuage, first, very explanatory example is “Hello World!”. In this article we will see how first steps are maked in Commodore’s 64 BASIC. So, back in ’80s. First day in front of C=64.

    Example 1.

    First commands you learn are: PRINT, GOTO and RUN. I think that explanation of these commands is not needed.

    C64 Hello World 1

    C64 Hello World 1

    Great example! RUN and hit RETURN! Surprise!!!

    C64 Hello World 1 Running

    C64 Hello World 1 Running

    Maybe it’s looks useless to you, but it’s first step in programming BASIC. When you want to stop running of this program just hit RUN/STOP key.

    Example 2.

    Infinite loop? Next step is to take control. Program prints 10 times our message and then ending. It’s time to learn next command: FOR/NEXT loop:

    C64 Hello World 2 Running

    C64 Hello World 2 Running

    It’s just we want.

    Example 3.

    If you try other versions of BASIC language, you’ll notice that C=64 BASIC V2 doesn’t have any command for graphics (draw lines, plot pixels) even changing screen color. It’s right time to begin with direct memory access.

    If you want to change value of some memory location there is command: POKE. Border color is on address 53280, screen color on 53281.

    C64 - changing screen color

    C64 - changing screen color

    Commodore BASIC is very limited for those who want to make programs in hi-res. Seting pixels are more complex and, for BASIC interpreter, very slow to implement. Back in 80′s there are two common solutions: SIMON’S BASIC – very rich extension to BASIC or to use ASSEMBLER. Of course, if you making anything commercial, for C64 Assembler is imperative!

    Share and Enjoy:
    • Digg
    • Sphinn
    • del.icio.us
    • Facebook
    • Mixx
    • Google
    • blinkbits
    • Blogosphere News
    • De.lirio.us
    • LinkedIn
    • MisterWong
    • MySpace
    • Propeller
    • Reddit
    • Slashdot
    • SphereIt
    • StumbleUpon
    • Technorati
    C64

    Comments are closed.