EDIT(4)- this is used to set the 'back-space mode' that the editor will use. certain modes allow more control than others. mode 0 indicates that the actual mode is not known. the editor will work fine, but some functions will be disabled. under mode 1, the editor will assume that the user has a 'non-destructible' backspace. this allows all the editor functions to be used and is how the local console is setup. mode 2 tells the editor that the user has a 'destructible' backspace. under this mode, some functions are disabled, but the editor speeds up certain other functions. |
+| END | END | dev | Same as AppleSoft, this command terminates program. Returns to ACOS restart state. |
+| FILL | FILL start, length, data | dev | The FILL statement is used to fill an area of memory with some bytes of data. Generally it is used to zero out memory. START is a 16 bit memory address, length is an 8 bit [0-255] number, and DATA is the byte that will be used to fill memory. |
+| FLAG | expression=FLAG
FLAG=number
FLAG=(number)
FLAG(number)=number1 | dev | The FLAG function is a low overhead way to store 1 bit information. You just need to point the FLAG function to a point in memory that you wish to store your data in, and you can manipulate as many flags as you need. Each byte of memory can contain 8 flags. To setup the FLAG function, use the first syntax to point the function to a point in memory where the flags will be stored. Once the pointer is setup, you can use the FLAG just like a variable using the second and third syntax for reading and writing the flags. |
+| FOR | FOR numvar=number TO number STEP number
...
NEXT | dev | Appears to have same function and limits as AppleSoft FOR-NEXT loops. However, you can only have ONE for loop active at a time, i.e. the NEXT command does not allow for a variable, it only operates on the currently active FOR loop. |
+| FREE | FREE | dev | Has the same function as the AppleSoft FRE(0) command, in that it returns the amount of free memory. REMY TODO: Does this garbage collect? |
+| GET | GET varstr | dev | The GET statement is used to get a single keypress from the user. When encountered, the system will wait until a key is pressed. The key will be returned in varstr. Control characters will not be filtered out as they are with INPUT. |
+| GOSUB | GOSUB label | dev | Appears to have same function as AppleSoft GOSUB. Only thing worth noting is that ACOS uses labels as targets instead of line numbers. |
+| GOTO | GOTO label | Working | Appears to have same function as AppleSoft GOTO, again with the exception that ACOS uses labels not line numbers. |
+| HOME | HOME | dev | Appears to have same function as applesoft HOME. Clears current window. REMY TODO: Does this clear the remote session as well? |
+| IF | IF *condition* [THEN] *statement1* [ELSE] *statement2* | dev | Evaluate *condition* and if true (or greater than zero), execute *statement1*. If optional ELSE statement is specified, then a false condition will execute *statement2*. If ELSE is used, it must appear on the same line as the IF statement. Logical constructs for *condition* supports parenthesis, AND, and OR.THEN is optional (as it is in AppleSoft BASIC) but if you use THEN, it cannot be followed by a label directly.(use IF arg THEN GOTO label). |
+| INFO | expression=INFO(optional)
INFO(optional)=expression | dev | INFO can be used as either a statement or as a function. It is really a 'catch-all' in nature. many values that are more or less unrelated are returned. The following table gives the meanings of all the INFO data.
argument r/w function
-------- ---- -----------------
INFO(0) r is there a caller online? (0=no)
INFO(1) r capacity of current message file.
INFO(2) r callers baud rate /300 (1=300)
INFO(3) r/w current number of nulls.
INFO(4) w top screen stats. (1=chat, 2=exec)
INFO(5) r/w executive user online? (1=yes)
INFO(6) r checks bit map for mail/msg bases for room.
|
+| INPUT | INPUT [#*device*,] [@*mode*,] [\\] ["*text*"] *variable* [,[\\] *variable*..] | dev | Gets input from a device or interactively with the user and stores the result in one-to-many variables. There are quite a few variations how the INPUT statement can be used, but at a minimum it requires one *variable* to be specified. Specifying the *device* is required if inputting data from a device handle (e.g. an open file). Omitting the *device* will default to getting input from the user.
A text prompt can be optionally specified by supplying *text* before the variables. The text can serve as a prompt (e.g. "What is your name? *input here*"). If backslash (\\) is put before or after the *text*, this will result in a newline being part of the prompt (note distinction between this and using backslash for multiple variables).
Multiple variables can be specified in either a comma-separated or backslash (\\) way (or a mixture thereof), though this is typically for file input rather than interactive user input. As with the PRINT statement, the comma is taken literally (e.g. if you were to read multiple fields from a comma-separated file), and the backslash as part of the variable list implies that there will be a newline to parse (e.g. INPUT #1, A\$\\B\$
reads two lines from the file, A\$ on the first line and B\$ on the second line).
The *mode* (with '@' symbol prefix) is an optional way of specifying how the INPUT command will behave. Using *mode* is ONLY for interactive input and cannot be combined with a *device*. The various modes are as follows:
- INPUT - (no mode specified) set the input mode to uppercase, don't accept a blank line.
- INPUT @0 - set the input mode to uppercase, don't accept a blank line, just return the first character.
- INPUT @1 - set the input mode to uppercase, don't accept a blank line, don't accept any commas.
- INPUT @2 - set the input mode to uppercase, blank lines will be accepted.
- INPUT @3 - accept everything. (upper & lower).
|
+| INSTR | expression=INSTR(*match*, *source*) | dev | The INSTR function is used to search within a *source* string for the existence of the specified *match* string. The search is case insensitive. The function will return the numerical position of the first character in the *source* string where the *match* was found. Note that the first character in *source* string starts at 1, not 0 like many other languages. So in other words, if the function returns zero, no match was found. |
+| KEY | expression=KEY(0)
expression=KEY(1)
expression=KEY(2) | dev | The KEY function is used to check and see what if any keys have been pressed. It is generally used to check to see if a routine needs to be interrupted and is used in conjunction with the SETINT and ADDINT statements. This routine does not wait for a key, it returns either a zero for no key or the ASCII value of the key. In the KEY(1) form, a non-zero byte will be returned if the key pressed was the 'file stop' character. In the KEY(2) form, a non-zero byte will be returned if the pressed key is the 'file next' key defined in config. |
+| KILL | KILL filename
KILL #MSG(expression) | dev | The KILL statement can be used in two different ways. In both ways it is used to delete data. In the first form, with the filename, it will delete the file from disk. In its second form, it will kill a message within the currently active message base. After using KILL on a message, it is always a good idea to follow it with an UPDATE. |
+| LEFT$ | string=LEFT$(*source*, *length*) | dev | Returns the first *length* characters of *source* string. |
+| LEN | expression=LEN(string) | dev | Returns the length of the supplied string. A result of zero means the string is empty. |
+| LINK | LINK filename [,label] | dev | The LINK statement allows you to load a different program segment and execute that one, optionally starting at a specified label. The purpose of this is to allow for your code to be split up into multiple segments, but also to support additional code to be used without modifying the other. The *filename* argument is mandatory and is in the standard filename syntax. If you wish the execution to begin at a point other than the beginning of the module, then the *label* argument can be specified in string form (e.g. LINK "A:MSG.SEG","BULLETINS"
). The label must be enclosed in quotes or must be in a string variable. Note that for the label to be usable by the LINK command, the label must be declared as PUBLIC in the target file. |
+| LOG | LOG drivespec | dev | The LOG statement simply changes the default disk drive to the *drivespec* drive. If the drive is not legal, a BAD DRIVE SPECIFIER error will occur. |
+| MARK | expression=MARK(device)
MARK(device)=number | dev | The MARK function will allow you to either set or check the point at which a file is doing I/O. If you want to go to the beginning of a file, you would issue a MARK(1)=0 assuming it was file 1. MARK has a second function in that it can be used to see if a file exists. Normally ACOS will not generate an error if a file exists, so it can be hard to tell if there is one. To see if a file exists: OPEN #1,filename
IF MARK(1) PRINT "FILE EXISTS"
CLOSE #1
|
+| MID$ | string=MID$(source, start [,length]) | dev | Returns the contents of *source* into *string* starting at character position *start* to the end of *source*, or only up to *length* number of characters. |
+| MODEM | MODEM(number) | dev | The MODEM command is used for controlling the communication session with the remote user. The ACOS language was originally written for modems and thus the keyword is kept for consistency despite A2osX having replaced the underlying communications with a networking stack. Regardless, the functionality remains the same albeit applied to telnet sessions. The modem functions are as follows:
- MODEM(0) - this command needs to be issued before any other modem command is used. Its function is to initialize the modem driver for later use.
- MODEM(1) - this command waits for an incoming call and establishes a connection. Execution will continue when either a call is connected or the user goes into local mode.
- MODEM(2) - this command causes the modem to hangup (terminate telnet session). All further output will be sent to console only.
|
+| MOVE | MOVE start,length TO destination | dev | The MOVE statement is used to move segments of memory around. The only limitation is that only a maximum of 255 bytes can be moved at any one time. Both START and DESTINATION are 16 bit memory addresses while LENGTH is an 8 bit [0-255] number. |
+| MSG | expression=MSG(number)
MSG(number)=expression
device={#MSG(number)} | dev | The MSG function is a specialized function for the ACOS message handling routines. Once a message file has been opened via the READY command, the MSG function is used to access individual messages within the message file. The MSG function has two radically different syntaxs. Under the first and second syntax, it is being used to access and set information about a message. For each message, you can maintain one number that gives information about it via the MSG function. The MSG(0) function returns the number of messages within the message file and may not be changed. To access a message, it is used as a device channel. While to show the editor COPY#8 would suffice, since the message file is made up of many messages, it is necessary to tell which message you want to work with. COPY#MSG(3) would show message number three within the currently open message file. |
+| NEXT | NEXT | dev | For use with the FOR statement in FOR-NEXT loops. Unlike with AppleSoft or some other BASIC implementations, you cannot use a variable after NEXT. (NEXT X is illegal). |
+| NIBBLE | NIBBLE=number
NIBBLE(number)
NIBBLE(number)=number16 | dev | The NEXT function is similar to the FLAG function in that it is a low overhead data storage method. With the NIBBLE function, you can store 4 bit numbers that have the range 0-15. Use the first syntax of NIBBLE to point to the point in memory where the data will be stored. Use the second and third syntax to read and write the actual data. |
+| NOT | expression= NOT expression | dev | The NOT operator is a boolean logic operator. It changes the value of an expression from true to false or from false to true. In booleon logic, false is considered to be zero while not false or true, is considered to be any other number. The NOT operator is most commonly used in IF statements. |
+| ON NOCAR | ON NOCAR GOTO label | dev | The ON NOCAR statement is used to setup a routine that can be used when carrier is lost from a remote user. When the carrier is lost, ACOS will then hang up the modem. It will then change the current execution point to the label that was setup. Whenever you link to another segment you must set up a new ON NOCAR vector to a routine within that segment. If you don't have a vector set up and a remote caller drops carrier, the system will just sit there until it times out. |
+| OPEN | OPEN #device,filename | dev | The OPEN statement is used to make disk files ready to do I/O with out a program. You open a disk file using either device channel 1 or 2, and all further references to that channel will access the file associated with it. When you are finished with the file, use the CLOSE command. This will free up the device channel for later use. If you try to use a channel that is already in use, or one besides channel 1 or 2, you will get a BAD DEVICE CHANNEL error. If the file you open does not exist, no error will be generated. If you try to read from the file, it will appear to be empty. Use the CREATE command to make a file. |
+| PDL | expression=PDL(number) | dev | The PDL function is used to read one of the paddles on the system. You can read paddle zero through three. The number returned will be in the range 0-255. |
+| PEEK | expression=PEEK(address) | dev | Returns the value of the byte located at *address*. REMY TODO: Does this work in A2osX? Perhaps limit it to $C000-CFFF? |
+| POKE | POKE address,value | dev | Sets the value of the memory location specified at *address* with *value*. REMY TODO: Does this work in A2osX? Perhaps limit it to $C000-CFFF? |
+| POP | POP | dev | Works the same as the AppleSoft POP statement with the exception of it also can be used with the ACOS PUSH command. |
+| POSITION | POSITION #device, record_length, record_number [,offset] | dev | The POSITION statement is used to position within a random access file. The *device* argument is the disk device channel number that was used to open the file. The *record_length* argument is the length of each record. The *record_number* argument is the record number to be positioned to. The optional *offset* argument is the offset within the record that is to be positioned to. Note that there is no check to see if files actually conform to *record_length*; it along with the other *record_number* and *offset* arguments simply form a means of providing a calculation for a byte offset in the file as a while. For example, POSITION #1, 1000, 3, 50
would result in seeking file device #1 to the 3050'th byte in the file. |
| PRINT | PRINT [#device,] [expression] | dev | [,expression] [;]
rules for PRINT:
control: ',' - the comma is used to separate expressions within the print statement and will be printed literally.
control: ';' - the semi-colon is also used to separate expressions it will not be printed when encountered, if a semi- colon is the last character in the line, then the carriage return will be suppressed.
control: '\' - the backslash is used to generate a newline character using the backslash, there is no need to put a bunch of print:print... statements.
exprs: TEXT - text must be contained within quotes and will be printed exactly as typed. within quotes, you may have any special characters including return. having an open quote with no close can prove to be an interesting experience.
exprs: STRING- the contents of the listed string will be printed.
exprs: NUMBER- the content of the listed number will be printed. |
| PUBLIC | PUBLIC label | dev | the PUBLIC statement is used to make a label within a program module available to other modules to link to. if you wish to link to another program module, and start execution at a point other than the beginning of the module, you will need to make that point public. you can have a maximum of 8 public labels within a program module. |
| PUSH | PUSH label | dev | the PUSH statement is a sub-set of the GOSUB statement. it does not actually change the current point of execution, but places a return address in a table so that the next time a RETURN statement is encountered, control will return to this present point. a POP statement will remove the last address added to the return table. |