home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FATDOS.ZIP / FATD1.DOC < prev    next >
Encoding:
Text File  |  1988-04-15  |  23.8 KB  |  951 lines

  1.  
  2.     FAT-DOS 1.0            ALLMEM            PAGE A-1
  3.  
  4.  
  5.  
  6.     ALLMEM - Allocates memory dynamically at run-time.
  7.  
  8.     integer*2   Npar,Seg,Maxpar
  9.         call AllMem(Npar,Seg,Maxpar)
  10.      
  11.     call with:
  12.     Npar - Number of Paragraphs(16 bytes) to allocate.
  13.     
  14.     returns:
  15.     Seg  - Segment address of 1st paragraph, or an error code.
  16.     Error Code: 7 - memory control blocks destroyed.
  17.                 8 - insufficient memory.
  18.     Maxpar - Maximum number of available paragraphs, if allocation 
  19.         failed, otherwise the actual number of paragraphs allocated.
  20.          
  21.         example: Npar = 10
  22.         call AllMem(Npar,Seg,Maxpar)
  23.         if(Seg .eq.7 .or. Seg.eq.8)go to 1000
  24.  
  25.  
  26.  
  27.     FREMEM - Free memory allocated via AllMem.
  28.  
  29.     integer*2 Seg,Ierr
  30.         call FreMem(Seg,Ierr)
  31.  
  32.         call with:
  33.         Seg - Starting paragraph of memory block allocated with AllMem.
  34.  
  35.         returns:
  36.         Ierr - Error code = 0 -safe return, memory free'd
  37.                             7 -memory control blocks destroyed
  38.                             9 -incorrect segement address
  39.         example: 
  40.           NPAR = 16
  41.           call ALLMEM(NPAR,SEG,MAXPAR)
  42.           if(SEG.eq.7.or.SEG.eq.8)go to 900
  43.       call pokeb(Int2(0),Seg,Value)
  44.           .
  45.           .
  46.           call FREMEM(SEG,IERR)
  47.           if(IERR.ne.0)go to 1000  
  48.     FAT-DOS 1.0            MODMEM            PAGE A-2
  49.  
  50.  
  51.     MODMEM - Modify size of previously allocated memory block. 
  52.     
  53.     integer*2 NPAR,SEG,MAXSEG,IERR
  54.         call MODMEM(NPAR,SEG,MAXPAR,IERR)
  55.         
  56.         call with:
  57.         NPAR = desired modified memory size in paragraphs
  58.         SEG  = seg of current memory block
  59.  
  60.         returns:
  61.         MAXPAR = maximum no. of paragraphs available(if error)
  62.         IER    = 7 memory control blocks destroyed
  63.             = 8 insufficent memeory
  64.             = 9 incorrect seg
  65.      
  66.         example: NPAR = 512
  67.               call ALLMEM(NPAR,SEG,MAXPAR)
  68.               .
  69.               .           
  70.               NPAR =  16
  71.               call MODMEM(NPAR,SEG,MAXPAR,IERR)
  72.  
  73.  
  74.     PEEKB - Get a byte value from memory.
  75.  
  76.     integer*2 OFF,SEG,VALUE
  77.         call PEEKB(OFF,SEG,VALUE)
  78.  
  79.         call with:
  80.         OFF - offset value from start of segment, <=64k
  81.         SEG - segment value of byte location, <=64k
  82.      
  83.         returns:
  84.         VALUE - the byte value is stored in the lower byte of the
  85.                 integer*2 value and the high byte is zeroed.
  86.      
  87.         example:
  88.           call PEEKB(Int2(0),Int2(#B800),VALUE)
  89.           This call returns the ascii value of the character stored
  90.           in the 1st byte of the CGA adapter memory, at row 0, col 0
  91.           of the screen.
  92.  
  93.         Notes: An integer*2 is signed and may range from -32k to +32k.
  94.             If the segment or offset values exceed this amount you should
  95.             declare the segment and offset as integer*4.
  96.           i.e.
  97.             integer*4 SEG,OFF 
  98.             integer*2 VALUE
  99.             SEG = #B800  <--- .gt. 32k
  100.             OFF = 0
  101.             call PEEKB(OFF,SEG,VALUE)
  102.  
  103.     FAT-DOS 1.0            PEEKW            PAGE A-3
  104.  
  105.  
  106.     PEEKW - Get a word value from memory.
  107.  
  108.       integer*2 OFF,SEG,VALUE
  109.         call PEEKW(OFF,SEG,VALUE)
  110.  
  111.         call with:
  112.         OFF - offset value from start of segment, <=64k
  113.         SEG - segment value of word location, <=64k
  114.      
  115.         returns:
  116.         VALUE - the word value is returned in this argument.
  117.      
  118.         example:
  119.           call PEEKW(Int2(0),Int2(#0800),VALUE)
  120.           This call returns word stored at SEG= Hex 0800, OFF=0.
  121.  
  122.         Notes: An integer*2 is signed and may range from -32k to +32k.
  123.             If the segment or offset values exceed this amount you should
  124.             declare the segment and offset as integer*4.
  125.           i.e.
  126.             integer*4 SEG,OFF 
  127.             integer*2 VALUE
  128.             SEG = #B800  <--- .gt. 32k
  129.             OFF = 0
  130.             call PEEKW(OFF,SEG,VALUE)
  131.  
  132.  
  133.     PEEKL - Get a Long word value from memory.
  134.  
  135.       integer*2 OFF,SEG
  136.     integer*4 VALUE
  137.         call PEEKL(OFF,SEG,VALUE)
  138.  
  139.         call with:
  140.         OFF - offset value from start of segment, <=64k
  141.         SEG - segment value of long word location, <=64k
  142.      
  143.         returns:
  144.         VALUE - the long word value is returned in this argument.
  145.      
  146.         example:
  147.           call PEEKL(0,#0800,VALUE)
  148.           This call returns long word stored at SEG= Hex 0800, OFF=0.
  149.  
  150.         Notes: An integer*2 is signed and may range from -32k to +32k.
  151.             If the segment or offset values exceed this amount you should
  152.             declare the segment and offset as integer*4.
  153.           i.e.
  154.             integer*4 SEG,OFF 
  155.             integer*4 VALUE
  156.             SEG = #B800  <--- .gt. 32k
  157.             OFF = 0
  158.             call PEEKL(OFF,SEG,VALUE)
  159.     FAT-DOS 1.0            POKEB            PAGE A-4
  160.  
  161.  
  162.  
  163.     POKEB - Store a byte value in memory.
  164.  
  165.     integer*2 OFF,SEG,VALUE
  166.         call POKEB(OFF,SEG,VALUE)
  167.  
  168.         call with:
  169.         OFF - offset value from start of segment, <=64k
  170.         SEG - segment value of byte location, <=64k
  171.         VALUE - the byte value to store.
  172.      
  173.         returns:
  174.         nothing
  175.      
  176.         example: VALUE = ICHAR('A')
  177.            call POKEB(Int2(0),Int2(#B800),VALUE)
  178.           This call stores the ascii value of the character 'A'
  179.           in the 1st word of the CGA adapter memory, at row 0, col 0
  180.           of the screen.
  181.  
  182.         Notes: An integer*2 is signed and may range from -32k to +32k.
  183.             If the segment or offset values exceed this amount you should
  184.             declare the segment and offset as integer*4.
  185.           i.e.
  186.             integer*4 SEG,OFF 
  187.             integer*2 VALUE
  188.             SEG = #B800  <--- .gt. 32k
  189.             OFF = 0
  190.             call POKEB(OFF,SEG,VALUE)
  191.  
  192.  
  193.     POKEW - Store a word value in memory.
  194.  
  195.     integer*2 OFF,SEG,VALUE
  196.         call POKEW(OFF,SEG,VALUE)
  197.  
  198.         call with:
  199.         OFF - offset value from start of segment, <=64k
  200.         SEG - segment value of word location, <=64k
  201.         VALUE - the word value to store.
  202.      
  203.         returns:
  204.         nothing
  205.      
  206.         example: VALUE = 128
  207.            call POKEW(Int2(0),Int2(#0800),VALUE)
  208.           This call stores the value 128 at SEG=Hex 0800, OFF = 0.
  209.  
  210.         Notes: An integer*2 is signed and may be range from -32k to +32k.
  211.             If the segment or offset values exceed this amount you should
  212.             declare the segment and offset as integer*4.
  213.           i.e.
  214.             integer*4 SEG,OFF 
  215.             integer*2 VALUE
  216.             SEG = #B800  <--- .gt. 32k
  217.             OFF = 0
  218.             call POKEW(OFF,SEG,VALUE)
  219.  
  220.  
  221.     FAT-DOS 1.0            POKEL            PAGE A-5
  222.  
  223.  
  224.  
  225.     POKEL - Store a long word value in memory.
  226.  
  227.     integer*2 OFF,SEG
  228.     integer*4 VALUE
  229.         call POKEL(OFF,SEG,VALUE)
  230.  
  231.         call with:
  232.         OFF - offset value from start of segment, <=64k
  233.         SEG - segment value of long word location, <=64k
  234.         VALUE - the long word value to store.
  235.      
  236.         returns:
  237.         nothing
  238.      
  239.         example: VALUE = 128
  240.            call POKEL(Int2(0),Int2(#0800),VALUE)
  241.           This call stores the value 128 at SEG=Hex 0800, OFF = 0.
  242.  
  243.         Notes: An integer*2 is signed and may be range from -32k to +32k.
  244.             If the segment or offset values exceed this amount you should
  245.             declare the segment and offset as integer*4.
  246.           i.e.
  247.             integer*4 SEG,OFF 
  248.             integer*4 VALUE
  249.             SEG = #B800  <--- .gt. 32k
  250.             OFF = 0
  251.             call POKEL(OFF,SEG,VALUE)
  252.  
  253.  
  254.     FAT-DOS 1.0            OPFILX            PAGE B-1
  255.  
  256.  
  257.     OPFILX - Open an existing file, using the File Handle method.
  258.         The Ier variable should be checked after a call to 
  259.         OpFilx() to be sure a valid Handle has been returnd.
  260.  
  261.     character*n File
  262.     integer*2   Mode,Handle,Ier
  263.     call OpFilx(File,Mode,Handle,Ier)
  264.  
  265.     call with:
  266.     File = 'Name'//char(0), Asciiz string
  267.      MODE = 0   read
  268.           = 1   write
  269.           = 2   read/write
  270.  
  271.     returns:
  272.      HANDLE= file handle
  273.      IER  =  0   normal return
  274.          1   needs file sharing
  275.          2   file not found
  276.          3   path not found
  277.          4   no handle avail
  278.          5   access denied
  279.          0Ch   invalid acces code
  280.  
  281.  
  282.     CRFILX - Create a new file, or open an existing file and truncate
  283.         it to zero length. This uses the File Handle method.
  284.         The Ier variable should be checked after a call to 
  285.         CrFilx() to be sure a valid Handle has been returned.
  286.  
  287.  
  288.     character*n File
  289.     integer*2   Attrib,Handle,Ier
  290.     call CrFilx(File,Attrib,Handle,Ier)
  291.  
  292.     call with:
  293.      File   = ASCIIZ STRING i.e. 'MyData'//char(0)
  294.      Attrib = 0  normal
  295.             = 1   read only
  296.             = 2   hidden
  297.             = 4   system
  298.     
  299.     returns:
  300.      Handle = file handle
  301.      Ier    = 0   function worked o.k.
  302.           3   path not found
  303.           4   no handles avail
  304.           5   access denied
  305.  
  306.     FAT-DOS 1.0            CLFILX            PAGE B-2
  307.  
  308.  
  309.     CLFILX - Close a previously opened/created file, using
  310.            the File Handle method. The Ier variable should be 
  311.         checked on return to be sure the file closed 
  312.         properly
  313.  
  314.     integer*2 Handle,Ier
  315.     call ClFilx(Handle,Ier)
  316.  
  317.     call with:
  318.     Handle = valid handle returned from OpFilx() or CrFilx().
  319.     
  320.     returns:
  321.     Ier = 0 safe return
  322.           6 invalid handle
  323.  
  324.  
  325.  
  326.     DlFilx - Delete a file, by specifying its name. Check Ier to be
  327.            sure the file was deleted as requested.
  328.  
  329.     character*n File
  330.     integer*2   Ier
  331.     call DlFilx(File,Ier)
  332.     
  333.     call with:
  334.     File = Asciiz string, i.e. 'MYFILE.DAT'//char(0)
  335.         Wildcards * and ? not allowed.
  336.  
  337.     returns:
  338.     Ier  = 0 safe return, function worked.
  339.            2 file not found
  340.            5 access denied
  341.  
  342.  
  343.     RnFilx - Rename a file. Check Ier on return to be sure the
  344.          function worked correctly.
  345.         
  346.     character*n OldFile,NewFile
  347.     integer*2   Ier
  348.     call RnFilx(OldFile,NewFile,Ier)
  349.     
  350.     call with:
  351.     OldFIle = Asciiz string
  352.     NewFile = Asciiz string
  353.     
  354.     returns:
  355.     Ier = 0 function worked.
  356.           2 file not found
  357.           3 path not found
  358.           5 access denied
  359.  
  360.     FAT-DOS 1.0            SCHFIL            PAGE B-3
  361.  
  362.  
  363.  
  364.     SCHFIL - Search for 1st matching file name. If no match is
  365.         found, then Ier is set.
  366.     
  367.     character*n SearchFile,FoundFile
  368.     integer*2   Attrib,Ratt,Rtime,Rdate,Ier
  369.     integer*4   Rsize
  370.     call SchFil(SearchFile,FoundFile,Attrib,
  371.             Ratt,Rtime,Rdate,Rsize,Ier)
  372.  
  373.     call with:
  374.      SEARCHFILE = ASCIIZ STRING
  375.      ATTRIB     = Attribute to use in search.
  376.              normal     0
  377.               read-only    1
  378.               hidden    2
  379.               system    4
  380.  
  381.     returns:
  382.      FOUNDFILE  = ASCIIZ STRING, i.e. 'MyFile.dat'//char(0)
  383.      RATT       = attribute of found file
  384.      RTIME       = file time - use inttim() to convert.
  385.      RDATE      = file date - use intdat() to convert.
  386.      RSIZE      = file size in bytes
  387.      IERR    =  0  function worked
  388.          =  2  invalid path
  389.          =  18 no matching directory entry found
  390.                 
  391.  
  392.  
  393.     SCHFL2 - Search for next file match. If no more entries are found
  394.             Ier is set.
  395.          
  396.     character*n FoundFile
  397.     integer*2   Ratt,Rtime,Rdate,Ier
  398.     integer*4   Rsize
  399.     call SchFl2(FoundFile,Ratt,Rtime,Rdate,Rsize,Ier)
  400.     
  401.     call with: 
  402.     nothing
  403.  
  404.     returns:    
  405.      FOUNDFILE  = ASCIIZ STRING
  406.      RATT       = attribute of found file
  407.      RTIME       = file time
  408.      RDATE      = file date
  409.      RSIZE      = file size in bytes
  410.      IERR    =  0  function worked
  411.          =  18 no matching directory entry found
  412.     NOTE: This function can only be called after 1st calling
  413.           SchFil().
  414.  
  415.     FAT-DOS    1.0            CRTEMP            PAGE B-4
  416.  
  417.  
  418.  
  419.     CrTemp - Create a unique file in the specified path. This file
  420.            must be deleted by the user before exiting, DOS will
  421.         not delete this file for you.
  422.          
  423.          character*n Path
  424.     integer*2   Attrib,Handle,Ier
  425.     call CrTemp(Path,Attrib,Handle,Ier)
  426.     
  427.     call with:
  428.     Path   = Asciiz string with path
  429.                  i.e. disk:\subdirectory//char(0)
  430.          i.e. 'a:\people'//char(0)
  431.     Attrib = attibute of file
  432.          0 - normal
  433.          1 - read only
  434.          2 - hidden
  435.          4 - system
  436.          
  437.     returns:
  438.     Path    = Full file specification
  439.     Handle  = valid file handle
  440.     Ier    = error code
  441.           0 normal
  442.           3 path not found
  443.           5 access denied
  444.  
  445.  
  446.  
  447.     DupHnd - Duplicate a file handle. Ier should be checked for 
  448.         errors, on return. When done with the duplicate handle
  449.         you should discard the duplicate handle using ClFilx().
  450.  
  451.     integer*2 OldHandle,NewHandle,Ier
  452.     call DupHnd(OldHandle,NewHandle,Ier)
  453.  
  454.     call with:
  455.     OldHandle = File handle from previous call to OpFilx(), 
  456.                 or CrFilx().
  457.     
  458.     returns:
  459.     NewHandle = New File Handle, it access's the same file.
  460.     Ier      = error code
  461.             0 normal return
  462.             4 no handle available
  463.             6 invalid old handle, or not an open file handle.
  464.  
  465.     FAT-DOS 1.0            GETFDT            PAGE B-5
  466.  
  467.  
  468.  
  469.     GETFDT - Get file date and time. This returns the time/date  the
  470.             specified file was created. It is in internal format and
  471.         should be converted with intdat(), and inttim().
  472.  
  473.     integer*2 Handle,Date,Time,Ier
  474.     call GetFdt(Handle,Date,Time,Ier)
  475.     
  476.     call with:
  477.     Handle     = File handle from CrFilx(), or OpFilx().
  478.     
  479.     returns:
  480.     Date    = internal date, use intdat() to convert to real date.
  481.     Time    = internal time, use inttim() to convert to real time.
  482.     Ier    = error code, 0 normal
  483.           6 invalid handle
  484.  
  485.  
  486.  
  487.     SETFDT - Set a files date and time of creation values.
  488.     
  489.     integer*2 Handle,Date,Time,Ier
  490.     call SetFdt(Handle,Date,Time,Ier)
  491.     
  492.     call with:
  493.     Handle     = File handle of file to modify
  494.     Date    = Date in internal format, from datint()
  495.     Time    = Time in internal format, from timint()
  496.     
  497.      returns:
  498.      Ier    = error code, 0 normal, 6 Handle invalid 
  499.     
  500.  
  501.     FAT-DOS 1.0            INTDAT            PAGE B-6
  502.  
  503.  
  504.  
  505.     IntDat - Convert internal format Date from GetFdt() to a real date.
  506.     
  507.     integer*2 Date,Yr,Moonth,Day
  508.     call IntDat(Date,Yr,Month,Day)
  509.     
  510.     call with:
  511.     Date    = Date from GetFdt().
  512.     
  513.     returns:
  514.     Yr    = year
  515.     Month    = month
  516.     Day    = day
  517.  
  518.  
  519.     INTTIM - Convert internal Time from GetFdt() to real time.
  520.     
  521.     integer*2 Time,Hrs,Min,Sec
  522.     call IntTim(Time,Hrs,Min,Sec)
  523.     
  524.     call with:
  525.     Time    = Time from GetFdt().
  526.  
  527.     returns:    
  528.     Hrs    = hours.
  529.     Min    = minutes.
  530.     Sec    = seconds.
  531.  
  532.  
  533.     GETFA - Get a Files attributes.
  534.     
  535.     character*n File
  536.     integer*2   Attrib,Ier
  537.     call GetFA(File,Attrib,Ier)
  538.     
  539.     call with:
  540.     File    = Asciiz string of path & filename.
  541.     
  542.     returns:
  543.     Attrib    = files attributes
  544.         =  1 read only
  545.         =  2 system
  546.         =  4 hidden
  547.         = 32 archive
  548.     Ier     = error code
  549.           0-normal
  550.           2-file not found
  551.           3-path not found
  552.           5- attribute cannot be changed
  553.     
  554.     FAT-DOS 1.0            SETFA            PAGE B-7
  555.  
  556.  
  557.     SETFA - Set a Files attributes.
  558.     
  559.     character*n File
  560.     integer*2   Attrib,Ier
  561.     call SetFA(File,Attrib,Ier)
  562.     
  563.     call with:
  564.     File    = Asciiz string of path & filename.
  565.     Attrib    = files attributes
  566.         =  1 read only
  567.         =  2 system
  568.         =  4 hidden
  569.         = 32 archive
  570.             or a combination of the above.
  571.     returns:
  572.     Ier     = error code
  573.           0-normal
  574.           2-file not found
  575.           3-path not found
  576.           5- attribute cannot be changed
  577.  
  578.     MOVPTR - Move an open files pointer. The pointer locates the 
  579.              next byte that is to be read in. This is used to read 
  580.          anywhere in a file.
  581.             
  582.     
  583.     integer*2 Handle,Method,Ier    
  584.     integer*4 Offset
  585.     call MovPtr(Handle,Method,Offset,Ier)
  586.     
  587.     call with:
  588.     Handle    = File handle from OpFilx(), or CrFilx().
  589.     Method    = 0 = offset is relative to start of file
  590.           1 = offset is from current location
  591.           2 = offset is from end of file
  592.         Offset    = number of bytes to move the pointer, based on Method
  593.  
  594.     returns:
  595.     Offset    = absolute number of bytes from start of file to pointer
  596.     Ier    = error code
  597.         = 0-normal
  598.           6-invalid handle or file not open
  599.     
  600.     FAT-DOS 1.0            RRDFILX            PAGE B-9
  601.  
  602.  
  603.     RDFILX - Read from a file or device using the File Handle method. 
  604.              Nbytes returns the actual number of bytes read.
  605.           
  606.  
  607.     integer*2   Handle,Nbytes,Ier
  608.     character*1 Buffer(n) or integer*2 Buffer(n) 
  609.                 or real*4 Buffer(n) etc..
  610.         call RdFilx(Buffer,Nbytes,Handle,Ier)
  611.     
  612.     call with:
  613.     Nbytes    = number of bytes to read
  614.     Handle    = File handle of prevously opened file.
  615.     
  616.     returns:
  617.     Buffer    = data is read into this buffer
  618.     Nbytes    = number of bytes actually read
  619.     Ier    = error code
  620.               0-read worked
  621.           5-access denied
  622.           6-invalid file handle
  623.     
  624.     Note: If Nbytes is greater than 32k, Nbyte should be declared as
  625.           an integer*4 variable. The most data that can be read at 
  626.           one time is 64k.
  627.  
  628.     WTFILX - Write to a prevously opened file usign the File Handle
  629.             method. Nbytes retuns the actual number of bytes
  630.          written, and should be checked after this subroutine call.
  631.  
  632.     integer*2   Handle,Nbytes,Ier
  633.     character*1 Buffer(n) or integer*2 Buffer(n) 
  634.                 or real*4 Buffer(n) etc...
  635.         call WtFilx(Buffer,Nbytes,Handle,Ier)
  636.     
  637.     call with:
  638.     Buffer    = Data to write.
  639.     Nbytes    = Total number of bytes < 64k to write.
  640.     Handle    = Valid File Handle from CrFilx() or OpFilx() or CrTemp().
  641.     
  642.     returns:
  643.     Nbytes    = Total number of bytes written. If 0 and Ier=0, then the
  644.           disk is probably full. If less than Nbytes given on input
  645.           then the disk is probably full.
  646.     Ier    = error code
  647.               0-write worked
  648.           5-access denied
  649.           6-invalid file handle, or file not open
  650.  
  651.     Note: If Nbytes is greater than 32k, Nbyte should be declared as
  652.           an integer*4 variable. The most data that can be written at 
  653.           one time is 64k.
  654.     FAT-DOS 1.0            CHINP            PAGE C-1
  655.  
  656.  
  657.     CHINP - Wait for a keystroke, and don't echo it to the screen. 
  658.            A special key(function and cursor keys) returns a zero. A 
  659.        second call to Chinp() will then return the special key code. 
  660.        Control-C will interrupt this function.
  661.  
  662.     integer*2 Key
  663.     call Chinp(Key)
  664.     
  665.     call with: 
  666.     nothing
  667.     
  668.     returns:
  669.     Key    = ascii character code, or special key code
  670.  
  671.  
  672.  
  673.     UCHINP - Wait for a keystroke, and don't echo it to the screen. 
  674.             A special key(Function and Cursor keys) returns a zero. A 
  675.           second call to UChinp() will then return the special key code. 
  676.         Control-C will not interrupt this function.
  677.  
  678.     integer*2 Key
  679.     call UChinp(Key)
  680.     
  681.     call with:
  682.     nothing
  683.     
  684.     returns:
  685.     Key    = ascii character code, or a special key code.
  686.  
  687.  
  688.  
  689.     CHINWE - Wait for a keystroke, and does echo it to the screen. 
  690.             A special key(function and cursor keys) returns a zero. A 
  691.         second call to Chinwe() will then return the special key code. 
  692.         Control-C will interrupt this function.
  693.  
  694.     integer*2 Key
  695.     call Chinwe(Key)
  696.     
  697.     call with: 
  698.     nothing
  699.     
  700.     returns:
  701.     Key    = ascii character code, or special key code
  702.  
  703.  
  704.     FAT-DOS 1.0            KBDIS            PAGE C-2
  705.  
  706.  
  707.     KBDIS - Check the keyboard for keystrokes.
  708.  
  709.     integer*2 status
  710.     call KbdIs(status)
  711.     
  712.     call with:
  713.     nothing
  714.     
  715.     returns:
  716.     status    =  0  no characters waiting at keyboard
  717.               -1  character waiting at keyboard
  718.  
  719.  
  720.     CLRCON - Clear the keyboard buffer. Removes any characters from 
  721.             the type ahead buffer.
  722.    
  723.        call CLrCon()
  724.     
  725.     call with:
  726.     nothing
  727.     
  728.     returns:
  729.     nothing
  730.  
  731.  
  732.     GETSTR - Read a string from the keyboard(console). This uses the 
  733.             the File Handle method. When calling this function,
  734.         Nbytes should be set to no more than the number of 
  735.         bytes that string is dimensioned for. This function uses 
  736.         RdFilx() with the standard input file handle(0). This
  737.         function can read at most 1 line of input.
  738.    
  739.     integer*2   Nbytes,Ier
  740.     character*n String
  741.     call GetStr(String,Nbytes,Ier)
  742.     
  743.     call with: 
  744.     Nbytes    = maximum number of bytes to read
  745.  
  746.     returns:
  747.     Nbytes    = actual number of bytes read
  748.     Ier    = error code
  749.               0-normal
  750.               5-access denied
  751.           6-console Handle invalid 
  752.     FAT-DOS 1.0            CHOUT            PAGE D-1
  753.  
  754.  
  755.  
  756.     CHOUT - Write a character to the console(screen). This function can
  757.            be interrupted by a control-c press. The backspace code(8) 
  758.        causes the curser to move left one position
  759.  
  760.     integer*2 Kar
  761.     call chout(Kar)
  762.     
  763.     call with:
  764.     Kar     = ascii value of character to display
  765.     
  766.     returns:
  767.     nothing
  768.  
  769.  
  770.  
  771.     PutStr - Write a string to the standard output device. This function
  772.            uses the File Handle function WtFilx(), and uses the 
  773.         Handle for the standard output(1).
  774.    
  775.     integer*2 Nbytes,Ier
  776.     character*n STRING
  777.     call PutStr(String,Nbytes,Ier)
  778.     
  779.     call with:
  780.     String     = character string to display.
  781.     Nbytes    = number of characters to display
  782.     
  783.     returns:
  784.     Nbytes    = number of bytes actually displayed
  785.     Ier    = error code
  786.               0-normal return
  787.           5-access denied
  788.           6-console handle invalid
  789.  
  790.     FAT-DOS 1.0            DSKRST            PAGE E-1
  791.  
  792.  
  793.  
  794.     DSKRST -This function resets the disk drive, and flushes or finishes
  795.            writing any data held in buffers.
  796.  
  797.     call DskRst()
  798.     
  799.     call with:
  800.     nothing
  801.  
  802.     returns:
  803.     nothing
  804.  
  805.  
  806.  
  807.     SETDD - This function sets the current default disk drive. This 
  808.            should not be confused with SetDir(), which sets the default 
  809.        subdirectory. The number of logical drives in the system
  810.        is also returned. 
  811.  
  812.     integer*2 Drive,NumDrives
  813.     call SetDD(Drive,NumDrives)
  814.     
  815.     call with:
  816.     Drive    = Logical drive number
  817.               1-A
  818.           2-B
  819.           3-C
  820.           4-D
  821.           5-E
  822.     returns:
  823.     NumDrives= number of logical drives in the system.          
  824.  
  825.  
  826.  
  827.     GETDD - This function gets the default disk drive.
  828.    
  829.     integer*2 Drive
  830.     call GetDD(Drive)
  831.     
  832.     call with:
  833.     nothing
  834.     
  835.     returns:
  836.     Drive    = default disk drive number.
  837.               1-A
  838.           2-B
  839.           3-C
  840.           4-D
  841.           5-E
  842.     FAT-DOS 1.0            GETAID            PAGE E-2
  843.  
  844.  
  845.     GETAID - Get disk allocation information for the specified disk.
  846.    
  847.        integer*2 Drive,SecPerClu,FATIB,SizeofSec,NumClu
  848.     call GetAID(Drive,SecPerClu,FATIB,SizeofSec,NumClu)
  849.     
  850.     call with:
  851.     Drive    = desired drive number.
  852.           0-default
  853.           1-A,2-B,3-C,4-D,5-E
  854.     returns:
  855.     SecPerClu= Sectors per cluster
  856.     FATIB     = FAT Information Byte
  857.            0FDh - dual sided 9 sectors per track,PC/XT
  858.            0F9h - dual sided 15 sectors per track, PC/AT
  859.            0F8h - Fixed disk (any size)
  860.         SizeofSec= Size of physical sector in bytes
  861.     NumClu    =  Number of clusters on drive
  862.           
  863.  
  864.  
  865.     SETVF - Set the verify flag on or off. This causes any disk writes 
  866.            to be verified. This slows down disk I/O but provides some
  867.        security that disk writes are in fact working alright.
  868.        
  869.     integer*2 Value
  870.     call SetVF(Value)
  871.     
  872.     call with:
  873.     Value    = 0 Turn off disk write verification.
  874.               1 Turn on disk write verification.
  875.           
  876.     returns:
  877.     nothing
  878.  
  879.  
  880.  
  881.     GETVF - Get the disk write verify flag. This returns the disk 
  882.        write verification flag.
  883.        
  884.     integer*2 Value
  885.     call GetVF(Value)
  886.     
  887.     call with:
  888.     nothing
  889.  
  890.     returns:
  891.     Value    = 0 Disk write verification is OFF.
  892.               1 Disk write verification is ON.
  893.  
  894.     FAT-DOS 1.0            GETDS            PAGE E-3
  895.  
  896.  
  897.     GETFDS - This function returns the free disk space. 
  898.    
  899.     integer*2 Drive,SecPerClu,NumAvailClu
  900.               BytesPerSec,CluPerDrive,Ier
  901.     call GetFDS(Drive,SecPerClu,NumAvailClu,
  902.                 BytesPerSec,CluPerDrive,Ier)
  903.     
  904.     call with:
  905.     Drive       = Drive number to get info on.
  906.                  0-Default
  907.              1-A,2-B,3-C,4-D,5-E
  908.     returns:
  909.     SecPerClu  = Number of sectors per cluster
  910.     NumAvailClu= Number of free clusters
  911.     BytesPerSec= Number of bytes per sector
  912.     CluPerDrive= Number of Clusters per drive
  913.     Ier       = error code
  914.                  0-safe return
  915.              Non-zero - invalid drive number requested
  916.  
  917.     Free Disk Space= SecPerClu*NumAvailClu*BytesPerSec
  918.  
  919.  
  920.     SETDTA - This function designates a new Disk Transfer Area(DTA),
  921.             to be used by the disk drive when doing I/O. There is 
  922.         a default DTA for each program. If you don't know how to
  923.         make use of this function, don't use it. The DTA should be
  924.         at least a 128 byte work area.
  925.         
  926.     integer*4 LDTA,Space(32)
  927.     call SetDTA(LOC(Space)) 
  928.     or
  929.     LDTA = LOC(Space)
  930.     call SetDTA(LDTA)
  931.  
  932.     call with:
  933.     LDTA    = Location of the Disk Transfer Area you wish used.
  934.  
  935.     returns:
  936.     nothing
  937.  
  938.  
  939.     GETDTA - This function returns the address of the DTA. This is 
  940.             equivalent to the LDTA variable passed to SetDTA(), and may  
  941.         be passed to SetDTA(), if desired.
  942.         
  943.     integer*4 LDTA
  944.     call GetDTA(LDTA)
  945.     
  946.     call with:
  947.     nothing
  948.     
  949.     returns:
  950.     LDTA = Address of the current DTA.
  951.