$SYSPROG ON$
PROGRAM specialbuffer(INPUT,OUTPUT);
IMPORT iodeclarations,general_4;
TYPE    short_integer = -32768..32767;
VAR     buffer : buf_info_type;
        stuff  : PACKED ARRAY[0..1023] OF short_integer;
        i,j    : INTEGER;
BEGIN
  iobuffer(buffer,0);                     { set up for 0 bytes }
  WITH buffer DO BEGIN
    buf_ptr := ADDR(stuff);               { set up ptr to data }
    buf_size:= 2048;                      { size in bytes      }
  END; { of WITH DO BEGIN }
  
  FOR j:=0 TO 7 DO BEGIN 
  
    FOR i:=0 TO 1023 DO stuff[i]:=i;      { put data into array }
    
    WITH buffer DO BEGIN
      buffer_reset(buffer);               { to get empty/fill set }
      buf_fill := ADDR(buf_fill,2048);    { mark buffer full }
    END; { of WITH DO BEGIN }
                                          
    transfer(701,serial_fastest,from_memory,buffer,2048);
                                          { send data        }
  END; { of FOR DO BEGIN }
  
END. { of PROGRAM }
