In order for this site to work correctly, and for us to improve the site, we need to store a small file (called a cookie) on your computer.
By continuing to use this website, you agree to our cookies and privacy policy.
  
Home page Home page Home page Home page
Pixel
Pixel Header R1 C1 Pixel
Pixel Header R2 C1 Pixel
Pixel Header R3 C1 Pixel
Pixel

DOS Interfacing (Part I)

The system contains many commands which can be used both to query the DOS environment for information and to interface with it. In this, the first article of a two part series, we consider those AREV routines which can be used to query the environment. NB V124 is not documented here as it is a higher level subroutine. If wanted this routine (an assembler routine to manipulate the serial port) can be addressed in a later issue.

DIR

Internal function that returns a dynamic array with three parts, part 1 the file size in bytes, part 2 the date in internal format and part 3 the time in internal format. Usage is x = DIR(Filename) where Filename includes the path.

DIRLIST

Internal function. When there is a requirement to process the DOS files on a drive. INITDIR is used to establish the file spec to use and then DIRLIST() returns filenames matching the spec in blocks of approximately 1160 bytes, with the names @FM delimited. DIRLIST should be used in a loop, looping until DIRLIST returns null. Calling syntax x = DIRLIST().

DISKSIZE

Younger brother of DSPACE (q.v.). Function with one passed parameter (the drive letter). Returns a dynamic array with two values, the first the disk size, the second the bytes free. Calling syntax INFO = DISKSIZE("C").

DOSTIME

Subroutine with one passed parameter. Returns clock time in eighteenths of a second. Calling syntax CALL DOSTIME.

DSPACE

Subroutine with six passed parameters . Given the drive id (A) it returns the free space (B) , the amount of free clusters (C), the sectors per cluster (D), the bytes per sector (E) and the total number of clusters (F). Calling syntax CALL DSPACE(A,B,C,D,E,F)

INITDIR

Internal statement that initialises a filter to apply to subsequent DIRLISTs. Any valid DOS drive spec/file wildcards can be used. Calling syntax INITDIR (Filespec)

MEMSPACE

Function with one passed parameter. MEMSPACE will perform various garbagecollects and flushes to free up the amount of memory you requested in the passed parameter. The amount of memory freed up will be returned as the result of the function. It is used to call MEMSPACE with a very large number (E.g. 999999) as this will then clear up ALL available string space and report back how much is available. Your routine can then decide if there is enough memory to proceed. The less usual method of calling MEMSPACE with the amount of memory required is used where speed is absolutely critical and extra flushes are to be avoided. After declaring as a function, calling syntax is FREE.SPACE = MEMSPACE(x)

MONITOR

Subroutine with one passed parameter. Returns a code of 3 for a colour monitor, all other codes probably meaning mono. Calling syntax CALL MONITOR(X)

PRNSTAT

Subroutine with one passed parameter. Checks the parallel port and returns a code indicating port status. Useful for avoiding "Abort Retry Ignore" messages. Code of 0 means printer OK, 1 No Printer, 2 Paper Out, 3 Printer Off Line. Calling syntax CALL PRNSTAT(X).

(Volume 1, Issue 4, Pages 4,9)
Pixel
Pixel Footer R1 C1 Pixel
Pixel
Pixel
Pixel