Home > Vidicode > Communications System > Vidicode Argus Basic Programmers Reference Manual

Vidicode Argus Basic Programmers Reference Manual

    Download as PDF Print this page Share this page

    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 
    168
      
    POKE    put byte into memory 
    POKE is used to write single bytes of data into memory, and is most commonly used to pass values to and from machine 
    code routines, or to save information which can be retrieved later with the PEEK command.  Two parameters are required, 
    which specify the address and the value to be stored. 
    Examples: 
    POKE Address, Byte
    POKE &4000+Pointer, GET
    POKE &7000, B
    Syntax: 
    POKE [integer], [integer 0..255)
    See also: 
    PEEK, PEEK$, POKE$
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    169
      
    POKE$    put string into memory 
    POKE$ is used to write strings into memory which can be retrieved later using PEEK$.  Two parameters are required which 
    specify the start address and the string to be stored.  Each character in the string is stored in the next sequential memory 
    location from the specified start address.  A Carriage Return is automatically appended to denote the end of the string. 
     
    As an example of the use of POKE$, the following program stores lines of text one after the other in memory: 
    20 DIM Address 500 : Pointer=0
    30 REPEAT
    40 INPUT Line$
    50 POKE$ Address+Pointer, Line$
    60 Pointer=Pointer+LEN(Line$)+1
    70 UNTIL Pointer=5
    This is more efficient than using string arrays because each string takes up the minimum amount of memory possible.  Text 
    stored in this way could be retrieved with the following program: 
    10 DIM Address 500 : Pointer=0
    20 REPEAT
    30 Line$=PEEK$(Address+Pointer)
    40 PRINT Line$
    50 Pointer=Pointer+LEN(Line$)+1
    60 UNTIL Pointer=5
    Refer to POKE for a description of access to User memory with POKE$. 
    Examples: 
    POKE$ Address,String$
    POKE$ &A000+I,X$
    Syntax: 
    POKE$ [integer] , [string]
    See also: 
    PEEK, PEEK$, POKE
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    170
      
    PORT    last event 
    PORT is used to read the port number on which the last event happened. 
     
    PORT is thus associated with the ON ... event handlers. 
     
    PORT can also be part of many command lines to indicate the port number (instead of #). 
    Examples: 
    IF PORT=3 THEN GOSUB Password-control
    PRINT PORT 2 Hello
    Syntax: 
    [num-var] = PORT
    See also: 
    ON BRK, ON DTD, ON DTR, ON ESCAPE, ON SEQUENCE
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    171
      
    PRINT    send data to port 
    PRINT is used to output numbers and/or strings to the output ports.  There are several major advantages over PUT and 
    PUT$: 
    a) PUT and PUT$ can only send a single value/character at a time. 
    PRINT can send multiple characters or values. 
    b)  Any output formatting required must be carried out explicitly using 
    PUT and PUT$, but PRINT provides a variety of formatting options. 
    If no port number is specified, the default output port as defined by OPORT will 
    be assumed. 
     
    All printing from memory is buffered and interrupt driven; i.e. on execution of the PRINT command, the data to be printed is 
    immediately copied to a buffer.  Program control then returns to the command following PRINT, while the buffered data is 
    output by a background interrupt routine.  Care should be taken not to clear the output buffer before it has been fully emptied 
    - in the next example, the buffer may be cleared before the complete text has been transmitted, and some data may be lost: 
    10 PRINT VIDICODE Datacommunications - ARGUS Programmable Modem
    20 CLEAR OUTPUT
    PRINT positioning & formatting 
    Various characters can be used within the PRINT command to alter the format of the output by inserting or suppressing 
    Carriage Returns: 
    ;  a semi-colon following an item to be printed suppresses the automatic addition of [CR], and causes printing to 
    commence immediately following the last printed value. 
    ,  a comma following a value/string to be printed causes printing to commence at the start of the next horizontal 
    field position.  This is 8 characters away from the last horizontal field position or the start of the line. 
      a single quote mark before or after a value/string to be printed causes the insertion of an additional [CR]. 
    ~  a tilde causes numeric values to be printed in hexadecimal format. 
    Command Characters sent 
    PRINT X 
    X[CR] 
    PRINT X; 
    X 
    PRINT  
    [CR][CR] 
    PRINT X 
    [CR]X[CR] 
    PRINT 1 
    1[CR] 
    PRINT -1234 
    -1234[CR] 
    PRINT ~11 
    B[CR] 
    PRINT ~-1 
    FFFF[CR] 
    PRINT ;1; 
    1 
    PRINT ;~-1; 
    FFFF 
    PRINT X,1 
    X 1[CR] 
    PRINT X1 
    X[CR] 1[CR] 
    PRINT 1,1; 
    1       1  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    172
      
    Examples: 
    PRINT Message number : ;M_Nr;
    PRINT#1,#7,12+9*A(I)
    PRINT ~1000*R/P
    PRINT ;&100+PEEK(&2000)
    PRINT#1,DTR=;DTR#2,RTS=;RTS#2
    PRINT E1$+E2$+CHR$7
    Syntax: 
    PRINT ( #[port] , ) (#...) ( [string] ) () (,) (;) (~) ( [integer] )
    (;)
    See also: 
    OUTPUT, PUT, PUT$ 
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    173
      
    PRINTER    enable/disable printer port 
    PRINTER provides an alternative means of controlling the printer port.  The parallel printer port is only available in an Argus 
    Programmable Modem, not in a T.C.Lite.  There are four forms of the command: 
    PRINTER and PRINTER ON 
    The PRINTER and PRINTER ON commands will enable the printer by adding 64 to the value of OPORT. 
    PRINTER OFF 
    This subtracts 64 from the value of OPORT, thereby disabling the printer. 
    PRINTER LINEFEED ON/OFF 
    This causes the modem to insert or suppress the insertion of a Linefeed character after every Carriage Return sent to the 
    printer. 
    PRINTER INPUT/OUTPUT 
    This command is used to configure the parallel port for Input or Output. 
    Examples: 
    PRINTER
    PRINTER ON
    PRINTER LINEFEED OFF
    PRINTER INPUT
    Syntax: 
    PRINTER ON|OFF
    PRINTER LINEFEED ON|OFF
    PRINTER OUTPUT
    See also: 
    LINEFEED, OPORT
      
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    174
      
    PROTOCOL    set file transfer protocol 
    Selecting between different protocols is done by the PROTOCOL command.  Before sending or receiving using the 
    SEND,X or RECEIVE,X commands you must set the right options with this command. 
     
    PROTOCOL expects a number between 0 and 255.  The bits in the number are organized as follows: 
     
    bit0 =0/1=  Use checksum/CRC-16 for error detection 
    bit1 =0/1=  Use 128/1024 bytes in a block (Xmodem-1K or Ymodem-1K 
    bit2 =0/1=  No/Yes batch option (Xmodem/Ymodem) 
    bit3 =0/1=  No/Yes stream option (Xmodem-g or Ymodem-g) 
    bit4 =0/1=  Yes/No end of transfer with batch 
    bit5 =0/1=  Use last number before first dot/last in name with Ymodem 
    bit6 =0/1=  Use real/info-block for filenames with Ymodem 
    bit7 =0/1=  No/Yes CTRL-Z (EOT) at end of file in last block with Xmodem 
     
    Bit0:  Checksum or CRC-16. 
    Checksum is an old way to detect errors in a block.  These days CRC-16 is always used.  Some old systems, 
    however, may still be using checksum.  The modem will automatically detect that the other system is using 
    checksum, when CRC-16 is selected.  So, it is best that this bit is always high. 
    Bit1:  128 or 1024 bytes 
    Using 128 bytes in a block is normal for Xmodem and using 1024 bytes in a block is normal for Ymodem.  When 
    sending big files with Xmodem, then 1024 bytes can be useful.  Sending in Ymodem over a bad line, then 128 
    bytes would be useful. 
    Note:  In order to be able to use 1024 bytes in a block, a buffer must be defined with the BUFFER command of at 
    least 1K (&400) bytes.  Otherwise, the error message No/Bad Buffer (ERN=92) is generated.  When using MNP5 
    together with file transfer, a buffer of at least 4K (&1000) bytes must be defined.  So, the command BUFFER
    &1000 is suitable for all situations. 
    Bit2: Batch option 
    With this you select between Xmodem or Ymodem.  Xmodem only sends the contents of the file.  Ymodem also 
    sends the filename and file length. 
    Bit3: Stream option 
    With this bit you select the stream option, also known as Xmodem-g or Ymodem-g.  This type of transfer can only 
    be used over reliable lines, because there is no error recovery.  The sending side keeps on sending and the 
    receiving side keeps on receiving.  When the receiver detects an error, it aborts the transfer immediately.  It is the 
    fastest way to transfer, because no ACKs and NAKs are sent, only data blocks. 
    Bit4:  End-of-transfer with batch. 
    This bit only has effect when Ymodem-send is selected.  When it is set, a SEND command will return without 
    sending the end-of-transfer to remote.  This means that a next SEND command (with Ymodem) can be entered.   
    The last file must be sent with bit4 cleared. 
    Example: 
    PROTOCOL 7+16
     
    SEND FILE1,X
    : 1st file 
    SEND FILE2,X
    : 2nd file 
    SEND FILE3,X
    : 3rd file  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    175
      
    PROTOCOL 7
     
    SEND FILE4,X
    : 4th and last file 
    Bit5:  Ymodem-receive file name counter. 
    This bit only has an effect when Ymodem-receive is selected and when bit6 is 1.  It determines how the filename is 
    used when receiving multiple files with Ymodem.  If bit5 is set, then the last number in the filename is incremented.   
    If bit5 is cleared, then the last number before the first dot (if any), is incremented. 
    Example: 
    PROTOCOL 7+64
    RECEIVE TEST0001.01.Y,X
    ^^^^
    RECEIVE 1234-0001.01.Y,X
    ^^^^
    RECEIVE 1234.01.Y,X
    ^^^^
    or 
    PROTOCOL 7+32+64
    RECEIVE TEST0001.01.Y,X
    ^^
    RECEIVE 1234-0001.01.Y,X
    ^^
    RECEIVE 1234.01.Y,X
    ^^
    or 
    PROTOCOL 7+64 (or PROTOCOL 7+32+64)
    RECEIVE TEST001,X
    ^^^
    RECEIVE TEST01-001,X
    ^^^
    RECEIVE 1234,X
    ^^^^
    RECEIVE TEST.01,X
    ^^
    Bit6: Ymodem filename 
      The modem can select between 2 modes, when using Ymodem. 
      The first mode (bit6=0) uses real filenames, which is the normal way. 
    Example: 
        Computer sends file LETTER.TXT 
        Modem receives file LETTER.TXT 
    or 
        Modem sends file LETTER.TXT 
        Computer receives file LETTER.TXT 
      Note:  When receiving files with Ymodem in this way, a dummy filename must be used with the RECEIVE 
    command (RECEIVE dummy,X). 
    The second mode (bit6=1) is specially implemented for use inside the modem because some applications will need 
    it.  The outside world wont notice the difference when implemented correctly. 
    Instead of using the real filename, the modem uses the Information Block (IB) for the received or sent filenames.  
    First some explanation about IB. 
    Each file in the internal filing system of the modem has 32 bytes of free space attached to that file (the IB).  These 
    bytes can be accessed or made visible with the following commands. 
     SEND [name],B  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    176
      
     RECEIVE [name],B 
     DIR [name],B 
     DIR [name],F 
    Exchanging data between the IB and the file is done with PEEK and POKE on addresses &2BE0 til &2BFF. 
     
    When the command SEND [name],B is given, the IB of that file is placed on &2BE0. 
     
    When the command RECEIVE [name],B is given, the 32 bytes on &2BE0 are placed in the IB of that file. 
     
    When a new file is created with RECEIVE, the contents of &2BE0 is used to fill the IB of that new file. 
     
    The SEND and LOAD commands are also filling &2BE0 with their IB. 
     
    The contents of the IB can be read with DIR [name},B.  DIR [name],F will also show the contents, but 
    only when there is a legal ASCII string in it, terminated with , ASCII 13. 
     
    When receiving with Ymodem, the modem uses the filename given with the RECEIVE command.  The real filename from 
    the other side is stored in the IB.  Before storing the name, the modem first looks for a  on &2BE0 til &2BFF.  If there is 
    a  at the start, the filename will be stored at the beginning of the IB.  Also, when there is no  found, the filename 
    will be stored at the beginning.  If it finds a  after a string, the filename will be stored after this string and the  will 
    be replaced by a \. 
    The filename used by the modem to store it, must contain an ASCII number.  The number nearest to the dot (if 
    any) is taken.  This number is automatically incremented by the modem when more than 1 file is received. 
    Examples: 
     PROTOCOL 7+64 (or PROTOCOL 71) 
      
     POKE &2BE0,13 
     
     RECEIVE FILE0001,X  (3 files are received) 
     
     DIR FILE*,F 
     
     1 0005 FILE0001 24-1 U : LETTER.TXT 
     2 0020 FILE0002 24-1 U : GAME.EXE 
     3 0009 FILE0003 24-1 U : MODEM.DOC 
      
     POKE &2BE0,LETTERS
     
     RECEIVE LET08,X  (4 files are received) 
     
     DIR LET*,F 
     
     1 0005 LET08 24-1 U : LETTERS\ORDER.TXT 
     2 0030 LET09 24-1 U : LETTERS\ALWIN1.TXT 
     3 0009 LET10 24-1 U : LETTERS\ALWIN2.TXT 
     4 0009 LET11 24-1 U : LETTERS\HAWAI.TXT 
     
    When sending, the modem gets the real filename from the IB and no ASCII number is incremented automatically.  
    Examples: 
     
     PROTOCOL 7+64 
     
     SEND FILE*,X 
     SEND LET*,X 
     
    Bit7:  CTRL-Z (=EOT= End of Text)  
    						
    							ARGUS Programmable Modem 
    BASIC Programmers Reference Manual 
    © 1990 - 1997 Vidicode Datacommunicatie BV 
    177
      
    If bit7=0 the file length will not be correct, since remaining bytes in the last block are filled with 0 bytes (=NUL).  When bit7=1, 
    first a CTRL-Z is placed at the end of the file, the rest is filled with 0.  This is sometimes needed when sending text files. 
    Syntax: 
    PROTOCOL [integer 0-255]
     
      
    						
    All Vidicode manuals Comments (0)

    Related Manuals for Vidicode Argus Basic Programmers Reference Manual