Sample Program I

Here is the canonical Hello World program in A-Shell BASIC:

PRINT "Hello World"

END

 

The program must exist first as a text file, typically with a BAS or BP extension, created in any text editor such as VUE or APN. Assuming the file is assigned the name hello.bas, it can be compiled from the A-Shell dot prompt as follows:

.COMPIL HELLO.BAS

 

The compiler responds:

Phase 1 - Parse source and generate object code

Phase 2 - Adjust object file and process errors

Memory usage:

Total work space - 18600 bytes

Label symbol tree - 16 bytes

Variable symbol tree - 20 bytes

Declaration tree - 16 bytes

Structure symbol tree - 16 bytes

Data statement pool - 0 bytes

Variable indexing area - 0 bytes

Compiler work stack - 16 bytes

Excess available memory - 1911620 bytes

End of compilation

 

The compiled program will typically have a .RUN extension, can be seen and manipulated with file commands such as DIR, SIZE, COPY, etc. (see LIT Commands), and can be executed with the RUN command. For example:

.DIR HELLO

HELLO      BAS  1

HELLO      RUN  1

Total of 2 files in 2 blocks.

 

.RUN HELLO

Hello World

.