Backing up Program memory 21
Backing up the RAM-, FLASH- or Hard-disk 21
ARGUS BASIC - COMMAND REFERENCE 22
Syntax 22
ABS absolute value 24
ACTIVE set modem active 25
ADC read analogue to digital conversion 27
AND logical AND 28
ANSWER answer a call 29
ASC ASCII value 30
AT AT scan 31
BAUD set baud rate 35
BOOT ON/OFF enable/disable BOOT file 37
BRK transmit a break 38
BUFFER reserve buffer space 39
BUTTON read the S/A button position 42
CALL jump to machine code subroutine 43
CHR$ character string 44
CLEAR clear variables/memory 45
1. CLEAR 45
2. CLEAR ALL 45
3. CLEAR (#[port]) 45
4. CLEAR INPUT (#[port]) 45
5. CLEAR OUTPUT (#[port]) 45
6. CLEAR BUFFER 45
7. CLEAR PRINTER 45
8. CLEAR! or CLEAR FILE 45
9. CLEAR ROM 45
CLOCK$ read internal clock 47
CONNECT connect to remote modem 48
COPY copy files 49
CTS Clear To Send 50
DATA define constant data 51
DATE$ read system date 52
DAY read/set day of week 53
DCD Data Carrier Detect 54
DDAY read/set day in month 55
DELETE or DEL delete program lines/files 56
DIAL dial number 58
DIM reserve space for arrays 59
DIR list file directory 60
DIR ROM list ROM directory 62
DIV integer divide 63
DSR Data Set Ready 64
DTMF ON/OFF dial tone multiple frequency 65
[var] = DTMF read DTMF receiver 66
DTR Data Terminal Ready 67
DUTCH select language and screen mode 68
ECHO enable/disable character echo 69
END end of program 70
ENGLISH select language and screen mode 71
EOR logical Exclusive OR 72
ERL error line system variable 73
ERN error number system variable 74
ESCAPE set Escape character 75
FALSE Boolean system variable 76
FAX MODEM ON/OFF enable/disable fax selector 77
FAX ON/OFF turn FAX on or off 78
FAX RECEIVE receive fax file 79
FAX SEND ...TO... send fax file 80
FOR ... (TO) ... (NEXT) ... (STEP) loop structure 85
FREQ read frequency measurement 87
GET get byte (with wait) 88
GET$ get character (with wait) 89
GOSUB ... RETURN jump to subroutine 90
GOTO unconditional jump 92
HANDSHAKE select/enable handshaking 93
Handshaking via LINKed ports 93
HANGUP disconnect a call 95
HOOK hook control 96
HOUR read/set hour of day 97
IF ... THEN ... ELSE condition test 98
ILINE read input line 99
INPUT read string/number 100
IPORT default input port 102
KEY get byte (without wait) 103
KEY$ get character (without wait) 104
LCASE convert ASCII to lowercase 105
LCASE$ convert string to lowercase 106
LED control LEDs 107
LEFT$ extract left part of a string 108
LEN get length of string 109
LENGTH set or read serial port word length 110
LINEFEED enable/disable Line Feeds 111
LINK connect logical data streams 112
LIST list BASIC program 115
LIST AUTO list program for editing 116
LOAD load BASIC program or data 117
LOAD ROM load BASIC programs from socket 2 118
LTRIM$ remove leading spaces 119
MATCH find matching files/data 120
MATCH ROM find matching files in socket 2 122
MID$ extract middle portion of string 123
MIN set/read minute value 124
MNP (4/5) ON/OFF turn error correction on/off 125
MOD integer remainder operator 126
MODEM select standard modem mode 127
MONTH set/read month of year 128
NETWORK Argus LAN network command 125
NEW new program 132
OLD restore program 133
OLINE set/read digital output line 134
ON AT AT scan event handler 136
ON BRK BRK event handler 137
ON BUTTON USER button event handler 138
ON CONNECT connection detect event handler 139
ON DTD DTR loss event handler 140
ON DTR DTR event handler 141
ON ERROR error handler 142
ON ESCAPE Escape event handler 143
ON ... GOSUB/GOTO jump on value 144
ON HANGUP loss of connection event handler 145
ON OFF disable all events 146
ON RESET reset event handler 147
(a) A !BOOT program is found on the disk 147
(b) No program running at moment of reset 147
(c) Program running at moment of reset 148
ON RESET RUN [filename] 148
ON RESET RUN 148
ON RESET ... 148
ON RING RING event handler 150
ON SEQUENCE Esc. sequence event handler 151
ON SLASH AT scan event handler 152
ON TIMEOUT timeout event handler 153
OPORT default output port 155
ORI output ring indicator 157
OUTPUT send data to port 158
PARITY read or set parity 159
PBOT program bottom 160
PEEK read byte from memory 162
PEEK$ read string from memory 163
PLAY [filename] playback a recorded file 164
PLAY ON/OFF turn play on/off 166
PLAY VOLUME [num] playback attenuation 167
POKE put byte into memory 168
POKE$ put string into memory 169
PORT last event port system variable 170
PRINT send data to port 171
PRINT positioning & formatting 171
PRINTER enable/disable printer port 173
PRINTER and PRINTER ON 173
PRINTER OFF 173
PRINTER LINEFEED ON/OFF 173
PRINTER INPUT/OUTPUT 173
PROTOCOL set file transfer protocol 174
PTOP program top system variable 178
PULSE set/do pulse dialing 179
PUT write byte value to port 180
PUT$ write character to port 181
READ read data items 182
RECEIVE receive file or data 183
RECEIVE #[port], [address] receive data 184
RECEIVE [filename], [type] receive file 185
RECEIVE ALL receive disk backup 189
RECEIVE TIMEOUT = [int] set Sreg66 timeout 190
RECORD [filename] record a voice file 191
RECORD ON/OFF turn record mode on/off 193
RECORD TIMEOUT [num] set record timeout 194
REM remark 195
RENAME rename files 196
RENUM renumber program 197
REPEAT ... UNTIL loop structure 198
REPORT report result or error 199
REPORT ERN 199
REPORT or REPORT RESULT 199
RESET generate hardware reset 200
RESET ALL SREG reset all S-registers to factory settings 201
RESET MODEM 2 reset modem-chip only 202
RESTORE restore pointer to data command/buffer/RAM-disk 203
RESULT last status of modem action 204
RETURN return from procedure/ set return character 206
1. Return from procedure 206
2. Set value of RETURN character. 206
RIGHT$ extract right portion of string 207
RING ring counter 208
ROM access RAM/ROM-disk in socket 2 209
RPT$ repeat string 211
RTRIM$ remove trailing spaces 212
RTS ready to send 213
RUN run a program 214
RUN ROM run a program from ROM/RAM-disk in socket 2 215
SAVE save program or data to memory/disk 216
SAVE ROM save files in RAM-disk in socket 2 217
SCAN set answering speed/scan 218
SEC read/set seconds value 219
SEND send file or data 220
SEND #[port], [address], [address] send data 221
SEND [filename], [type], [option] send file 222
SEND ALL make a backup of disk 227
SEQUENCE select escape sequence character 228
SGN get sign of number 229
SOUND (MODEM) make a sound on speaker or phoneline 230
SPC$ repeat spaces 231
SPEAKER ON/OFF speaker control 232
SPEED set line modem-speed 233
SPEED BUFFER ON/OFF speed buffer on/off 234
SREG set/read S-registers 235
STOP stop program execution 236
TIME$ read or set time 237
TRACE trace program-lines execution 238
TRIM$ remove spaces 239
UCASE convert ASCII to uppercase 240
UCASE$ convert string to uppercase 241
VAL convert string to number 242
VAL$ convert number to string 243
VOICE set modem to voice-mode 244
VOLUME set speaker volume 246
WAIT ... (SEC/MIN) wait some time 247
WHILE ... DO ... WEND loop structure 248
XOFF define XOFF character 249
XON define XON character 250
YEAR read/set year value 251
BASIC Error Messages 252
BASIC Keywords and associated short forms 256
Keyboard & LCD codes 266
Argus BASIC is part of the Argus Programmable Modem, the Argus Call Recorder and of the Telecommunications Centre
Lite (T.C.Lite). A keyboard and LCD display are optional for the Argus Programmable Modem and always available on the
Argus Call recorder and the T.C.Lite. A filing system is optional for the Argus Programmable Modem and can be a RAMdisk, a FLASH-disk, a Hard-disk or an Argus LAN (Local Area Network). The T.C.Lite only supports the FLASH-disk.
Argus BASIC is much like any other version of BASIC in terms of both syntax and structure, but there are also many
significant differences. This chapter provides an overall description of the modem programming environment and goes on to
describe each of the Argus BASIC commands in detail.
Program lines & commands
A BASIC program consists of a series of lines which must start with a 'line number' and may contain up to 255 characters. A
line that is entered without a line number will not be treated as part of a program but will be executed immediately. For
example, the following command :
PRINT "Of Mice and Men - by John Steinbeck"
will display the quoted message on your screen as soon as you press [Return]. Alternatively, when you type the line:
10 PRINT "Of Mice and Men - by John Steinbeck"
it will be treated as line 10 of the current program and stored in the modem's memory until the program is executed.
Program lines may be entered in any order but the modem will always list and execute them sequentially from lower line
numbers to higher ones (unless control of flow is changed by a branch command such as GOTO).
A single program line may contain more than one command with individual commands being separated by a colon. The
following line contains three commands:
10 X=9 : PRINT "The square of ";X;" is "; : PRINT X^2
The first command defines a 'variable' called X and gives it the value 9. The second command outputs a message, including
the value of X, to the currently selected output port, and finally, another PRINT command outputs the value of X^2. The
overall effect of the line is to output the following:
The square of 9 is 81
As many commands may be placed on a single line as will fit in the maximum line length of 255 characters.
BASIC keywords such as PRINT may be entered in upper or lower case but the modem will convert them all to capitals.
Also, it is not necessary to leave spaces between commands, as the modem will insert them automatically.
During program entry it is advisable to leave (numerical) gaps in the line numbering, so that additional lines may be inserted
later. The convention is to number lines 10, 20, 30 etc., although there is a command for re-numbering programs (RENUM).
Variables & constants
Data stored or used in a BASIC program may exist as a 'constant' or as a 'variable'. The following examples are constants:
Constants are so-called because they have a fixed value that does not change during program execution.
The term variable is used to describe a named piece of data whose value can change during program execution. For
example:
X=25
Quote$="The quality of mercy is not strained.."
Here, X and Quote$ are variables which can be given different values at different times. After the command:
X=43
the value of X will be 43, not 25 as previously.
There are only two types of constants and variables in modem BASIC which are known as 'integers' and 'strings'. Floating
point (fractional) numbers are not allowed.
Variable names
Variable names must start with a letter, may contain letters, numbers and the underline character and may be up to 127
characters long. They may be typed in upper or lower case but the modem will convert them during listing so that only the
first character is capitalized. The underline character is generally used to split a variable name into two or more parts to
make it more readable, in which case the first letter after each underline will also be capitalized.
The following are examples of valid variable names:
AX395
Home_Num$Start_Pointer
Inp_Line$S$
Name$Start_Date$
TelephoneTemperature
String variable names are suffixed by '$' as in most versions of BASIC, but, whereas it is normal to use the '%' or '#' symbols
to distinguish between integer and floating point variables, this is not necessary on the modem so that any variable not
suffixed by '$' will be treated as an integer.
Integers & integer arrays
Argus BASIC will handle integer numbers and variables in the range -32768 to 32767 ($0000 - $FFFF). Arrays (tables) can
only have one dimension and the number of elements is limited to 32767. Space for arrays is allocated using the standard
form of the DIM command. For example:
DIM A(100)
reserves space for 100 integers in array A. Only 1 dimensional arrays are allowed. Multiple arrays can be defined in a single
DIM command:
DIM Table1(300), Table2(500)
To assign the contents of the tenth element in the array Table1 above, to the integer variable R, you would use the notation:
Strings are sequences of up to 32767 characters enclosed in double quotes.
String variables are assigned values using the equal '=' sign:
Postcode$="GL53 7PJ"
Title$="Introduction to Basic"
Arrays of strings can also be defined:
DIM Options$(8)
DIM Lines1$(200), Line2$(50)
Strings can be added using the '+' sign, or by just writing the one after the other; thus A$B$ is the same as A$+B$.
When A$="ABC" and B$="DEF" and these two strings are added, the result will be "ABCDEF" as one string.
The minus sign can also be used with strings, but its operation is very different. It will search for the numerical location
where a given string is found within another string. Thus:
x="HELLO" - "LL"
will result in x=3.
If the result is 0, the string was not found. E.g.:
IF A$ - "Post" GOSUB Zip
will execute the procedure Zip only if "Post" is found in A$.
Normally when you input a string a carriage return will terminate the input. To insert a carriage return between B$ and C$
use A$=B$'C$; or to add a carriage return use A$=A$'.
Labels
In addition to line numbers, Argus BASIC allows the use of 'labels' to uniquely identify particular program lines; e.g. the first
line of a subroutine.
Label names must be preceded by a '%' symbol and must appear at the start of a line immediately following the line number.
In all other respects labels obey the same rules as variable names and, as with variables it is advisable to choose meaningful
names that indicate the function of the label.
300%Count_pulses
550%Check_password
Labels can be used interchangeably with line numbers in commands such as GOSUB and GOTO:
GOTO Try_again
GOSUB Mail
IF A=1 GOTO Yes ELSE GOTO No
The commands LIST and DELETE can also be used with labels:
LIST phone
LIST p1,p2
DELETE part3,part16
To retain compatibility with earlier versions of Argus BASIC, it is permissible to precede the label with '%'. Thus:
If you want to use a label with the same name as an existing command, you must always place a % sign in front of the label,
e.g.:
GOTO %Connect
GOSUB %Delete
Calculations & expressions
Like any version of BASIC, Argus BASIC can be used for calculations; but as a result of the fact that only integer numbers
are allowed, all mathematical operations give integer results.
The following mathematical operators are available:
+ : addition
- : subtraction
* : multiplication
/: integer division
DIV: same as /
MOD: remainder from integer division
ABS: absolute value
SGN : sign
The following are examples of expressions using integer variables:
X=10 * Y
Scs =(HOUR * 60 * 60) + (MIN * 60)
Res=X/3+Y
Hexadecimal numbers
Numbers can be entered and displayed in decimal or hexadecimal format. Hex numbers must be preceded by the
ampersand (&) character:
Hex=&3AC0
Address=PTOP+&1000
Print &A84B
Converting hexadecimal numbers into decimal format is achieved by preceding the hex value by the tilde (~) character. For
instance, to print the decimal equivalent of a hex value or variable:
PRINT ~1200displays 4608
PRINT ~PTOPdisplays the value of PTOP in
decimal
PRINT ~1000+50displays 4146 (i.e. 4096 + 50)
By adding the command VAL$, the decimal value can be stored in a text string:
Argus BASIC also supports a full range of logical operators which are used to make comparisons between expressions,
usually within conditional commands such as IF...THEN...ELSE, REPEAT...UNTIL etc.
The logical operators are:
AND
EOR
FALSE
NOT
OR
TRUE
=
>
<
<=
>=
<>
: bitwise AND
: bitwise Exclusive OR
: logical 0
: bitwise negation
: bitwise OR
: logical 1
: equal to
: greater than
: less than
: less than or equal to
: greater than or equal to
: not equal to
Logical operations by the modem are carried out in a 'bitwise' fashion. For example, the command:
X=6AND8
would set X to 0 as follows:
00000110 AND 00001000 = 00000000
Similarly:
X=6OR8
would set X to 12:
00000110 OR 00001000 = 00001110
Strings can be compared using logical operators:
IF A$="Z" THEN ...
IF A$>B$ THEN ...
X=A$<=B$
Events
Argus BASIC recognizes many events, partly on the hardware side, that makes programming a lot easier. You can cause
any part of your program to be triggered into action when these events occur
While the modem is in BASIC mode, the events enabled will always be operative, even if the program is not running. The
events are:
So, if you would like your modem to welcome you with a start-up message whenever you start your terminal program, you
might include in your program:
10 ON DTR GOSUB Welcome
1100%Welcome
1110 Print "Hello there, this is your modem."
1120 RETURN
1.2 Writing programs
There are two distinct methods of programming the modem.
The first, which you have used so far, is referred to as direct programming; i.e. programs are typed straight into the modem
from your computer, using the terminal mode of your communications software. This method is suitable for entering small
programs and for testing individual functions; but due to the lack of editing facilities provided by the modem, it is impractical
for large programs.
Large programs are best created using a word processor on your computer and then 'downloading' them into the modem
when they are ready for testing. This is referred to as indirect programming.
Direct programming
Assuming that the modem is now in command mode with the >1 prompt displayed on screen, you can enter BASIC
commands or program lines. The modem is now functioning as a computer and is simply using your PC's keyboard and
screen for input and output respectively.
Before starting to enter any new program you should use the following commands to ensure that no other programs are
loaded and that the new program is stored in the correct place:
For reasons of speed, direct programming is best carried out at 19200 baud or 38400 baud. If your terminal does not
support 38400 baud, use the next highest speed that is available. If your terminal is currently running at a slower speed, you
may reconfigure the modem as follows:
• Enter the command WAIT FOR AT, or press the STOP button on the front panel. This will put the modem into
'AT' scan mode.
• Change the baud rate in your terminal software to the required speed.
• Go back on-line. If you pressed the STOP button, type:
AT*B [Return]
if you entered the command WAIT FOR AT, type:
AT
• The baud rate serial and data format for port 1 will now be set to match that of your terminal, and the command
mode prompt will be shown.
There is only one editing tool available if you are editing on-line. CTRL-R will display the last line entered. The cursor will
be at the end of the line and you can delete the characters backwards and/or add new characters.
Despite the limited editing facilities that are available when entering programs directly, it is still an ideal way to explore the
modem and learn about the various functions that are provided. Most commands or commands when entered without line
numbers will be executed immediately, and you will see the results.
Indirect programming
It is simpler and more efficient to use the word processing or text editing facilities on your computer to write larger programs.
In this case you will first create an ASCII text file of the program and save it on disk. This file may then be transferred
(downloaded) into the modem, using the ASCII file transfer option in your communications software. The sequence of events
for creating and loading a program in this way is as follows:
• Use a word processor or text editor to create the ASCII version of the program.
• Save the program in a file on disk.
• Load your communications software and get the command mode prompt from the modem.
• Use the ASCII file transfer option in your communications software (NOT X/Y-MODEM or any other error correcting
protocol), to send the program file to the modem.
Note: If you encounter problems with 'echo' during the transfer procedure, you should reset the modem before disabling
echo (using the ECHO OFF command), and try again.
When programming indirectly, the first few lines of your program file must contain certain commands which prepare the
modem to receive the remainder of the program. Specifically the following must be included:
• CLEAR or BUFFER OFF - to clear that part of the modem's memory which is used for variable storage.
• PBOT=&3000 - sets the address in the modem's memory at which the program will be stored. PBOT is a
system variable that stands for Program BOTtom.
• NEW - clears program memory and prepares the modem BASIC interpreter to accept a new program.
If you include line numbers in your word-processed file you must keep track of them yourself. For obvious reasons you will
not be able to use the modem's RENUM command until you have uploaded the program.
If you do not include line numbers in your program text file, you must include the AUTO command at the beginning of the file
so that line numbers will be generated for you during uploading. One disadvantage of using a word processor to create
program files without line numbers is the difficulty of implementing GOTOs or GOSUBs to line numbers. As an alternative to
line numbers in programs where a limited number of subroutine calls or GOTO commands are used, you should use labels.
Because labels are easier to remember, we recommend that you only use labels.
Prior to downloading you should ensure that you have hardware handshaking (RTS/CTS), enabled within your terminal
software to avoid losing characters during the transfer.
Note: the modem uses hardware handshake by default, but software handshaking can also be selected using the
HANDSHAKE command.
You should also ensure that ESCAPE is enabled in order that it can be used to cancel auto line-numbering when
downloading is complete. (See ESCAPE.)
Remarks in a text file can be best implemented by using the '\' sign instead of the REM command. The BASIC interpreter
discards the rest of the line behind \ when it is in auto mode. Example:
X=12 \ Start for X
1.3 Running programs
The modem has two (2) different operating modes: it can be used either as a Hayes compatible modem or as a
Programmable (or BASIC) modem. It is important that you know exactly how to change from one mode to the other.
To go from modem-mode to BASIC-mode:
• enter AT*B [Return]
To go from BASIC to modem-mode:
• enter MODEM [Return], or have MODEM as a command in a program line.
or
• In case of an Argus with 5 buttons: first set the S/A button in the in-position and push the STOP button, then set the
S/A button in the out-position again.
or
• In case of an Argus with keyboard: press > + >> + >>> at the same time. This will jump directly to modem-mode.
The effect of entering modem-mode from BASIC is to:
• disable all events but ON RESET. You must be careful here, since once ON RESET is effective, the modem
will execute the command associated with ON RESET after every reset or power shutdown.
• leave all variables and buffers as they are.
While still under development, a program will normally be executed using the RUN command. Once development is
complete, it is recommended that the program be started with the command ON RESET, or ON RESET GOTO <line number>. This will make your program start whenever you press the RESET button, or after a power failure in the same
way. No variables or buffers will be cleared when this happens. If you want the variables and buffers to be cleared, make
If the RESET button is pressed immediately after this program has been entered (but before it has been run), nothing will
happen. After the program has been run once, the modem will return to BASIC mode after you press the RESET button,
print "You are in BASIC once again", and send asterisks to your screen.
Pressing the RESET button will restart the program again from the first line. If an [Esc]ape sequence ([Ctrl-C]) is now
entered , the program will stop; but ON RESET will still be enabled. Pressing the START button prints 'You are inBASIC once again' and the program will show the asterisks again. If you now press the STOP button again, you will
return to modem mode once more.
As soon as you press the RESET button again after that you will return to BASIC once more and the program will run once
more, etc.
Running files from the filing system
If you have a filing system (RAM-, FLASH- or Hard-disk or LAN), you can load and save BASIC programs. The command
RUN "Name" will first load the program ‘Name’ in system memory on address PBOT (default &3000) and then run it.
Once ON RESET RUN "Name" has been entered, you will always start the program 'Name', when you push the
RESET button.
For standard applications, we have also included a special program named 'BOOT'. This means that if there is a program in
memory/disk with the name BOOT, it will always run when you press RESET or after a power shutdown, even if ONRESET is active or inactive. The only way to disable BOOT is with the command BOOT OFF.
1.4 Program and variable storage
The area of memory between &3000 and &7FFF is known as Program memory. BASIC programs are normally stored
starting at location &3000 and working upwards, while the variables used by a program are stored in the area just below
&7FFF.
A system variable PBOT is used to hold the current program start address, and can be changed to allow two or more
programs to be stored at the same time in Program memory.
The highest location used by a program is held in another system variable called PTOP. The size of a program can
therefore be calculated by subtracting PBOT from PTOP, and the amount of space remaining for variable storage may be
calculated by subtracting PTOP from &7FFF.
Two other commands will reduce the amount of space available for variables:
BUFFER ... if the BUFFER command has been used to define a 'user buffer', the specified amount of space
will be reserved starting from &7FFF and working downwards. This means that variables will be stored at a lower
location than usual.
BUFFER OFF may be used to release previously allocated space.
Note: the use of BUFFER will always clear all variables and is therfore recommended to be one of the first commands in
any program.
If a program runs out of memory, it is also possible to split up a big program into smaller programs. Depending on the
application, a program can be called from within another program with RUN “Name2”, without loosing all variables!
Variables are stored in alphabetical order in memory so that, for example, if an integer A is the first used variable, its value
will be stored in locations &7FFE and &7FFF.
The first letter of a variable name is therefore very important as two 26-entry tables are maintained (one for integers and the
other for strings), which contain the start address for variables starting with a specific letter. Once an entry has been created
in the table, all variables with the same first character are stored in the same memory area. As only the first defined variable
with a specific start character is directly accessible, a sequential search of memory must be made to find other variables
starting with the same letter. For this reason you should try to use as many different start characters as possible when speed
of operation is important.
This method of storage results in the creation of up to 52 separate storage areas. If no variables starting with the letter 'T'
are used then no space will be reserved for them. The CLEAR command which is used to destroy all program variables
simply clears the look-up table and sets the variable pointer to &7FFF.
Assuming that no buffer memory is allocated, the memory map will be as follows:
Address Letter/variable type
&7FFF
integer variables starting with Z
integer variables starting with A
string variables starting with Z
string variables starting with A
PTOP
PBOT
end of program
start of program
The way in which variables are allocated can be demonstrated by entering the following program:
PBOT=&3000
NEW
DIM A(6000)
After execution of this program, a single variable with 12K allocated has been created in memory. When variable B is
defined with the command:
B=0
you might notice that it takes a little while before the prompt returns. This is because the entire area of memory allocated for
the integer array A must be shifted in order to create space for the integer variable B. Once this has been done, further
access of B will take no noticeable time, a fact that you may prove by now entering the command:
B=1
1.5 I/O ports
Each I/O port on the modem is identified by a unique port number:
Port Device
1 Serial port 1 (25 pin D type)
2 Serial port 2 (9 pin D type)
3 Telephone line (modem chip)
4 reserved
5 reserved
6 Keyboard input & LCD display output
7 Parallel Printer port
8 Memory buffer
Port 1 is serial communications port 1 with asynchronous speeds up to 115200 baud. Synchronous operation is also
possible.
Port 2 is serial communications port 2 with asynchronous speeds up to 38400 baud.
Port 3 is the telephone line and is only used if a modem connection is active.
All data streams associated with these ports (receive and send for each), are managed by the modem's operating system,
using interrupt driven buffers. All BASIC commands related to the receipt of data (INPUT, GET, etc.) automatically use
the input buffers. Commands which serve to transmit characters, such as PRINT and PUT, use the output buffers. Buffer
management is therefore transparent to the user, whose only concern should be the type of handshaking used (see below).
I/O buffers are 256 bytes in length and are filled and emptied automatically as data is transferred. However, overflow of input
buffers will occur at any speed if data is removed from the input buffers more slowly than new data is received AND no
handshaking protocol is in use. Loss of data due to overflow can be avoided by enabling either software (XON/XOFF), or
hardware (RTS/CTS) handshaking as appropriate.
Under normal conditions, a program attempting to place data into a full output buffer will be suspended until space becomes
available. However when a LINK has been established between two ports handshaking must again be used to prevent
overflow. Full descriptions of the HANDSHAKE and LINK commands are given under the appropriate headings in the
BASIC reference section.
Port 6 is used for the keyboard as an input and the LCD display as an output (if available). At the back of this manual there
are tables for both keyboard and LCD codes..
Port 7 is the parallel printer port. The connector is situated inside the case but a slot in the rear panel is provided for a
parallel cable. The parallel port can be defined as an input only or output only.
Port 8 is unusual in that it is not a hardware port, but refers to an area of memory that may be used as a data buffer by
BASIC programs. The buffer must be created explicitly using the BUFFER command before it can be used, but thereafter it
may be treated in the same way as any other port, using commands such as PUT, GET, PRINT and INPUT. It can
be used for input and output in the way a FIFO stack works.
Port syntax
Port numbers in BASIC commands must always be preceded by the hash or pound (#) character. For example, to print a
message to port 2 you could use the following:
PRINT#2, "Message from port 2"
In all cases the word "PORT" can also be used e.g.:
PRINT PORT1, "Message from port 1"
Similarly, to read a string from port 2:
INPUT#2, A$
Your program may be easier to understand if you give names to the ports that you use by assigning them to variables:
P=3
PRINT#P, "text"
INPUT#P, A$
For those commands used to set port attributes such as the baud rate, and those used to output data, you may specify more
than one port. The following command will print the message "Commencing file transfer..." to both ports 1 and
2 simultaneously:
PRINT#1,#2, "Commencing file transfer..."
Commas between the port numbers are optional (PRINT#1#2).
Listed below are those commands which may include one or more port numbers as parameters:
For obvious reasons commands used to input data may only specify a single port.
When repeated access is required to one or more ports you may define default values for input and output using the IPORT
and OPORT system variables which are described fully under the relevant BASIC reference headings.
1.6 The Argus filing system
The primary aim of any communications system is the successful transfer of information. However temporary storage of
information is very often required to synchronize communications between two different systems. Very different from any
other modem, this modem can store data to be sent, or data that has been received temporarily, to allow transfer to a remote
or to the local system later. The data may consist of computer programs, text files or other forms of data. Various standards
have been adopted over the years to suit different applications, including MNP or V42 error correction and Xmodem or
Ymodem file transfer. The mechanism to support some of the common standards have been built into the modem, and
have, as far as possible, been made transparent to the programmer. As a result, the task of receiving, storing and sending
files and messages is handled almost entirely by the modem.
In order to manage the various types of information that may exist, the modem can have its own filing system. There are 4
types:
1. RAM-disk (up to 1 Mb)
2. FLASH-disk (up to 2 Mb)
3. Hard-disk (up to 3.6 Gb)
4. Argus LAN (network server + station’s)
The RAM/FLASH-disk is 'bank-switched' into the memory map from &A000 to &C000. Bank-switching is fully automatic and
requires no special action by the programmer.
In the case of an Argus Programmable Modem, there are two 32-pin sockets provided inside the modem, each of which will
accept a 128Kb, 256Kb or 512Kb RAM module. The second socket will accept a 128Kb or 512Kb FLASH module, only if the
first socket contains a 128Kb RAM module.
In the case of a T.C.Lite (with keyboard and LCD display) there is only one socket which will accept a 128Kb, 512Kb or 2Mb
FLASH module.
The Hard-disk and LAN are only available for the Argus Programmable Modem. The network server is an Argus with Harddisk and a station is an Argus with build-in network facilities.
The filing system is not a standard feature of the modem, but an option that you can order with your modem, or add later, as
and when required.
The filing system of the modem recognizes three distinct types of files:
• Text messages
• Binary files (voice also)
• Argus BASIC programs
File storage is handled entirely by the modem's operating system.
Files are stored sequentially in RAM/FLASH-disk, the oldest first.
On a Hard-disk, the files are stored in ‘directories’ which are created and removed automatically by the operating system; the
first character of a filename is the directory entry. Only the characters 0-9, @, and A-Z are possible as the first character in a
filename!
The following commands can be used to manipulate files:
CLEARPLAY/RECORD
COPYRECEIVE
DELETERENAME
DIRRESTORE
FAXRUN
LOADSAVE
MATCHSEND
The syntax for manipulating files in general is:
COMMAND ![filename]
or
COMMAND FILE [filename]
However in most cases the exclamation mark (!) or the word "FILE" can be left out. Only with MATCH, CLEAR and
RESTORE they must be used.
Filenames may be up to 16 characters long and may only contain ASCII characters from 33 to 127 (so they cannot include
spaces). Two other characters with special meanings that can be used in filenames are:
* : the asterisk (star), which is used as a multiple character 'wildcard'.
? : the question mark, which is used as a single character ‘wildcard’.
. : the full point (dot), which is used to split filenames into a maximum of three sections called extensions. This
allows groups of related files to be given the same extension.
In order for files of a similar type to be grouped together within a directory listing, it is logical to use filename extensions. For
example, all BASIC program files could be given the extension '.BAS'; text files could be '.TXT'; etc. To display a list of
BASIC programs you would then use:
DIR "*.BAS"
Text files
Straightforward text files are stored in the disk 'as is', i.e. one byte is used for each ASCII character. However, when it
comes to transferring text files the modem supports a number of the conventions used by telex-based systems. For
instance, the command:
RECEIVE#1, "TEST", T
prepares the modem to receive a text file via serial port 1 (the T is short for Text or Teletype). First, the modem transmits the
message:
Please enter your message:
to port 1. It then reads any characters received from port 1 and places them in the disk in a file called "TEST". The file is
only closed when either:
or:
a) a single line containing the characters "NNNN" is encountered in the input stream
The second method can be disabled if necessary by using the ESCAPE OFF command.
When a transfer is complete, the DIR command may be used to verify that a new file has been created. DIR will also show
the type of the file, how many 256-byte blocks it occupies and how many free blocks (or clusters on hard disk) remain.
A text file can be 'read' by sending it to the port to which you are connected. Thus to display the file "TEST" from the
previous example you would use:
SEND "TEST",T
Text files can be removed from the disk using the DELETE command, but they must be read at least once before this can
be done.
Binary files
Binary files may contain any type of data and are transferred using the Xmodem or Ymodem file transfer protocol. For
example, to download a binary file into the modem using Xmodem, you could use the command:
RECEIVE "DATA1",X
Once this has been entered the modem will initiate an Xmodem receive sequence. The required file can now be downloaded
by selecting the Xmodem file transmit option in your terminal software. When the transfer is complete the file will be stored in
the disk using the name given in the RECEIVE command.
To re-transmit the file use:
SEND "NAME",X
This will only work if the receiving system supports Xmodem file transfer. Multiple files can be merged by using the wildcard
character in the filename specification:
SEND "*.DATA",X
However in most cases it is better to use the Ymodem file transfer, because file length is preserved (see PROTOCOL
command).
BASIC programs
BASIC programs can be stored to and retrieved from disk using the SAVE and LOAD commands. Disk programs are
accessed by their filename:
SAVE"TESTPROG1.PRG"
or
LOAD "TESTPROG2.PRG"
The file type as shown in a directory listing will be 'B' for BASIC program.
Programs may also be loaded into Program memory and executed with a single RUN command:
RUN "HOSTSYS.PRG"
1.7 Program backup
The importance of making regular backup copies of both programs and data from your computer cannot be stressed too
often, and the same golden rule applies when writing programs for the modem.
If you use a word processor to create and edit programs, your normal computer backup procedures can be applied. Backups
should be made every time you modify a program.
A different procedure will be required to maintain backups of programs entered directly into the modem. Although the
modem memory is battery-backed and does not lose its contents when power is shut off, it is possible that low usage over a
period of time will cause the battery to run down and memory to be corrupted. For this reason you should make copies of
programs from the modem into your computer or to diskette, to use as permanent backups.
Backing up Program memory
Currently active programs, i.e. those in Program memory, are stored in a compact, encoded (tokenized) form, and cannot
therefore be read without the aid of the LIST command. When you use LIST, the stored program is decoded and
displayed as ASCII text in the form in which it was originally entered. You may take advantage of this fact to obtain backups
in ASCII format of programs that have been entered directly, by using the following procedure:
• Load your terminal software and put the modem into Command mode.
• Use your terminal software to open a file for the reception of ASCII text.
• Go back on-line to the modem and use the LIST command to list the program.
• When listing is complete, close the file and save it on disk.
This file can now be stored permanently as a backup, or it can be edited and downloaded back into the modem when editing
is complete. To avoid loss of data while using LIST in this way, make sure that either software or hardware handshaking is
selected as appropriate.
Backing up the RAM-, FLASH- or Hard-disk
Even when you have a filing system installed, the need to make a back-up of all your programs and data, is still there.
Normally you will save programs, text and binary files in the disk. It is extremely difficult to erase the disk by accident, and
the battery backup (in case of RAM-disk) is quite reliable because of the watchdog facility. Nevertheless, we think that it is a
wise precaution to backup valuable data now and then onto floppy or the hard disk of your computer.
The easiest way to create a backup is to connect to the modem locally or from a remote terminal and go into BASIC. Then
tell the modem:
SEND ALLorSEND "*.*.*.*",C
and use your communications program to download the complete contents of the disk with Xmodem-CRC file transfer.
To restore the complete contents of the disk from your PC, tell your modem to:
RECEIVE ALLorRECEIVE "C",C
and use your communications program to return the same data you have received earlier (also with Xmodem-CRC file
transfer).
Of course you can also back up separate files from the disk by using the ,C option. In this way you get a backup-part:
SEND "*.PRG",C
SEND "MESS*.SYS",C
Seperate received backup-parts can be added together in the PC as one big file, which can be used later to restore a disk.
The ,C option tells the modem that it is a file Copy, meaning that all information such as name, length and date, is included in
the transfer.
Argus BASIC is a custom communications' variant of the popular BASIC language found on many micro-computers. It is a
relatively fast implementation which owes much of its speed to the use of a 68HC11 microprocessor running at 3.68 MHz,
and integer-only operation. However, multiple high-speed communication streams can still present problems, and some care
may be required when developing more adventurous applications in order to avoid potential timing problems; especially if you
are using error correction and/or data compression at the same time, at high baud rates such as 9600 baud. Remember also
that the execution speed of a program can depend greatly upon how it is written. In this respect you should take note of the
following if speed is critical in your application:
• Avoid using port numbers in commands - use default values by assigning IPORT and OPORT appropriately
where this is possible.
• Minimize the use of brackets in expressions and function calls - CHR$7 is the same as CHR$(7).
•
Use short variable names.
• Distribute the first characters of variable names across the whole alphabet.
• Combine multiple commands into single program lines.
• Omit variable names with the NEXT clause of FOR ... NEXT loops.
• Minimize the use of string variables.
• Split long calculations into separate, short sections.
• Avoid using the READ and DATA commands - they are relatively slow.
• Using line numbers for GOTOs is faster than using labels.
• If you do use labels keep them short (e.g. %OL, %2).
You should realize that the application of these guidelines may result in poorly structured programs that are difficult to read.
Some compromise may be required, particularly during the development stage.
Syntax
Each of the command descriptions in this section is followed by a series of examples, a syntax description, and a list of
associated commands to be used as a cross-reference.
The following notation is used in the syntax descriptions:
[-] items in square brackets indicate one of the program 'elements' listed below.
[num-var] : numeric variable
[num] : a numeric variable or constant
[string-var] : string variable; e.g. Name$
[string] : string variable or constant
[integer] : an integer value from -32767 to 32768
[integer n1 ... n2] : an integer value in the range n1 to n2
This command will simulate any modem connection, after the two modems are connected. It can therefore best be used
after the ON CONNECT event. When entering the command, it will set the link between the terminal port and the line port
(3). The terminal port must first be set with the system variables IPORT and OPORT. A multiplexed or half duplex
connection is also simulated if selected. Exiting the command must be done by ON-events, which are set before the
ACTIVE command was given. The following events are possible during ACTIVE.
The modem is capable of performing an analogue measurement of the signal voltage level on the line. A value between 0
and 255 is returned.
If the modem is 'on-hook' the measurement is always zero.
If you take the modem off-hook and your exchange applies a dial tone, or if a carrier is received, you will be able to see the
signal voltage on the line.
To test this, enter:
10 DIAL "123456" : REM dial non-existent number
20 REPEAT : PRINT ADC :WAIT 10 :UNTIL FALSE
RUN
For specialist applications ADC, together with FREQ can be extremely useful, to evaluate what is going over the line. Most
users however will have no need for these commands.
AND performs a bitwise logical 'AND' operation on two numeric values; i.e. each bit of the first operand is ANDed with the
equivalent bit in the second operand. The result of 12 AND 5 is therefore calculated as follows:
operand 1 12=00000000 00001100
operand 2 5=00000000 00000101
result 4=00000000 00000100
The most common use of AND is to check whether or not two or more test conditions are true:
IF (X = 2) AND (Y=10) THEN ....
The first stage in evaluating this IF command is to check if X=2. If it is, then the first operand for AND will be TRUE (1). If
Y=10 is also true then the second operand will also be TRUE (1), and the resulting test will be:
operand 1 1=00000000 00000001
operand 2 1=00000000 00000001
result 1=00000000 00000001
Because both operands are TRUE the result is also TRUE and the IF condition is satisfied.
ANSWER is used to make the modem answer a call and is identical to the modem command A (ATA). The modem will take
the line and produce an answer tone, and a carrier or a baud rate scan, as set with the various relevant S-registers.
A typical application is when you do not want to make the modem auto-answer, but first want to observe certain conditions
e.g.:
50 ON RING %test
.
200 %TEST
210 IF DTR#2 ANSWER
220 RETURN
On exit the system variable RESULT can be read to determine the status of the modem (CONNECT, NO CARRIER).
When DCD#3 is set, a successful modem connection is made. This can also be detected by the ON CONNECT event.
ANSWER can also be used to set the number of rings that is required before the modem will answer an incoming call. E.g.:
ANSWER 3
A third syntax is ANSWER ON|OFF. ANSWER ON on is identical to the modem command ATS0=1 and ANSWER
OFF to ATS0=0.
AT is used to initiate 'AT' scanning on one or both of the two serial ports. This is the means by which Hayes compatible
modems determine the speed and data format being used by the terminal to which they are attached. When operating in this
mode, the modem will scan the specified ports for incoming data. The bit pattern produced by the two characters 'A' and 'T'
is unique and can be recognized at baud rates from 75 through to 38400 in a variety of data formats. The advantage of this
is that the modem need not be pre-configured for baud rate and data format before connection -- it can determine the
appropriate settings when the user first enters 'AT'.
Note that the number of stop bits cannot be recognized, so that if your terminal is set to 7, Even, 2, the modem will detect the
'AT' and configure the serial port for 7, Even, 1 operation. Most computers and terminals will not be affected by the missing
stop bit, but if you do encounter problems you should set the number of stop bits explicitly, using the SBITS command.
The modem will successfully 'AT'-detect at the following speeds and data formats:
75
4800
150
9600
7 bits, even parity
7 bits, odd parity
8 bits, even parity
300
14400
600
19200
1200
38400
2400
57600
8 bits, odd parity
8 bits, no parity
If no port number is specified, the default input port as defined by IPORT will be assumed.
This will enable or disable the state of a port, where it is waiting for an AT to be entered. When AT is entered, the port is reconfigured. To respond to the AT entered, you will have to enable and use the ON AT event. When 'SLASH' is added as
an option and the ON SLASH event is enabled, this event can also be generated when a / is received, but then the port is
not reconfigured.
AT INPUT (#[port])
Will input a line and send it to the modem command line interpreter. The result of the execution of the command line is
returned in the system variable RESULT. If you want a written output, you can use the command REPORT instead.
AT REPEAT
Will repeat the last command line sent to the modem.
AT [string]
Will send the string to the command line interpreter of the modem. The string itself should not start with AT. So you will
have to enter:
AT "DT123"
to make the modem dtmf-dial the number 123 from BASIC. Reading the system variable RESULT will return the result of the
action taken.
Notes
When the modem is 'AT' scanning, the complete reception of characters inclusive of ESCAPE is disabled for the selected
port; i.e. if port 1 is being scanned, an ESCAPE on port 2 will still be recognized, and vice versa. These will be reset to their
previous values when the 'AT' scan is complete.
All active background processes including any LINKs, ON TIMEOUT or ON BUTTON functions, remain active during
'AT' scanning.
After a scan, the baud rate, parity and character length can be read by your program using BAUD, LENGTH, etc.
AUTO is used during direct programming to enable automatic generation of the next line number each time [Return] is
pressed.
The command has two optional parameters which specify the start line number and the increment.
When used without parameters, the start line number and increment are both 10, and the sequence of line numbers
generated will be 10, 20, 30, etc.
If a single parameter is used, such as:
AUTO 50
this is taken as the start line number which is incremented by 10, giving the sequence 50, 60, 70, etc.
When two parameters are given, the first is used as the start line and the second as the line increment. The following
example will generate numbers 100, 105, 110, etc.
AUTO 100,5
The first parameter can be omitted by including a comma before the second:
AUTO ,5
In this case the line numbers generated will be 10, 15, 20, etc.
If you use AUTO while there is already a program in memory, duplicate lines will be overwritten.
To cancel auto line numbering you must enter the appropriate ESCAPE character (which is [Ctrl-C] by default), so you
should make sure that ESCAPE is enabled.
If you forget to enable ESCAPE, the STOP button will also cancel auto line numbering.
'\' added behind AUTO line can be used for remarks. These remarks will not be stored as part of the program.
BAUD is used to set or read the communications speed of the specified serial port. If no port number is specified, the default
output port as defined by OPORT will be assumed. The second parameter is a code which represents the required baud
rate according to the following table:
One or more port numbers may be specified in a single BAUD command, as in the following example, which sets ports 1, 2
and 3 to 2400 baud:
BAUD#1#2#3=5
The baud rate of Port 1 (the main port) can be set at either a positive or negative number. Setting the baud rate to a
negative number will configure the port for synchronous operation. Using a positive number, will configure the port for
asynchronous operation
When you set the S-register 51 of the modem to 0, the baud rate of the modem port (port #3) will also influence the modem
operation. The modem will only connect to carriers that match the baud rate. However, any AT-command sent to the
modem will override this baud rate setting.
It is not very practical to set the baud rate on a port if you intend to effect an AT scan on that port directly afterwards because the AT scan will reconfigure the port. In this case, either you set the port for a certain baud rate using BAUD; or
you carry out an AT scan on the port and read the baud rate that results with BAUD. For example:
Print BAUD#2
Pressing the RESET button does not affect the baud rate, but does re-initialize serial communication and flush the
send/receive buffers.
After every reset, the modem looks for a file 'BOOT' in the RAM/ROM/FLASH- or Hard-disk.
In case of a RAM-disk in an Argus Programmable Modem, it first looks in socket 1, with the first filing system and if it cannot
find it, it will look in socket 2, if there is a ROM/RAM in socket 2.
If the BOOT file is found, it is loaded in BASIC at PBOT=&3000 and then executed. It overwrites the ON RESET rules.
If the BOOT file is not found, the normal ON RESET rules will apply. With BOOT ON, this feature is enabled.
With BOOT OFF, the search for the BOOT file is not done after a reset, and the normal ON RESET rules will apply.
BRK is used to make the modem transmit a break on the specified port. When no port is specified OPORT is used. The
duration of the break can be controlled with S-register 43, but the default value of 0.50 seconds is usually sufficient. See ONBRK also.
As a result of the fact that the various components of a communications system operate at different speeds, it is often
necessary to store data temporarily in an area of memory called a buffer. The advantage of this is that one device can take
data out of the buffer while another puts new data in. If the buffer is sufficiently large, the faster of the two devices will not
have to wait for the other. For instance with a computer, when you read a character from a file on disk, a whole block of data
from the file - perhaps 512 bytes - is read into an area of memory called a file buffer. When you read the next character the
processor does not have to wait for the disk drive again, because the data is already in the file buffer.
The BUFFER command on the modem is used to create a buffer of the specified size in RAM. This buffer is treated as if it
were a serial port and is addressed as port number 8. The amount of memory that can be allocated for the buffer is limited
by the available memory, but the last location, or top of the buffer, is always &7FFF. Note that this is also where program
variables are stored, so that if you intend to use the BUFFER command you must do so before you declare any variables.
When the BUFFER command is used, an automatic check will make sure that a program is not overwritten. If there is
insufficient room for a buffer of the specified size, an error message will be given.
The command:
BUFFER &400
will reserve 1K of RAM for the buffer. The maximum buffer size is 20K.
The PUT and PRINT commands are used to store data into the buffer:
PRINT#8,"text"
PUT#8,Ch
To retrieve data from the buffer use the GET, KEY or INPUT commands.
In the following example the next byte of data is read from the buffer and placed in the variable X:
X=GET#8
It is acceptable to use PUT#8, INPUT#8, GET#8, etc., to manipulate the buffer contents; but when frequent buffer
access is required, it is more efficient to use IPORT and OPORT to select port 8 as the default port. The port number can
then be omitted from the I/O commands.
The buffer can also be used in conjunction with the LINK command as if it were a normal port. For example:
LINK#1,#8
LINK#8,#2
Here, the input from port 1 will be placed in the buffer before being extracted and passed to port 2. This is particularly useful
if you are speed-buffering between ports. When using the buffer in this way it is not possible to implement handshaking
between the ports, so that if port 1 is very much faster than port 2 the buffer may overflow, and characters will be lost.
The CLEAR#8 or CLEAR BUFFER command is used to empty the buffer by resetting the input and output buffer pointers
to the buffer start address. With a 1K buffer this will be &8000 - &400 = &7C00. Any data still in the buffer when
the CLEAR command is used will be lost. However with the command RESTORE BUFFER all the data can be read
again.
The BUFFER OFF command releases the space allocated for the buffer for other use. The command CLEAR is then
executed automatically, so be careful here.
The buffer contents are not affected by the STOP or RESET buttons.
If no buffer space has been allocated, an attempt to access port 8 will not generate an error message, but will cause the
program to 'hang'.
For more complex operations on the buffer, the programmer can use PEEK and POKE on the following buffer-related
addresses:
256*PEEK&4A4+PEEK&4A5= buffer start address
256*PEEK&4A6+PEEK&4A7= buffer end address
256*PEEK&4A8+PEEK&4A9= buffer start pointer
256*PEEK&4AA+PEEK&4AB= buffer ebd pointer
PEEK&43 AND &80= buffer full flag
PEEK&44 AND &80= buffer empty flag
Important:
When a modem connection is made and MNP5 is active, a buffer of 3K (&C00) must be defined. This space is used by
MNP5 and must not be overwritten during the connection.
When using file transfer with the 1-K block option (Ymodem, Xmodem-1K) together with MNP5, then a buffer of at least 4K
(&1000) must be defined.
BUTTON is used to read the position of the sync/async button from within your program. When the button is in the 'in'
position, the function will return '1'; and when the button is in the 'out' position, the function will return '0'.
The CALL command is used to execute a machine language subroutine. Such routines are normally only used where high
speed operations are required for which BASIC would be too slow. (Which is not very often, because Argus BASIC is fast!)
Each CALL command must be followed by the start address of the routine:
CALL &4000
In addition to the call address, parameters can be passed to the routine in the 16-bit accumulator and in the 16-bit X and Y
registers.
CALL &4000, A, X, Y
where the variables A, X and Y have been set to the appropriate values before calling.
CALL &4000,1294,7,128
Here, the accumulator is set to 1294, the X register to 7 and the Y register to 128.
The last instruction of the machine code routine must be RTS in order that control is passed back to the BASIC program. On
return, the contents of the accumulator and the X and Y registers are stored in locations &2E00, &2E02 and &2E04 and can
be accessed using the PEEK function.
When more than three bytes of data must be passed to a machine code routine, the POKE command should be used to
place the data in memory at a convenient location. The safest method is to reserve an area of memory with the DIM
command, e.g.:
DIM Block 200
As the modem does not include a built-in assembler, development of machine code routines must be carried out on another
computer. The assembled code may then be uploaded into the modem using the appropriate form of the RECEIVE
command.
The CHR$ function converts an integer in the range 0-255 to its equivalent ASCII character. It is commonly used to include
control characters (ASCII values from 0-31) in PRINT commands. For example, to sound a warning at the terminal when
an error occurs, the Bell character ASCII 07 (entered at the keyboard as [Ctrl-G]), could be incorporated into the error
message as follows:
When used on its own, it will clear all BASIC program variables.
2. CLEAR ALL
Will clear the input and output buffers of all ports.
3. CLEAR (#[port])
When followed by one or more port numbers, it will clear the input and output buffers for those ports.
4. CLEAR INPUT (#[port])
CLEAR followed by INPUT empties the input buffer for the specified port. If no port is specified, the default input port as
defined by IPORT will be assumed.
5. CLEAR OUTPUT (#[port])
CLEAR followed by OUTPUT empties the output buffer for the specified port. If no port is specified, the default output port
as defined by OPORT will be assumed.
6. CLEAR BUFFER
This will empty the buffer you have defined, but not disable the buffer. This function will do the same as CLEAR#8 but
takes less program space.
7. CLEAR PRINTER
This will clear the printer port. CLEAR#7 will also clear the printer port.
8. CLEAR! or CLEAR FILE
This deletes all files from the RAM/FLASH-disk and should therefore be used with care! If you accidentally type in this
command, you should use RESTORE! immediately to recover the RAM-disk contents. Recovering the FLASH-disk is not
possible.
9. CLEAR ROM
Is used when a RAM-disk is in socket 2 to clear the chip.
CLOCK$ is used to read the time and date from the internal real-time clock. Output is given in the format:
DAYdd-mm-yy
HH:MM:SS
DAY is day of the week (e.g. SUN); dd is the day of the month, mm is the month, yy is the year, HH is the hour, MM is the minute and SS is the second.
CLOCK$ can be used to set the date and time, but this can usually be done more easily using the individual DAY, DDAY,
MONTH, YEAR, HOUR, MIN and SEC commands.
CLOCK$ can be copied into another string to store the time and date of a certain event permanently.
CONNECT is identical to the modem command O (ATO). The modem will take the line, wait for an incoming carrier and try
to connect to it. The connection will only be established, when the configuration of the relevant S-registers matches the
remote carrier.
The ON CONNECT event can be used to detect a successful connection. This can also be determined by reading DCD#3
on exit of the CONNECT command.
The system variable RESULT can be read on exit to determine the status of the modem (NO CARRIER, CONNECT).
This command is used to copy one file on the disk to another file. The new file is identical to the original one. Using
wildcards (* or ?) is not possible.
CTS is one of the hardware handshaking signals defined in the RS232 standard, and each serial port on the modem is
capable of controlling a CTS signal as an output.
CTS is a signal provided by modems and other DCEs, to inform the terminal (DTE) that it is ready to accept data for
transmission. It is used in conjunction with another signal, RTS (Ready To Send) as part of the RS232 handshaking
sequence.
When the CTS signal is taken low by the modem, a terminal or computer must respond by stopping further transmission of
data until CTS goes high again. If the terminal does not respond, transmitted characters may be lost.
After the HANDSHAKE CTS command has been issued, the modem will respond correctly to RTS and control CTS
automatically.
The CTS function is used to read or set the value of the CTS signal on the currently selected output port. When the CTS line
is high, the CTS function will return the value 1; if it is low, the value 0 will be returned. If no port is specified, the output port
defined by the last used OPORT command is assumed when writing (setting); and the last used IPORT is used when
reading.
If the modem is unable to handle any more incoming characters because its input buffer is nearly full, it will request the
sending device to wait by taking its CTS output low. This feature can be switched on or off with the HANDSHAKE
command.
The modem also supports software handshaking using the XON/XOFF protocol. Refer to the commands XOFF, XON, and
HANDSHAKE for more information.
The DATA command is used to store numeric and string constants within a program. Such values may be read one or more
times using the READ command.
DATA commands may appear anywhere in the program, but must be the first and only command appearing on a line. As
many data items as will fit on a line may be included, with individual data items being separated by commas.
The following example contains 5 items (3 numbers and two strings):
70 DATA 5, 10, 50, Apple, Orange
Where a program contains more than one DATA command, they should be thought of as comprising a single continuous list
of data items; i.e. having read the last item of data on a particular line, the next READ command will take the first item of
data from the next DATA command in the program.
To include leading spaces within a string it must be enclosed in double quotes:
50 DATA "This string contains leading spaces"
As the comma is used as a separator in DATA commands, you may only include a comma as an item of data by enclosing it
within double quotes:
60 DATA <,>,?,",",/
To include a double quote mark in a DATA command you must use four sets:
80 DATA """"
90 READ x$
After line 90 has been executed x$ will have the value '"'
Examples:
DATA 1,2,3,5,7,11,13,17,19
DATA Peter,15, Clare,12, Robert,13, James,18,Alison,15
DATE$ is used to read the date from the internal clock/calendar, and format it into a text string in the form DD-MM-YY.
When I wrote this text on the 23rd of July 1990, PRINT DATE$ reported 23-07-90.
The date can also be obtained in integer format by using the individual functions DAY, DDAY, MONTH and YEAR.
DAY is used to read or set the 'day of week' on the internal clock/calendar.
When reading it returns an integer from 1 to 7, day 1 being Sunday. Similarly, when setting the day of week, the day number
from 1 to 7 must be specified. An incorrect value will cause the current setting to remain unchanged.
DCD is the RS232 signal used by modems to indicate that a connection has been established with a remote system. It is
activated by the modem when a connection occurs, and is normally used as an output from the modem. However within the
BASIC environment, it can also be used to read the connect status of modem port #3.
With port #1 or #2 the DCD command is used by the modem to control or read the status of the DCD line on the specified
port. If no port is specified, the default port defined by OPORT will be assumed. The DCD signals of port 1 and port 2 are
connected via hardware; thus DCD signals on both ports will influence each other, and it is impossible to set them separately.
With port #3 it is only possible to read the status. For example, the following command causes program execution to jump to
the label %Connect2 if the DCD input on port 2 is active:
IF DCD#3 GOTO %Connect2
However, in order to detect incoming calls correctly using the DCD function, a program must continuously check the
appropriate DCD signal in a loop, until its status changes from FALSE to TRUE. This is because a single DCD call gives
only a momentary reading of DCD status. For this reason it is more efficient to use the ON CONNECT and ON HANGUP
event handlers to achieve the same result.
It is sometimes necessary to control the use of DCD as an output from the modem - for example, where you have protected
entry to your host computer by using auto-dial back from your modem. In this case, you would tell the computer that a
connection has been established only after the user has been correctly identified and authorized to proceed. Before that you
would keep DCD low, and your computer would not know that any communication was already going on. To keep DCD low
on the ports while your modem is connected, AT&C has to be set first, and afterwards DCD has to be enabled by your
program:
DDAY is used to read or set the day within the month for the internal clock/calendar. When reading it returns an integer from
1 to 31. Similarly when setting, the day number from 1 to 31 must be specified; an incorrect value will cause the current
setting to remain unchanged.
The DELETE command, in its various forms, is used to delete lines from a program and to delete files from the disk filing
system.
Deleting program lines
DELETE may be followed by two line numbers which define the range of lines to be removed. The command:
DELETE 50,100 or DELETE 50 TO 100
will remove all program lines from 50 to 100 (inclusive).
If the first parameter is omitted all lines from the start of the program to the specified last line will be deleted:
DELETE ,50
To delete a single line, just type the line number followed by [Return].
Labels can be used to specify the range in place of line numbers:
DELETE %Dial, %Dialend
Deleting files from the RAM-, FLASH- or Hard-disk
DELETE can also be used to remove files from the disk filing system. In this case the command is followed by !,FILE
and/or a string.
To delete the program "TEST.PROG" you could alternatively use the following:
DELETE !"TEST.PROG"
DELETE "TEST.PROG"
DELETE FILE "TEST.PROG"
F$="TEST.PROG" : DELETE F$
To delete multiple files the '*' may be used as a wildcard character. Note however, that unread files will not be deleted by
this form of the command, and a report will be printed of the number of files deleted and unread. For example, if there were
7 files with the suffix " MSG ", two of which were unread, the command:
DELETE "*.MSG"
would result in the following report:
2 Unread
5 Deleted
To delete unread messages the DELETE command must be followed by ',U ':
DELETE "*.MESS",U
After deleting files, the system variable MATCH holds the number of deleted files.
This command will dial a number for you. It is the same as ATD in modem mode, and is provided mainly to make your
program easier to read.
After the command DIAL, the system variable RESULT can be read to determine the status of the modem (BUSY, NOANSWER, CONNECT, etc.). When a successful modem connection is made, DCD#3 will be set. This can also be
detected with the ON CONNECT event.
DIM (short for dimension), is used to reserve space for single dimension arrays of integers or strings. The maximum
number of elements allowed in integer arrays is theoretically 32767, but is in practice limited by the amount of memory
available for variables after the program has been loaded. The limitation of a maximum string length of 254 bytes still current
in the Argus Communicator has now been removed.
The command:
DIM A(100)
defines A as being an array of 100 integers (indexed from 0099); i.e. the first element is numbered 0. To access the fifth
element use:
A(4)
Similarly:
DIM A$(8)
reserves space for the array A$ with 8 strings of up to 255 characters. The actual amount of space used by the array will
depend upon the values assigned to the elements.
A very different use of the DIM command is to find and reserve free space in memory. If you need free space just enter:
DIM [num-var] [integer]
The number of bytes as given by the integer is reserved, and the numeric variable will point to the first location of the
memory space reserved for you.
The DIR command is used in its various forms to list and inform you about the contents of the RAM-disk.
Because of the need to retain compatibility with earlier versions of Argus BASIC, DIR might be followed by 'FILE' or '!'.
This is optional however, and thus will not normally be used.
The DIR command will list files stored in the RAM-disk. The format and level of information given in the listing depends on
the parameters used in the command. The following options are available:
DIR ([string]) standard listing
DIR ([string]),A All available information
DIR ([string]),B information Block listing
DIR ([string]),D standard listing plus file creation Date
DIR ([string]),F special File information listing
DIR ([string]),N file Names only listing
DIR ([string]),R Restricted listing
In each case the [string] parameter provides a template for filenames to be included in the listing. The asterisk, '*', can be
used as a wildcard to match any valid character.
If no [string] parameter is given, all files will be listed.
The formats of the various directory listings are as follows:
Standard
,B (Blocks)
,A (All)
,D (Date)
,F (special)
,N (Name)
,R (Restricted)
[FN] [Size] [Name+Ext]
[Information block contents]
[FN] [Name+Ext] [Date] [Time] [Read] [Type]
[FN] [Size] [Name+Ext] [Date] [Time]
[FN] [Size] [Name] [Date] [Read] [Info]
[Name]
[FN] [Size] [Name]
where the following definitions are used:
[FN]
[Size]
the file number
the number of 256-byte RAM disk blocks occupied by
the file
[Name+Ext]
[Name]
[Date]
[Time]
[Read]
[Type]
the full name of the file (including extensions)
the first part of the file name (e.g. MESSAGE1)
the creation date of the file (DD/MM)
the creation time of the file (HH/MM)
R for Read, U for Unread
the type of file
After these options there are two more, which can always be added
,U (Unread only)
,M (more function)
The 'more' function will, after sending a screenful of lines, ask you for confirmation before it will send the next screenful.
: binary file created by RECEIVE ...,X (X-MODEM or Y-MODEM)
The directory command lists files in date order, oldest first, and prints the number of free blocks remaining at the end of the
list (not with DIR,N).
The command DIR, B is used to list the contents of the information block associated with the file. This block contains 32
bytes of application-dependent information and is terminated with [CR] (see SEND and RECEIVE for further information).
Directories are listed to the specified port, or if this is omitted, to the default output port as defined by OPORT.
Examples:
DIR, U
DIR, M
DIR#2
DIR#1 "*.MSG?", N
DIR !"LETTER"+VAL$(nn), D
DIR !A$
DIR FILE "PETE."+Ext$, N
Syntax:
DIR ( #[port] , ) (FILE|!) ( [string])(,[option] )
[option]=A|B|D|F|N|R|U|M
The DIV command is used to carry out integer division operations. As the modem does not support 'real' numbers, DIV is
exactly equivalent to division using the '/' operator.
DSR is an RS232 signal used by modems to indicate that they are powered-up and ready to transfer data. DSR will be
active dependant on the setting with the modem command &S. The signal is an output to the modem.
The DSR command is used to set or read the status of the DSR line on the specified port. When used for reading it returns
TRUE if DSR is active, and FALSE otherwise.
DTMF ON turns on the DTMF receiver. Reading the first DTMF value and the command VOICE will also turn it on.
Therefore, use of the command, is optional.
DTMF OFF turns off the DTMF receiver.
In most cases, the modem has 2 DTMF receivers build in. They can be selected with S-register 23 bit6 as follows:
SREG23=SREG23 AND &BF: Select External DTMF-chip (default)
DTR is the RS232 signal used by data terminals - also (host-) computers - to indicate that they are powered up and ready to
transfer data. The modem will automatically control the response to DTR according to the instructions given with the modem
command &D.
The DTR function is used to read the status of this signal on the specified port. If no port is specified the default port defined
by IPORT will be assumed.
We would suggest that if you wish to make use of the DTR signal from within your BASIC application, you disable the
automatic response to DTR.
For enabling or disabling the automatic response (and also the ON DTR and ON DTD events), we suggest that you use
the modem commands &D0 and &D1,&D2,&D3.
The command DUTCH will, like ENGLISH, select the language for the few written messages that are part of the system.
The reason for this is that these messages will also occasionally be sent over the telephone line to remote users. This is
especially the case when the modem is used as an electronic mail computer.
The 5 possible parameters behind DUTCH will have effect on the SEND,T and FAX SEND commands.
DUTCH <1>,<2>,<3>,<4>,<5>
<1> = 0-255 = Characters per Line (0=OFF) <2> = 0-255 = Lines per Page (0=OFF) <3> = 0/1 = No/Yes Left Margin <4> = 0/1 = No/Yes Page Fillout <5> = 0/1 = No/Yes Clear Screen (ASCII 12) after 'Verder'
ECHO is used to turn local character echo on or off. While in command mode or when using the INPUT or AT commands,
characters received via the input port are echoed back so that the sender can see what has been received (or, in the case of
a terminal, what he is typing). This is known as local echo. If both the modem and the user's terminal provide echo in this
way, the user will see two of everything he types, and echo should then be disabled on either the modem or the terminal.
The command ENGLISH will, like DUTCH, select the language for the few written messages that are part of the system.
The reason for this is that these messages will also occasionally be sent over the telephone line to remote users. This is
especially the case when the modem is used as an electronic mail computer.
The 5 possible parameters behind ENGLISH will have effect on the SEND,T and FAX SEND commands.
ENGLISH <1>,<2>,<3>,<4>,<5>
<1> = 0-255 = Characters per Line (0=OFF) <2> = 0-255 = Lines per Page (0=OFF) <3> = 0/1 = No/Yes Left Margin <4> = 0/1 = No/Yes Page Fillout <5> = 0/1 = No/Yes Clear Screen (ASCII 12) after 'More'
EOR performs a bitwise logical 'Exclusive OR' operation on two numeric values; i.e. each bit of the first operand is Exclusive
ORed with the equivalent bit in the second operand. The result of 12 EOR 5 is therefore calculated as follows:
operand1 12=00000000 00001100
operand2 5=00000000 00000101
result 9=00000000 00001001
The most common use of EOR is to toggle a bit value within an item of data.
For example, to toggle the state of user port line 5 you would use:
OLINE(5) = OLINE(5) EOR 1
If the state of the line was previously high, the command is the same as:
1 EOR 1
which gives 0 - i.e OLINE(5) goes low.
If OLINE(5) was already low, the command is the same as:
ERL is a system variable that contains the number of the line that is currently being executed. As a result of this, when an
error occurs, ERL contains the line number in which the error occurred. Therefore you should be careful. ERL should be
stored or printed in the first line of the error handler routine.
ERN is a system variable that contains the number of the last error that occurred. A complete list of error messages and the
associated codes generated by the Argus BASIC interpreter is given in the Error Messages section of this manual.
ERN is also an important variable for the filing system.
The ESCAPE command is used to define the ASCII character that the modem treats as an 'Escape' code (this is only
sometimes related to the [Esc] key on your keyboard).
An Escape is used to interrupt the execution or listing of a program.
The default value for ESCAPE is [Ctrl-C].
For instance, to use ASCII character 04 ( [Ctrl-D] ), as the ESCAPE character you would use the command:
ESCAPE=4
On reception of the ESCAPE character, error number 3 will be generated and any pending ON ERROR routine will be
executed. All I/O buffers will be emptied, all RTS lines will be activated, and all output buffers will be enabled.
There can be only one escape character for all ports at any time.
Escape recognition can be disabled using ESCAPE OFF, and is re-enabled using ESCAPE ON. Enabling and disabling
of escape recognition can be per port. When no port number is specified, the default port as defined by OPORT will be
assumed. In any other case you must specify the port; e.g. ESCAPE#3 OFF.
After pressing the STOP button, the Escape character for each port will be reset to [Ctrl-C], with handling of ESCAPE
characters being enabled for port 1, and disabled for all other ports.
FALSE is a system variable which returns the value 0, and it is used in many logical operations to make programs more
readable. A further advantage of using FALSE (in the correct context), is that it uses only 1 byte of storage, whereas the
integer 0 occupies 2 bytes.
This is used in the programming environment to enable/disable
the Fax <> Modem selector. Same as AT "*F3".
The selector is used during the first stage after answering a call. It will wait some time for a Fax or Modem Calling Tone
(1100 or 1300 Hz). Default 5 seconds is waited and this can be changed by setting SREG62 per 100 ms.
If no Calling Tone is ‘seen’ the modem continues as a Fax (bit0 in SREG62 is 0) or as a modem (bit0 in SREG62 is 1).
With FAX ON the modem will wait for an answer tone after dialing and then return with result code 19 (=ESCAPE). The
FAX SEND and FAX RECEIVE commands will both automatically set FAX ON.
With FAX OFF the modem tries to connect as a modem.
The FAX RECEIVE command is a powerfull tool that allows the Argus to receive a fax directly onto the disk filing system.
Before using the FAX command a RAM buffer of at least 1024 bytes big must be defined with the BUFFER command.
The FAX RECEIVE command consists of three parts.
FAX RECEIVE [file]
Filename can have a maximum of 10 characters. No wildcards are allowed. After connecting, a file is stored which starts
with page number '01'. Also the resolution is added to the file name. Example:
FAX RECEIVE "test"
will receive file 'TEST.01.S' or ('TEST.01.F')
next page 'TEST.02.S' or ('TEST.02.F')
etc.
There is 1 exceptions on the file name, namely when the name starts with a '#' (hash):
FAX RECEIVE "#"
the modem will first connect and then send all the received G3 data through the fax printer driver. It will then be printed out
on the printer on port 1, port 2 or port 7 (depending on OPORT).
FAX RECEIVE [file], [option]
These are the same options as for FAX SEND. The ',U' and ',T' and ',N' options have no effect.
If you only want to receive in standard resolution you can add ',S'. Example:
FAX RECEIVE "test",S
If you add ',F', it depends on the sending fax whether it will be received as a standard or fine resolution file.
The speed register (S51) can also be set to ensure reception at a known speed. If it is set at 0 (S51=0) then the highest
speed, after negotiation with the other fax machine, is used.
During the handshaking process, the two faxes exchange their ID's. The ID numbers are strings with a maximum length of
20 characters and may only contain numbers and the characters '+' and '-'. The ID of the sending fax machine will be stored
at address &2950 after leaving the FAX RECEIVE command, while your own ID must be stored at address &2970 before
executing the FAX RECEIVE command. The commands POKE$ and PEEK$ are used to write and read the ID strings.
FAX RECEIVE [file] TO [number]
A number can be added in a special case, namely polling. Example:
FAX RECEIVE"test" TO "01223-1227"
The modem will dial up another fax machine and will look for a ready to send document (polling). If there is a document it will
receive it and store it in the usual way.
The FAX SEND command is a powerfull tool that allows the Argus to send a fax from the disk filing system. Before using
the FAX command a RAM buffer of at least 1024 bytes big must be defined with the BUFFER command.
The FAX SEND ... TO ... command consists of three parts.
FAX SEND [file]
The file name can be any name up to 16 characters long. If the file name is 10 characters or less, the system will
automatically add ".01*.*" as the first page number. If found, the sending continous with ".02*.*", ".03*.*", etc until no more
files/pages are found. Example:
(file) = "TEST" will send'TEST.01'
'TEST.02'
etc.
or
'TEST.01.S'
'TEST.02.S'
etc.
If the file name is more than 10 characters long OR a wildcard is used (* or ?), the system just sends the matching files,
without adding page numbers. If you are using wildcards in the file name, many files can be sent with one command.
Example:
(file) = "TEST*.*" will send'TEST'
'TEST1'
'TEST999'
'TEST-ALL'
'TEST-TEXT.01'
'TEST-TEXT.02'
'TEST-BIN.S'
'TEST-BIN.F'
'TEST.T'
'TEST50.01.T'
When a file name ends with '.T ' or nothing, it will be treated as a text-file. Convertion to G3 format is done on the fly during
sending.
When a file name ends with '.S ' it will be treated as a Standard resolution G3 file. Standard resolution can not be converted
to Fine resolution by the modem!
When a file name ends with '.F ' it will be treated as a Fine resolution G3 file. Fine resolution is automatically converted to
Standard during sending if the receiving fax doesn’t support Fine or if sending is fixed to Standard.
When a file name ends with ‘.G‘ it will be treated as a G3 file with an unknown resolution. How the file is sent depends on
the negotiation of the 2 fax machines and on the way the resolution is set with S-register 17.
Page numbers can be maximum of '.99' (after that it will continue with '.AO', '.A1', .....til '.Z9').
FAX SEND [file], [option]
Some options can be added to the command:
,U
,S
,F
,T
,N
; Unread files only
; Send in Standard resolution only
; Send in Fine resolution only
; Include Top Line and strip lines of a '.F' or '.S' file
; Don't send Top Line and don't strip from a G3 file
Examples:
FAX SEND Text$,U,T,S TO Tel$
FAX SEND Text$,N TO Tel$
FAX SEND Text$,F TO Tel$
These options can also be selected by S-register 17:
S17 ; Fax flags
b7
b6
b5
b4
b2+b3
b0+b1
=0/1= Fax connection disabled/enabled (FAX OFF/ON)
=0/1= No/Yes send own Top Line (,N/,T)
=0/1= Standard/Fine resolution (,S/,F)
=0/1= No/Yes strip Top Line of bin file (,N/,T)
= Select line-time: 0,10,20,40 ms
= Don't alter (not for faxing)!
Stripping the Top Line from a G3 file will remove the first 16 (Standard) or 32 (Fine) scan-lines during the sending of that file.
This is equal to 2 text-lines when compared to a text-fax.
Adding your own Top Line is enabled by setting bit6.
Bit7 is automatically set/cleared by the system when using the FAX command.
Selecting the line-time is only used when receiving faxes and normally doesn’t have to be changed.
After '&F ' the register is set on 83, which means:
Standard resolution and Top Line included (,S,T).
The speed at which the modem is transmitting depends on S-register 51. It also depends on the negotiation with the other
fax-machine.
S51=0
S51=11
S51=7
S51=5
S51=6
S51=28
S51=29
; Transmit at highest speed possible after negotiation
; Transmit at 9600 (V29) only
; Transmit at 7200 (V29) only
; Transmit at 4800 (V27ter) only
; Transmit at 2400 (V27ter only
; Transmit at 14400 (V17) only
; Transmit at 12000 (V17) only
The V17 speeds can be disabled (excluded from the negotiation) by setting bit3 in S-register 23 (SREG23=SREG23 OR
8).
After sending or receiving a fax, the used speed can be read from S-register 50 (X=SREG50).
During the handshaking process, the two faxes exchange their ID's. The ID numbers are strings with a maximum length of
20 characters and may (officially) only contain numbers and the characters '+' and '-'. The ID of the receiving fax machine
will be stored at address &2950 after leaving the FAX SEND command, while your own ID must be stored at address
&2970 before executing the FAX SEND command. The commands POKE$ and PEEK$ are used to write and read the
ID strings.
The top line text must be stored at address &2990. This text is a string with a maximum length of 100 characters and can be
written and read using the commands POKE$ and PEEK$.
FAX SEND ... TO [number]:
This can be a telephone number. A 'D' (Dial) is automatically put in front of the string, and is treated as a normal 'ATD'
command. Examples:
FAX "TEXT" TO "0-123456"
FAX "TEXT" TO "T018282"
FAX "TEXT" TO "p0w111111"
If the modem is already on-line, then this string will be ignored.
There are three (3) special cases:
When the command starts with a less than sign ("<"):
After dialing, connecting and sending the file(s), the modem will not stop sending, but will return with result code 19
(= ESCAPE). A second FAX-command can then be given and sending will continue with another file on the
same page. This is especially useful for adding footers.
When the command starts with a greater than sign (">"):
After dialing, connecting and sending the file(s), the modem will not stop sending, but will return with result code 19
(= ESCAPE). First, however, it will end its current page and start a new page on the other fax-machine. A
second FAX-command can then be given and sending will continue with another file on a new page. This is
especially useful for adding documents.
When the command starts with a hash ("#"):
The converted fax data is now routed through the fax printer driver. It will then be printed out on the port selected
by OPORT. No dialing is needed or done. For example:
FAX SEND "TEXTFILE" TO "#"
Program example:
FAX ON;
DIAL Tel$;
IF RESULT<>19 GOTO Err;
FAX Head$ TO "<";
IF RESULT<>19 GOTO Err;
FAX Text$ TO "<";
IF RESULT<>19 GOTO Err;
FAX Foot$ TO ">";
IF RESULT<>19 GOTO Err;
FAX Dcmt$ TO "";
IF RESULT GOTO Err;
Enable fax connection
Dial number and wait for Answer tone
Result = ESCAPE (Answer tone found)?
Go back on-line, connect/negotiate and send header
Successful so far?
Go back on-line, and continue sending text file on same page
Still successful?
Go back on-line and continue sending footer on same page
Still successful?
Go back on-line and continue sending document on next page
Overall successful?
There are 3 system variables which can be read or checked after the FAX SEND/RECEIVE command: MATCH,
RESULT and ERN.
After FAX SEND, it contains the total number of files sent.
After FAX RECEIVE, it contains the number of pages received.
RESULT is a function which holds the status of the last modem activity:
RESULT =0OK
RESULT =2RING
RESULT =3NO CARRIER
RESULT =4ERROR
: Sending or Receiving was successful
: File not found with FAX SEND (special case)
: Initiate handshake with other fax has failed
: No confirmation from other fax after sending a page or
failure during receiving a page
RESULT =6NO DIALTONE
RESULT =7BUSY
: No dialtone found before dialing out
: Other fax found busy after dialing out or disk is full during
receive (special case)
RESULT =8NO ANSWER
RESULT =18OFF-HOOK
: No answer (answer tone) found after dialing out
: Modem is not connected to telephone system or line is
already in use
RESULT =19ESCAPE
RESULT =20VOICE
: Used when sending, meaning 'continue'
: Human voice (or much noise) found after dialing
ERN is only set when a filing system error has occured:
ERN =0OK
ERN =22 Out of memory
ERN =73 Not found
: No error
: Disk is (became) full during FAX RECEIVE
: File not found during FAX SEND <filename> RESULT
: No filing system ROM available
: No fax system ROM available
: No or too small RAM buffer is defined (must be at least BUFFER &400,
1k bytes, 1024 bytes)
Sending TEXT faxes
ASCII text files are converted to G3 format on the fly. The output on the remote fax machine depends on the 4 parameters
set with the DUTCH or ENGLISH command:
1. Characters per line:
0 = Word Warp disabled, 10 chars/inch, max. 80 chars on a line
1-88 = Word Wrap enabled, 10 chars/inch, max. 80 chars on a line
89-112 = Word Wrap enabled, 12 chars/inch, max. 96 chars on a line
113-254 = Word Wrap enabled, 17 chars/inch, max. 136 chars on a line
Word Warp means that a whole word is started on a new line if it doesn’t fit on the current line.
A new line is always generated after a character with the value equal to S-register 3 which defaults to control-character 13
(=Cariage Return). All characters with a value equal to S-register 4 are ignored; default control-character 10 (=Line Feed).
2. Lines per page:
The maximum number of lines per page can be set with this parameter. If more lines are in the file, then a new page is
negotiated first with the remote fax before sending continues. For standard A4 format this parameter must be set to 68 if the
top line is enabled or 70 if the top line is disabled.
Setting this parameter to 0 will disabled the automatic page-break generation. A new page is also forced if the file contains a
control-character 12 (=CTRL-L=Form Feed). If a control-character 26 (=CTRL-Z=End Of File) is encountered the sending
stops.
3. Left margin:
Enabling the left margin will add some spaces in front of a line, if that line is less than 80, 96 or 136 characters.
4. Page fillout:
Enabling the page fillout will fill the page with empty lines on the bottom until the ‘lines per page’ is reached. This is done
before starting a new page and at the end of the file.
For use inside a text file, a few embedded commands are recognized:
The Argus BASIC FOR ... NEXT loop construct is very similar to that used in most versions of BASIC, and allows a
sequence of commands to be executed a fixed number of times depending upon the value of a 'loop variable'.
For example:
10 PRINT "Start"
20 FOR X=1 TO 10 : PRINT X;" "; : NEXT X
30 PRINT "End"
will display:
Start
12345678910
End
i.e. the first time the FOR command is encountered, the numeric variable X is set to 1 and printed. The loop is then
repeated, X being incremented to 2 and printed again. This procedure is repeated until X is 10, after which line 30 is
executed and the program ends.
By default, the loop variable X, is incremented by 1, but this can be changed by including the optional STEP clause in the
FOR command:
10 PRINT "Start"
20 FOR X=1 TO 10 STEP 2 : PRINT X;" "; : NEXT X
30 PRINT "End"
Here, X is incremented by 2 each time the loop is executed, so only the numbers 1, 3, 5, 7, 9 are printed.
More complicated loops can be constructed by including multiple commands between FOR and NEXT:
50 FOR X=1 TO 5 : PRINT X : PRINT X*X :
PRINT X*X*X : NEXT X
This program line prints X, the square of X and the cube of X for each value of X between 1 and 5. The number of
commands executed is limited only by the maximum line length of 255 characters.
Up to sixteen FOR ... NEXT loops can 'nested' within each other, each operating on a different loop variable:
FOR A=1 TO 10 : FOR B=5 TO 15 :
PRINTA+B:NEXT B : NEXT A
Here, there are two loops. This example could in fact be shorter (and more efficient) by combining the two NEXT
commands:
FOR A=1 TO 10 : FOR B=5 TO 15 :
PRINTA+B:NEXT B, A
It is also possible to omit the variable following NEXT completely; in which case the variables are incremented innermost
first. The example above would then become:
The frequency of the signal on the telephone line is permanently measured by the modem. When the modem is off-hook, the
command FREQ will read this value. This is only useful for specialist applications; but we can think of some very special
ways of using it for access control of your computer.
The value is updated every 100ms by the operating system. Reading the value faster than 100ms will return the last/same
values and has no use.
GET is used to obtain the next byte from the specified input buffer, and returns an integer between 0 and 255. Program
execution is suspended until data becomes available. If no port is specified, the default input port as defined by IPORT is
assumed.
GET$ is used to obtain the next character from the specified input buffer, and returns a 1-character string. Program
execution is suspended until data becomes available. If no port is specified, the default input port as defined by IPORT is
assumed.
The GOSUB command causes program execution to branch to the specified line number or label. Execution proceeds from
this line until a RETURN command is encountered, at which point execution resumes at the command immediately following
the GOSUB. The section of code executed by the GOSUB is referred to as a subroutine, and may be executed any number
of times within the program. For example:
10 PRINT "Main program start"
20 GOSUB 500
30 ...
400 END
500 PRINT "Now in subroutine"
510 WAIT 5
520 PRINT "Leaving subroutine"
530 RETURN
In many versions of BASIC, subroutines are referred to by the line number of their first line, as in the example above. In
Argus BASIC however, it is better to make use of the label facility, and precede each subroutine by a label that indicates the
function of that routine. You could then rewrite the example as:
10 PRINT "Main program start"
20 GOSUB Demo
30 ...
400 END
500 %Demo
510 PRINT "Now in subroutine"
520 WAIT 5
530 PRINT "Leaving subroutine"
540 RETURN
Proper use of labels can make the main program much easier to read and understand. The use of % preceding a label with
GOSUB is optional. Thus GOSUB Dial is identical to GOSUB %Dial.
A subroutine may also be called from within another subroutine, and up to sixteen calls may be 'nested' in this way.
HANDSHAKE is used to select the action taken when an input buffer is almost overflowing during receipt of data. Correct
selection of the type of handshaking to be used is necessary to avoid loss of data.
Each port on the modem has a 256-byte input buffer. When characters are received at a higher speed than they can be
processed, the input buffer will gradually fill. In order to avoid loss of data due to input buffer overflow, when there are only 5
bytes left free in a buffer, the modem will check to see if a handshake protocol has been selected; and if it has will take the
appropriate action as follows:
RTS/CTS selected:
The modem will take CTS low until the input buffer is half empty and then take CTS high again to restart
ÿransmission.
XON/XOFF selected:
The modem will send an XOFF character to the remote system, wait until the input buffer is half empty, and then
send an XON character to restart transmission.
To select the type of handshaking used there are two commands:
HANDSHAKE CTS
and
HANDSHAKE XOFF
which select hardware or software handshaking respectively.
It is also possible to use both software and hardware handshaking at the same time. Use:
HANDSHAKE CTS,XOFF
A further command is used to disable the previously selected handshaking method:
HANDSHAKE OFF
Each of these commands can specify the appropriate port. If no port is specified, the default input port as defined by
IPORT will be assumed. Note that the modem will always obey the RTS/CTS handshake protocol on ports defined as
outputs.
Handshaking via LINKed ports
The situation becomes more complex when ports have been connected using a LINK command.
To visualize this situation, assume that ports 1 and 2 are LINKed, and that the two character streams are crossed; i.e. all
characters received by port 1 are sent to the port 2 output buffer, and all characters received by port 2 are sent to the port 1
output buffer.
Assume also that port 1 is operating at a higher baud rate than port 2 (e.g. 9600 vs. 1200). All characters received via port 1
will be re-transmitted via port 2 at a lower speed, so that the output buffer for port 2 will gradually fill up. When it is almost
full, port 1 should take steps to stop the receipt of data by either issuing an XOFF to the connected system, or by taking CTS
low. To ensure that this happens, a further command is used:
HANDSHAKE LINK ON
To summarize, handshake should always be defined for input ports. Check always whether a linked port can cause the
buffers of output ports to overflow. This is especially important when baud rate conversion is used.
The handshake of the input ports has to be set with the HANDSHAKE command. This is normally HANDSHAKE RTS.
When the data stream on a linked port is not to be monitored by a program, then the command HANDSHAKE LINK OFF
should be used.
The HANDSHAKE command may specify one or more port numbers, but if these are omitted, the default port as defined by
OPORT will be assumed.
After the STOP button has been pressed, HANDSHAKE RTS will be set for each port, and HANDSHAKE LINK will be
set to OFF.
Note that the XON and XOFF characters can be configured using the XON and XOFF commands.