FreeDOS APPEND 1.0
==================

(c) Aitor SANTAMARIA MERINO  (aitorsm@inicia.es)
    For the FreeDOS project
    Under the GNU GPL 2.0



APPEND allows applications to open files in alternative paths as if they were
in current PATH. Alternatively, the same functionality may be additionally
activated for the application execution and file searching procedures with the
/X switch.

Refer to the help file, and to APPEND /? for the concrete syntax.

APPEND occupies 1.2KB of resident memory. It is not recommended at all that you
use APPEND under multitasking environments or DOS extenders (such as Microsoft
Windows).

APPEND has been newly created (18th of May, 2004) and possibly has bugs. Please
report them to my email address  

	aitorsm@inicia.es


EXPERIENCED USERS
=================

For the experienced user, APPEND hooks the int 21h vector, services 3Dh (file
handle open), and alternatively 4Eh (File handle find first) and 4Bh (EXEC)
with the /X switch.

There haven't been implemented:
- FCB capabilities (functions 0Fh, 23h, and for /X also 11h)
- the /E switch to notify the append path in the commandline
- the API function AL=11h

To compile APPEND, you need NASM and a linker (I have used ALINK). FD-APPEND is
packed with UPX.


A NOTE ABOUT THE API
====================

For the programmers that wish to use the API, notice that this version of
APPEND reports itself as 1.0 (non-existing in MS-APPEND), due to the fact that
the FCB functions have not been implemented.

The following is a small guide where I have collected the presence of the API
functions on MS-APPEND/FD-APPEND. 

Remember that APPEND's MUX code is AH=B7h.

Before listing the functions, remember the status flags (from RBIL):

Bit(s)  Description     (Table 02980)
-------------------------------------
0      set if APPEND enabled
1-11   reserved
12     (DOS 5.0) set if APPEND applies directory search even if a drive has been specified
13     set if /PATH flag active
14     set if /E flag active (environment var APPEND exists)
15     set if /X flag active


FUNCTION AL=00h - Installation check
------------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 3.2+

OUT:
  AL=FFh


FUNCTION AL=01h/04h - Get APPEND path
-------------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 3.21  (01h)
  MS-APPEND 3.30+ (04h)

OUT:
  ES:DI-> active APPEND path

NOTES:
  AL=01h only present in MS-APPEND 3.21, AL=04h in 3.3+

FUNCTION AL=02h - Dummy (Get version info)
------------------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 3.2+

OUT:
  AX=FFFFh

NOTES:
  AX=version if MS-APPEND 4.0


FUNCTION AL=03h - Hook int 21h
------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 3.3, 5.0+

IN:
  ES:DI-> INT 21h handler APPEND should chain to

OUT:
  ES:DI-> APPEND's int21h handler


FUNCTION AL=06h - Get APPEND status
-----------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 4.0+

OUT:
  BX: status flags


FUNCTION AL=07h - Set APPEND status
-----------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 4.0+

IN:
  BX: status flags


FUNCTION AL=10h - Get version info
----------------------------------
Versions:
  FD-APPEND 1.0+
  MS-APPEND 3.2+

OUT:
  AX: status flags
  BX=0
  CX=0
  DX=Version

NOTES:
  BX,CX contents unknown in MS-APPEND 4.0


FUNCTION AL=11h - Return found name state
-----------------------------------------
Versions:
  FD-APPEND: NOT PRESENT
  MS-APPEND: 4.0+

Note: If the next INT 21h call (and ONLY the next) is 
function 3Dh, 43h, or 6Ch (also 4B03h and 4Eh if /X active), 
the fully qualified filename is written over top of the filename 
passed to the INT 21h call. The application must provide a 
sufficiently large buffer. This state is reset after the next 
INT 21h call processed by APPEND.. APPEND uses the byte at offset 
3Dh in the PSP (see #01378 at INT 21/AH=26h) to store the flag 
telling it to overwrite the filename 







