Programming largely consists of a repeating iteration of editing, compiling, and running programs (with occasional breaks for snacks). The following overview and tips should help you get started on the A-Shell version of this timeless activity.
u Editors
Although you can use any text or program editor you like, most A-Shell programmers use one or both of the following: VUE is an old-school full-screen plain text editor, vaguely similar to the famous Unix editor vi. Its strong points are that it is:
APN (A-Shell Programmer's Notepad) is a modern Windows program editor / IDE ("Integrated Development Environment"), similar to other IDEs such as Visual Studio. Its strong points are:
|
The ASB compiler processes your source code (typically with a .BAS or .BP extension), creating a run module (typically with a RUN, LIT, or SBX extension, depending on the intended use). There is really only one compiler, but it is packaged in a number of forms to match your working style: From the A-Shell dot prompt:
From within a program (if you want to create your own compilation wrapper), you can invoke the compiler using: XCALL MIAMEX, MX_COMPIL, filename, switches, ... From the Windows shell prompt: >COMPIL.EXE <switches> <program> (The compil.exe package is also used by APN for integrated ASB compilation.) From the Unix shell prompt: $ compil <switches> <program> |
There are three forms of compiled programs, identified by the file extension. All have essentially the same internal format but are executed in different ways:
All three have the same fundamental structure; the file extension determines the usage and behavior. You can use COPY or RENAME to convert from one type to another, or use the FORCE_FSPEC ++pragma within the source code to instruct the compiler how to name the compile program directly. A running program can also launch another LIT or RUN program, either as a subroutine using Xcall AMOS, or by chaining to it using the CHAIN statement. |
u Examples
RUN modules from the dot prompt or a CMD or DO file: .RUN MYPROG .RUN DSK2:MYPROG.RUN[100,2]
LIT modules from the dot prompt or a CMD or DO file (see Command Search Path) : .LOG SYS: ; LOG.LIT .DIR/W ; DIR.LIT .TEST.LIT ; TEST.LIT
From within a program: XCALL FOOBAR,1,2 ! call FOOBAR.SBX; search [p,pn], [p,0], DSK0:[7,6] CHAIN "INVOIC" ! link to INVOIC.RUN; search [p,pn], [p,0], DSK0:[7,6] XCALL AMOS,"RUN TEST" ! execute TEST.RUN as subroutine |