Skip to content

Latest commit

 

History

History
115 lines (80 loc) · 2.56 KB

File metadata and controls

115 lines (80 loc) · 2.56 KB

Getting Started with ALTAIR BASIC

Welcome to ALTAIR BASIC! This guide will help you take your first steps with this historic programming language.

What is ALTAIR BASIC?

ALTAIR BASIC is a programming language created by Bill Gates and Paul Allen in 1975 for the MITS Altair 8800, one of the first personal computers. This modern interpreter lets you write and run BASIC programs on today's computers.

Running the Interpreter

After installing the program (see README.md for installation instructions):

  1. Start the interpreter
  2. You'll see a welcome message and a Ready> prompt
  3. Now you can start typing commands or program lines

Your First Program

Let's create a simple program that prints a message:

  1. Type the following lines (press Enter after each line):

    10 PRINT "HELLO, WORLD!"
    20 PRINT "THIS IS MY FIRST BASIC PROGRAM"
    30 END
    
  2. Run your program by typing:

    RUN
    
  3. You should see the messages displayed:

    HELLO, WORLD!
    THIS IS MY FIRST BASIC PROGRAM
    

Basic Commands

Here are some essential commands to get you started:

  • LIST - Shows your current program
  • NEW - Clears the current program to start over
  • SAVE filename - Saves your program to a file
  • LOAD filename - Loads a program from a file
  • RUN - Executes your program

Variables and Calculations

BASIC lets you store values in variables and perform calculations:

10 LET A = 5
20 LET B = 10
30 LET C = A + B
40 PRINT "THE SUM IS"; C
50 END

User Input

You can get input from the user with the INPUT command:

10 PRINT "WHAT IS YOUR NAME?"
20 INPUT N$
30 PRINT "HELLO, "; N$
40 END

Conditional Logic

Use IF...THEN to make decisions in your program:

10 PRINT "ENTER A NUMBER"
20 INPUT N
30 IF N > 10 THEN PRINT "THAT'S A BIG NUMBER!"
40 IF N <= 10 THEN PRINT "THAT'S A SMALL NUMBER!"
50 END

Loops

Use FOR...NEXT to repeat code a specific number of times:

10 PRINT "COUNTING FROM 1 TO 5:"
20 FOR I = 1 TO 5
30 PRINT I
40 NEXT I
50 END

Example Programs

Try loading and running some of the example programs to see more possibilities:

LOAD examples/hello.bas
RUN

Getting Help

Type HELP at the prompt to see a list of available commands.

Have Fun!

BASIC was designed to be easy and fun to learn. Don't worry about making mistakes - experiment, learn, and enjoy the experience of programming like people did back in the early days of personal computing!

For more detailed information, see the README.md file or explore the example programs in the examples folder.

Happy coding!