I ************************************************************************* G **
NO Claim of "full accuracy" nor "liability" to the following - thisG  is as
much "public" info as I have currently -- For the "guy, who wan D ts or needs
to know"	B.E.
****************************************G ***********************************
SUBJ:  MS-DOS Disk I/O control fun E ction

The  following document describes the disk interfaces for do G ing direct  disk
I/O.  The hard disk may be accessed by  the  normal  UG MS-DOS  IOCTL  function
calls.   The floppy disk interface is differen_G t depending upon which version
of MS-DOS you are using (V2.01 vs.  V2. > 05).


Hard Disk IOCTL function 44H (INT 21H):

	AH = 44H; 

	AL = function code; must = 4 or 5

	BL = Drive
		(0 E  = Default, 1 = A, 2 = B, etc.)
		(Drive E, F, G, H are for the Hard 8  Disk)

	DS:DX = Block pointer



	BLOCK+0		DB	Fun: ction code
			0 - Read sector
			1 - Write sector
			2 ? - Write sector with verify
			3 - Format track
			4 - Media c< heck
			5 - Verify disk

	BLOCK+1		DB	MS-DOS drive code oB r FF if physical unit
				(0 = drive A, 1 = B, etc. **Note 1**)
? 	BLOCK+2		DB	Sector number (**Note 2**)
	BLOCK+3		DB	Unit numbg= er in high nybble
				Head number in low nybble
				Ignored>  if drive code .NE. FF

	BLOCK+4		DW	Track number
	BLOCK+6	> 	DW	Sector count
	BLOCK+8		DW	Offset of user buffer
	BLOCK+1B 0	DW	Segment of user buffer
	BLOCK+12	DW	Returned data (**Hard di= sk only**)
				Error code returned by driver,
				else 00 i? f successfully.


NOTE 1:

Drive  code in BL is different G from Drive code in BLOCK+1.  Drive code in BL
is to direct the MS-DOS G BDOS to the appropriate disk driver.  Drive code  in
BLOCK+1 is the acB tual drive code that will be used.

NOTE 2:
	Logical operation G (if drive code not equal to 0FFH)
1. first track number is offset relaEG tive to the partition
2. first sector number will be converted in skewE  table
3. multi-sector read/write uses the skew table
4. items 2 anZD d 3 are not applied to the first 2 tracks
   on each partitiosk:

D 
    RECOVER <drive-letter>:

    This will cause a scan to be madG e of the drive's  FAT  for
    chains of  allocation units (files).  AG  new root directory
    is then written that has entries  of  the  forG m  FILEnnnn.
    Each  FILEnnnn  will  point  to  the  head  of  one o~C f the
    allocation unit chains.

    If there are more chains 2G than  directory  entries  in  the
    root, RECOVER prints a message aG nd leaves the un-RECOVERED
    chains in the FAT so that RECOVER can bB e  run  again  once
    some room has been made in the ROOT.

= 


DEBUG ON MS-DOS 2.0


    When 2.0 DEBUG is invoked G it  sets  up  a  program  header
atoffset 0  in its program work area.G   On previous versions it
was OK to overwrite this header with impunitG y:  this  is  true
of  the  default  header  set  up if no <filespec> <G is given to
DEBUG.  If DEBUGging a .COM or .EXE file, however, you mus F t be
careful  not  to  tamper  with the header of the program below
G address 5CH, to do this will probably result in a  crash.   It
is  alsG o  important that an attempt is not made to "restart" a
program once t#G he  "program  terminated  normally"  message  is
given.  The program mG ust be reloaded with the N and L commands
in order for it to run prope= rly.

NEW FEATURES

The A (Assemble) Command

FORMAT:  E   A [<address>]

PURPOSE:   To assemble 8086/8087/8088 mnemonics diC rectly into
           memory.

o   If a syntax error is encountA ered, DEBUG responds with

               ^ Error

    and reNE displays the current assembly address.

o   All numeric  values  ar7C e  hexadecimal  and  may be entered
    as 1-4 characters.

o   G Prefix mnemonics must be entered in front  of  the  opcode
    to  whinG ch  they  refer.   They  may  also  be entered on a
    separate line.D 

o   The segment override mnemonics  are  CS:,  DS:,  ES:,  and
E     SS:

o   String manipulation  mnemonics  must  explictly  stateF  the
    string size.  For example,  the  MOVSW  must  be  used  to
I     move word  strings  and  MOVSB  must;; The following is a tiny PrologG  interpreter in MacLisp
;; written by Ken Kahn and modified for XLISP G by David Betz.
;; It was inspired by other tiny Lisp-based Prologs of

F 
;; Par Emanuelson and Martin Nilsson.
;; There are no side-effects aF nywhere in the implementation.
;; Though it is VERY slow of course.
E 
(defun prolog (database / goal) ;; a top-level loop for Prolog
  (G while (setq goal (read))
    (prove (list (rename-variables goal '(0))C )
           '((bottom-of-environment))
           database
    ^E        1)))

(defun prove (list-of-goals environment database levelE )
  ;; proves the conjunction of the list-of-goals
  ;; in the curr9E ent environment
  (cond ((null list-of-goals)
         ;; succeededG  since there are no goals
         (print-bindings environment environE ment)
          ;; the user answers "y" or "n" to "More?"
         E (! (y-or-n-p "More?")))
        (t (try-each database database
    G                  (tail list-of-goals) (head list-of-goals)
           E           environment level))))

(defun try-each (database-left datG abase goals-left goal environment level
                 / assertion nE ew-enviroment)
 (cond ((null database-left)
        ()) ;; fail sin E ce nothing left in database
       (t (setq assertion
             G     ;; level is used to uniquely rename variables
                (renG ame-variables (head database-left)
                                   E (list level)))
          (setq new-environment
                (uniG fy goal (head assertion) environment))
          (cond ((null new-envi?G ronment) ;; failed to unify
                 (try-each (tail database-RE left) database
                           goals-left goal
         G                   environment level))
                ((prove (append ;F (tail assertion) goals-left)
                        new-environment
F 
                        database
                        (+ 1 level)E ))
                (t (try-each (tail database-left) database
     ;                         goals-left goal
                  6