GCTAA Logo

Governor's Career & Technical Academy Arlington

CS/IT Resources


Hello, World! with BDS C

Follow these steps to compile your first BDS C program on Altair Z80 SIMH.

  1. Download the OldSchoolC.tgz and extract the archive (% tar xzvf OldSchoolC.tgz).
  2. To get around the restriction on running a file downloaded with a web browser, Turner has created a little Python script you will find in the UTILS subdirectory named turnerfix.py. Copy this to the CPM2 directory and run % python3 turnerfix.py. This will copy altair8800mac2 to altair8800mac. Remove altair8800mac2 after this completes.
  3. You can now launch the emulator with our new CP/M configuration with:

    % ./altair8800mac cpm2
    

    You'll have four floppy disks (A-D) and two hard disks (I-J). Take a few minutes to explore what is on each of them.

  4. Change to the I drive and use the pip command to copy the following files from drive C to drive I:
    I>PIP I:=C:CC.COM
    I>PIP I:=C:CC2.COM
    I>PIP I:=C:CLINK.COM
    I>PIP I:=C:C.CCC
    I>PIP I:=C:DEFF.CRL
    I>PIP I:=C:DEFF2.CRL
    I>PIP I:=C:STDIO.H
    
  5. Using your favorite text editor (ED of course! ;-) create a file named HELLO.C in the I drive with the following contents:
    #include <stdio.h>
    
    main()
    {
        printf("hello, world!\n");
    }
    
  6. Compile and link your program with:
    I>CC HELLO
    I>CLINK HELLO
    
  7. Finally, run your program with:

    I>CLINK HELLO
    

    Then Run:

    I>HELLO
    

    and you should see:

    hello, world!
    

Congratulations! You've just written and compiled your first BDS C program. Wasn't that easy?