Vidicode Argus Basic Programmers Reference Manual
Have a look at the manual Vidicode Argus Basic Programmers Reference Manual online for free. It’s possible to download the document as PDF or print. UserManuals.tech offer 9 Vidicode manuals and user’s guides for free. Share the user manual or guide on Facebook, Twitter or Google+.
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 38 BRK transmit a break 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 ON BRK also. Examples: BRK#3 ON HANGUP BRK#1 Syntax: BRK (#[port]) See also: ON BRK
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 39 BUFFER reserve buffer space 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.
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 40 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. Examples: BUFFER 1000 BUFFER Size BUFFER OFF Syntax: BUFFER [num]
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 41 BUFFER OFF See also: IPORT, OPORT, LINK, RESTORE BUFFER
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 42 BUTTON read the S/A button position 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. Examples: IF BUTTON THEN GOSUB Syn_Com PRINT BUTTON Syntax: [num-var] = BUTTON See also: ON BUTTON
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 43 CALL jump to machine code subroutine 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. Examples: CALL &3000 CALL Measure,2,X,Y CALL Calculate,G1,G2 Syntax: CALL [address] ( , [Accu], [X-reg], [Y-reg] ) See also: PEEK, POKE, RECEIVE
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 44 CHR$ character string 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: 500 E$=Error !+CHR$7 510 PRINT E$ Examples: X$=CHR$(48+X) PRINT CHR$75 Syntax: [string-var] = CHR$ [integer 0..255] See also: ASC
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 45 CLEAR clear variables/memory CLEAR can be used in one of nine ways: 1. CLEAR 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. Examples: CLEAR CLEAR ALL CLEAR OUTPUT CLEAR INPUT#1,#3 CLEAR PORT 1
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 46 CLEAR BUFFER CLEAR FILE CLEAR ! Syntax: CLEAR CLEAR ALL CLEAR#[port](,...) CLEAR INPUT ( #[port])(,...) CLEAR OUTPUT ( #[port])(,...) CLEAR BUFFER CLEAR PRINTER CLEAR (!/FILE) CLEAR ROM See also: RESTORE, RESTORE ROM, ROM
ARGUS Programmable Modem BASIC Programmers Reference Manual © 1990 - 1997 Vidicode Datacommunicatie BV 47 CLOCK$ read internal clock CLOCK$ is used to read the time and date from the internal real-time clock. Output is given in the format: DAY dd-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. Examples: C$=CLOCK$ CLOCK$ Syntax: [string-var] = CLOCK$ See also: DDAY, DAY, MONTH, YEAR, HOUR, MIN, SEC, DATE$, TIME$