home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / dos_ency / readme.doc
Encoding:
Text File  |  1988-08-11  |  19.7 KB  |  517 lines

  1.                    Programmer's Library 
  2.           The MS-DOS Encyclopedia Companion Disks
  3.                   (c)1988 Microsoft Press
  4.  
  5.  
  6.      This directory contains listings for the programs and
  7. examples in the following sections of the MS-DOS Encyclopedia:
  8.  
  9.   Disk 1:
  10.      Section II (Programming for MS-DOS)
  11.                 Articles 2 through 17
  12.  
  13.   Disk 2:
  14.      Section II (Programming for MS-DOS)
  15.                 Articles 18 and 19
  16.      Section V  (System Calls)
  17.      Appendix A (MS-DOS Version 3.3)
  18.      Appendix L (Intel Hexadecimal Object File Format)
  19.      Appendix N (An Object Module Dump Utility)
  20.  
  21.      The listings are organized into separate directories.
  22. The code for the programs and examples in Section II is
  23. organized into directories that correspond to the article
  24. number. For example, the code for Article 4, Structure of
  25. an Application Program, is in the \4 subdirectory; the code
  26. for Section V, System Calls, is in the \SECTION5 subdirectory,
  27. and the code for the three appendixes is in the \APP-A,
  28. \APP-L, and \APP-N directories.
  29.  
  30.      The name and description of each file on the companion
  31. disks is listed below in the order in which the code appears
  32. in The MS-DOS Encyclopedia.
  33.  
  34.      If you have any questions about the files on these
  35. disks, you can send your written queries or comments to:
  36.           Microsoft Press
  37.           Attn: MS-DOS Encyclopedia
  38.           16011 NE 36th Way
  39.           Box 97017
  40.           Redmond, WA  98073-9717
  41.  
  42.           or to MICROSOFT PRESS on MCI Mail.
  43.  
  44.      Unfortunately, we are not able to answer phone queries.
  45.  
  46.  
  47.  
  48.  
  49.                     -+- THE LISTINGS -+-
  50.                          (Disk #1)
  51.  
  52. Subdirectory \2    The Components of MS-DOS
  53.  
  54.    SHELL.ASM:   A simple program to run an application as an
  55.                 MS-DOS shell.
  56.  
  57.  
  58.  
  59. Subdirectory \4    Structure of an Application Program
  60.  
  61.   FIG4-3.ASM:   Skeleton program demonstrating proper
  62.                 termination under any MS-DOS version.
  63.   FIG4-4.ASM:   Example using RET to return to MS-DOS.
  64.   FIG4-8.ASM:   Source module MODULE_A that demonstrates
  65.                 .EXE program structuring.
  66.   FIG4-9.ASM:   Source module MODULE_B that demonstrates
  67.                 .EXE program structuring.
  68.  FIG4-10.ASM:   Source module MODULE_C that demonstrates
  69.                 .EXE program structuring.
  70.  FIG4-15.ASM:   Sample .COM program COMPROG1.ASM that
  71.                 declares only a single segment.
  72.  FIG4-16.ASM:   Sample .COM program COMPROG2.ASM that
  73.                 declares multiple segments.
  74.  
  75.  
  76.  
  77. Subdirectory \5    Character Device Input and Output
  78.  
  79.   INT16H.ASM:   Example using INT 16H to read a character
  80.                 from the keyboard.
  81.   FXN08H.ASM:   Example using INT 21H Fxn 08H to read a
  82.                 character from the keyboard.
  83.   FXN0AH.ASM:   Example using INT 21H Fxn 0AH to read a line
  84.                 from the keyboard.
  85.   FXN3FH.ASM:   Example using INT 21H Fxn 3FH to read a line
  86.                 from the keyboard.
  87.   INT10H.ASM:   Example using INT 10H to write an asterisk
  88.                 character to the display in text mode.
  89.   FXN02H.ASM:   Example using INT 21H Fxn 02H to write an
  90.                 asterisk character to the display.
  91.   FXN09H.ASM:   Example using INT 21H Fxn 09H to write a
  92.                 string to the display.
  93. FXN40H-1.ASM:   Example using INT 21H Fxn 40H to write a
  94.                 string to standard output.
  95.   INT14H.ASM:   Example using INT 14H to write a string to
  96.                 COM1.
  97.   FXN04H.ASM:   Example using INT 21H Fxn 04H to write a
  98.                 string to COM1.
  99. FXN40H-2.ASM:   Example using INT 21H Fxn 40H to write a
  100.                 string to COM1.
  101.   INT17H.ASM:   Example using INT 17H to send a string to
  102.                 LPT1.
  103.   FXN05H.ASM:   Example using INT 21H Fxn 05H to send a
  104.                 string to LPT1.
  105. FXN40H-3.ASM:   Example using INT 21H Fxn 40H to send a
  106.                 string to the system list device.
  107.  IOCTL-1.ASM:   Example using IOCTL Subfxn 00H to obtain the
  108.                 device information word for standard input.
  109.  IOCTL-2.ASM:   Example using IOCTL Subfxn 06H to test
  110.                 whether a character is ready for input on
  111.                 COM1.
  112.  
  113.  
  114.  
  115.  
  116. Subdirectory \6    Interrupt-Driven Communications
  117.  
  118. ENGINE-1.ASM:   Example demonstrating an incomplete (and
  119.                 unworkable) implementation of a modem
  120.                 engine.
  121. ENGINE-2.ASM:   Example demonstrating an improved (but still
  122.                 unworkable) implementation of a modem
  123.                 engine.
  124.     UART.ASM:   Example demonstrating UART startup
  125.                 programming.
  126.   COMDVR.ASM:   Communications port device-driver program.
  127.   ENGINE.ASM:   Modem engine program.
  128.     CDVUTL.C:   Driver-status utility program that permits
  129.                 either of the two drivers (ASY1 and ASY2) to
  130.                 be reconfigured after installation.
  131.      CH1.ASM:   Support program for CTERM.C terminal
  132.                 emulator program.
  133.     CH1A.ASM:   Support program for CTERM.C terminal
  134.                 emulator program.
  135.      CH2.ASM:   Support program for CTERM.C terminal
  136.                 emulator program.
  137.      CTERM.C:   Terminal emulation program.
  138.  
  139.  
  140.  
  141. Subdirectory \7    File and Record Management
  142.  
  143.   FXN3CH.ASM:   Example using INT 21H Fxn 3CH to create the
  144.                 file MEMO.TXT in C:\LETTERS.
  145.   FXN5AH.ASM:   Example using INT 21H Fxn 5AH to create a
  146.                 temporary file in C:\TEMP.
  147.  CMDTAIL.ASM:   Example that copies the first parameter from
  148.                 the program's command tail in the PSP, then
  149.                 appends a null character to form an ASCIIZ
  150.                 string.
  151.   MYFILE.ASM:   Example that opens the file MYFILE.DAT,
  152.                 creates the file MYFILE.BAK, copies the
  153.                 contents of the .DAT file into the .BAK
  154.                 file, then closes both files.
  155. POINTER1.ASM:   Example that positions the file pointer
  156.                 32768 bytes from the beginning of
  157.                 MYFILE.DAT, then reads 512 bytes of data.
  158. POINTER2.ASM:   Example that finds the size in bytes of
  159.                 MYFILE.DAT by positioning the file pointer
  160.                 to zero bytes relative to the end of the
  161.                 file.
  162.   FXN56H.ASM:   Example using INT 21H Fxn 56H to rename
  163.                 \WORK\MYFILE.DAT to \BACKUP\MYFILE.OLD.
  164.   FXN41H.ASM:   Example using INT 21H Fxn 41H to delete the
  165.                 file \WORK\MYFILE.DAT.
  166.   FXN43H.ASM:   Example using INT 21H Fxn 43H to change the
  167.                 attributes of \BACKUP\MYFILE.DAT to read-
  168.                 only.
  169.   FXN45H.ASM:   Example using INT 21H Fxn 45H to duplicate
  170.                 the handle for the previously opened file
  171.                 MYFILE.DAT, then using INT 21H Fxn 3EH to
  172.                 close the duplicate handle and update the
  173.                 file.
  174. OPENFILE.ASM:   Example that displays a prompt, accepts a
  175.                 filename from the user, parses the filename
  176.                 into an FCB, checks for an illegal drive
  177.                 letter or wildcards, attempts to open the
  178.                 file, and creates it if it doesn't exist.
  179.  
  180. COPYFILE.ASM:   Example that opens the file MYFILE.DAT,
  181.                 creates the file MYFILE.BAK, copies the
  182.                 contents of the .DAT file into the .BAK
  183.                 file, then closes both files.
  184.   FXN17H.ASM:   Example using INT 21H Fxn 17H to rename all
  185.                 files with a .ASM extension to have the
  186.                 extension .COD.
  187.   FXN13H.ASM:   Example using INT 21H Fxn 13H to delete all
  188.                 files whose filenames have A as the first
  189.                 character and a .BAK extension.
  190.  
  191.  
  192.  
  193. Subdirectory \8    Disk Directories and Volume Labels
  194.  
  195.     DIRS.ASM:   Program that uses INT 21H Fxns 4EH and 4FH
  196.                 to provide search subroutines for DIRDUMP.C.
  197.    DIRDUMP.C:   Program that lists the attributes associated
  198.                 with each entry in the current directory.
  199.     VOLS.ASM:   Program containing C-callable subroutines
  200.                 for manipulating volume labels.
  201.  
  202.  
  203.  
  204. Subdirectory \9    Memory Management
  205.  
  206.   FIG9-2.ASM:   Example using INT 21H Fxn 4AH to demonstrate
  207.                 how a .COM program can release extra memory
  208.                 after receiving control from MS-DOS.
  209.   FIG9-3.ASM:   Example using INT 21H Fxn 4AH to demonstrate
  210.                 how a .EXE program can release extra memory
  211.                 after receiving control from MS-DOS.
  212.   FIG9-4.ASM:   Example demonstrating dynamic memory
  213.                 allocation.
  214.   FIG9-6.ASM:   Example using INT 21H Fxns 3DH and 44H to
  215.                 test for the presence of the Expanded Memory
  216.                 Manager.
  217.   FIG9-7.ASM:   Example that tests for the presence of the
  218.                 Expanded Memory Manager by inspecting the
  219.                 name field of the device driver header.
  220.   FIG9-8.ASM:   Example demonstrating the use of expanded
  221.                 memory.
  222.  
  223.  
  224.  
  225. Subdirectory \10   The MS-DOS EXEC Function
  226.  
  227.   PARENT.ASM:   Program that loads and executes CHILD.EXE.
  228.    CHILD.ASM:   Program loaded and executed by PARENT.EXE.
  229.     ROOT.ASM:   Program that loads the overlay OVERLAY.OVL,
  230.                 calls a routine within OVERLAY, then
  231.                 recovers control and terminates.
  232.  OVERLAY.ASM:   Overlay loaded by ROOT.EXE.
  233.  
  234.  
  235.  
  236. Subdirectory \11   Terminate-and-Stay-Resident Utilities
  237.  
  238.  INDOS-1.ASM:   Example that scans the MS-DOS segment for
  239.                 the InDOS flag in MS-DOS versions 3.1 and
  240.                 later.
  241.  INDOS-2.ASM:   Example that scans the MS-DOS segment for
  242.                 the InDOS flag in MS-DOS versions earlier
  243.                 than 3.1.
  244.    HELLO.ASM:   Passive TSR program that displays a message
  245.                 when INT 64H is executed.
  246.  
  247.     SNAP.ASM:   Active TSR program that dumps the current
  248.                 contents of the video buffer to a disk file
  249.                 when Alt-Enter is pressed.
  250.  
  251.  
  252.  
  253. Subdirectory \12   Exception Handlers
  254.  
  255.  SET_INT.ASM:   Example that sets the INT 23H and INT 1BH
  256.                 vectors to point to an IRET instruction.
  257. REST_INT.ASM:   Example that restores the original contents
  258.                 of the INT 23H and INT 1BH vectors set by
  259.                 the previous example.
  260.    INT24.ASM:   Replacement INT 24H critical error handler.
  261. FXN59H-1.ASM:   Example using INT 21H Fxn 59H to obtain more
  262.                 detailed error information under MS-DOS
  263.                 versions 3.0 and later.
  264. FXN59H-2.ASM:   Example using INT 21H Fxn 59H to test the
  265.                 contents of BL as a guide to the appropriate
  266.                 error-handling action to take.
  267.  
  268.  
  269.  
  270. Subdirectory \13   Hardware Interrupt Handlers
  271.  
  272.  DIVZERO.ASM:   Replacement divide-by-zero handler for use
  273.                 with 80286 and 80386 microprocessors.
  274.   INT08H.ASM:   Example replacement INT 08H handler that
  275.                 increments an internal flag at each timer
  276.                 tick.
  277.   MYINT8.ASM:   Example replacement INT 08H handler that
  278.                 implements and tests a semaphore to prevent
  279.                 nested interrupts.
  280.  
  281.  
  282.  
  283. Subdirectory \14   Writing MS-DOS Filters
  284.  
  285.   PROTOC.ASM:   Template character-oriented filter program.
  286.     PROTOC.C:   Template character-oriented filter program.
  287.   PROTOL.ASM:   Template line-oriented filter program.
  288.     PROTOL.C:   Template line-oriented filter program.
  289.       LC.ASM:   Character-oriented filter that translates
  290.                 uppercase letters to lowercase letters.
  291.         LC.C:   Character-oriented filter that translates
  292.                 uppercase letters to lowercase letters.
  293.       FIND.C:   Filter that searches the input stream for
  294.                 lines containing the pattern specified in
  295.                 the command line.
  296. EXECSORT.ASM:   Program demonstrating the use of the MS-DOS
  297.                 SORT filter as a child process.
  298.  
  299.  
  300.  
  301. Subdirectory \15   Installable Device Drivers
  302.  
  303. TEMPLATE.ASM:   Skeleton character-device driver that
  304.                 demonstrates all the essential driver
  305.                 components.
  306. TINYDISK.ASM:   Source code for a 64 KB virtual disk
  307.                 (RAMdisk).
  308.  
  309.  
  310.  
  311. Subdirectory \17   Windows
  312.  
  313.     SAMPLE.C:   Source code for the SAMPLE program.
  314.    SAMPLE.RC:   Resource script for the SAMPLE program.
  315.     SAMPLE.H:   Header file for the SAMPLE program.
  316.   SAMPLE.DEF:   Module-definition file for the SAMPLE
  317.                 program.
  318.   SAMPLE.MAK:   Make file for the SAMPLE program.
  319.  
  320.  
  321.  
  322.                     -+- THE LISTINGS -+-
  323.                          (Disk #2)
  324.  
  325. Subdirectory \18
  326.  
  327.     EXP1.BAS:   INCORRECT version of a program to calculate
  328.                 EXP(x) to a specified precision using an
  329.                 infinite series.
  330.     EXP2.BAS:   Corrected version of EXP1.BAS.
  331. COMMSCOP.ASM:   Program to monitor activity on a specified
  332.                 COM port, placing a copy of all transacted
  333.                 data in a RAM buffer.
  334.   COMMSCMD.C:   C program to control the COMMSCOP program.
  335. COMMSCMD.BAS:   QB program to control the COMMSCOP program.
  336. COMMDUMP.BAS:   Program that produces a formatted dump of
  337.                 the communication trace buffer.
  338. TESTCOM1.ASM:   INCORRECT version of a program that provides
  339.                 data to the COMMSCOP program.
  340. TESTCOM2.ASM:   Corrected version of TESTCOM1.ASM.
  341.  BADSCOP.ASM:   INCORRECT version of COMMSCOP.ASM.
  342.   UPERCAS1.C:   INCORRECT version of a program that converts
  343.                 a fixed string to uppercase and prints it.
  344.   UPERCAS2.C:   Corrected version of UPERCAS1.C.
  345.    ASCTBL1.C:   INCORRECT version of a program that displays
  346.                 a table of all displayable characters.
  347.    ASCTBL2.C:   Corrected version of ASCTABL1.C.
  348.  
  349.  
  350.  
  351. Subdirectory \19   Object Modules
  352.  
  353.    HELLO.ASM:   Program that displays a short message. (Used
  354.                 to demonstrate object records within an
  355.                 object module.)
  356.  
  357.  
  358.  
  359. Subdirectory \SECTION5     System Calls
  360.  
  361. CMACROSX.INC:   Supplemental macros for two macros included
  362.                 in CMACROS.INC.
  363.     TEST.ASM:   Program that demonstrates the use of Cmacros
  364.                 in assembly-language.
  365.     TESTCM.C:   Simple C program that calls the function in
  366.                 the previous example.
  367.   FXN01H.ASM:   Character Input with Echo
  368.   FXN02H.ASM:   Character Output
  369.   FXN03H.ASM:   Auxiliary Input
  370.   FXN04H.ASM:   Auxiliary Output
  371.   FXN05H.ASM:   Print Character
  372.   FXN06H.ASM:   Direct Console I/O
  373.   FXN07H.ASM:   Unfiltered Character Input Without Echo
  374.   FXN08H.ASM:   Character Input Without Echo
  375.   FXN09H.ASM:   Display String
  376.   FXN0AH.ASM:   Buffered Keyboard Input
  377.   FXN0BH.ASM:   Check Keyboard Status
  378.   FXN0CH.ASM:   Flush Buffer, Read Keyboard
  379.   FXN0DH.ASM:   Disk Reset
  380.   FXN0EH.ASM:   Select Disk
  381.   FXN0FH.ASM:   Open File with FCB
  382.   FXN10H.ASM:   Close File with FCB
  383.   FXN11H.ASM:   Find First File
  384.   FXN12H.ASM:   Find Next File
  385.   FXN13H.ASM:   Delete File
  386.   FXN14H.ASM:   Sequential Read
  387.   FXN15H.ASM:   Sequential Write
  388.  
  389.   FXN16H.ASM:   Create File with FCB
  390.   FXN17H.ASM:   Rename File
  391.   FXN19H.ASM:   Get Current Disk
  392.   FXN1AH.ASM:   Set DTA Address
  393.   FXN1CH.ASM:   Get Drive Data
  394.   FXN21H.ASM:   Random Read
  395.   FXN22H.ASM:   Random Write
  396.   FXN23H.ASM:   Get File Size
  397.   FXN24H.ASM:   Set Relative Record
  398.   FXN25H.ASM:   Set Interrupt Vector
  399.   FXN26H.ASM:   Create New Program Segment Prefix
  400.   FXN27H.ASM:   Random Block Read
  401.   FXN28H.ASM:   Random Block Write
  402.   FXN29H.ASM:   Parse Filename
  403.   FXN2AH.ASM:   Get Date
  404.   FXN2BH.ASM:   Set Date
  405.   FXN2CH.ASM:   Get Time
  406.   FXN2DH.ASM:   Set Time
  407.   FXN2EH.ASM:   Set/Reset Verify Flag
  408.   FXN2FH.ASM:   Get DTA Address
  409.   FXN30H.ASM:   Get MS-DOS Version Number
  410.   FXN31H.ASM:   Terminate and Stay Resident
  411.   FXN33H.ASM:   Get/Set Control-C Check Flag
  412.   FXN34H.ASM:   Return Address of InDOS Flag
  413.   FXN35H.ASM:   Get Interrupt Vector
  414.   FXN36H.ASM:   Get Disk Free Space
  415.   FXN38H.ASM:   Get/Set Current Country
  416.   FXN39H.ASM:   Create Directory
  417.   FXN3AH.ASM:   Remove Directory
  418.   FXN3BH.ASM:   Change Current Directory
  419.   FXN3CH.ASM:   Create File with Handle
  420.   FXN3DH.ASM:   Open File with Handle
  421.   FXN3EH.ASM:   Close File
  422.   FXN3FH.ASM:   Read File or Device
  423.   FXN40H.ASM:   Write File or Device
  424.   FXN41H.ASM:   Delete File
  425.   FXN42H.ASM:   Move File Pointer
  426.   FXN43H.ASM:   Get/Set File Attributes
  427. FXN4400H.ASM:   Get Device Data
  428. FXN4401H.ASM:   Set Device Data
  429. FXN4402H.ASM:   Receive Control Data from Character Device
  430. FXN4403H.ASM:   Send Control Data to Character Device
  431. FXN4404H.ASM:   Receive Control Data from Block Device
  432. FXN4405H.ASM:   Send Control Data to Block Device
  433. FXN4406H.ASM:   Check Input Status
  434. FXN4407H.ASM:   Check Output Status
  435. FXN4408H.ASM:   Check If Block Device Is Removable
  436. FXN4409H.ASM:   Check If Block Device Is Remote
  437. FXN440AH.ASM:   Check If Handle Is Remote
  438. FXN440BH.ASM:   Change Sharing Retry Count
  439. FXN440CH.ASM:   Generic I/O Control for Handles
  440. FXN440DH.ASM:   Generic I/O Control for Block Devices
  441. FXN440EH.ASM:   Get Logical Drive Map
  442. FXN440FH.ASM:   Set Logical Drive Map
  443.   FXN45H.ASM:   Duplicate File Handle
  444.   FXN46H.ASM:   Force Duplicate File Handle
  445.   FXN47H.ASM:   Get Current Directory
  446.   FXN48H.ASM:   Allocate Memory Block
  447.   FXN49H.ASM:   Free Memory Block
  448.   FXN4AH.ASM:   Resize Memory Block
  449.   FXN4BH.ASM:   Load and Execute Program (EXEC)
  450.   FXN4CH.ASM:   Terminate Process with Return Code
  451.   FXN4DH.ASM:   Get Return Code of Child Process
  452.   FXN4EH.ASM:   Find First File
  453.   FXN4FH.ASM:   Find Next File
  454.   FXN54H.ASM:   Get Verify Flag
  455.  
  456.   FXN56H.ASM:   Rename File
  457.   FXN57H.ASM:   Get/Set Date/Time of File
  458.   FXN58H.ASM:   Get/Set Allocation Strategy
  459.   FXN59H.ASM:   Get Extended Error Information
  460.   FXN5AH.ASM:   Create Temporary File
  461.   FXN5BH.ASM:   Create New File
  462.   FXN5CH.ASM:   Lock/Unlock File Region
  463. FXN5E02H.ASM:   Set Printer Setup
  464. FXN5F02H.ASM:   Get Assign-List Entry
  465. FXN5F03H.ASM:   Make Assign-List Entry
  466. FXN5F04H.ASM:   Cancel Assign-List Entry
  467.   FXN62H.ASM:   Get Program Segment Prefix Address
  468.   FXN63H.ASM:   Get Lead Byte Table
  469.   INT20H.ASM:   Terminate Program
  470.   INT25H.ASM:   Absolute Disk Read
  471.   INT26H.ASM:   Absolute Disk Write
  472.   INT27H.ASM:   Terminate and Stay Resident
  473.  
  474.  
  475.  
  476. Subdirectory \APP-A     MS-DOS Version 3.3
  477.  
  478.   FXN67H.ASM:   Example using INT 21H Fxn 67H to set the
  479.                 maximum handle count of the current process
  480.                 to 30.
  481.   FXN68H.ASM:   Example using INT 21H Fxn 68H to flush any
  482.                 data in MS-DOS's internal buffers associated
  483.                 with a specified handle to disk and update
  484.                 the directory and FAT.
  485. FXN6501H.ASM:   Example using INT 21H Fxn 65H Subfxn 01H to
  486.                 obtain extended country information
  487.                 associated with the default country and code
  488.                 page 437.
  489. 6501-BUF.ASM:   Assembly-language format of the buffer
  490.                 created by MS-DOS after the FXN6501H.ASM
  491.                 example is executed.
  492. FXN6502H.ASM:   Example using INT 21H Fxn 65H Subfxn 02H to
  493.                 obtain the pointer to the uppercase table
  494.                 associated with the default country and code
  495.                 page 437.
  496. 6502-BUF.ASM:   Assembly-language format of the buffer
  497.                 created by MS-DOS after the FXN6502H.ASM
  498.                 example is executed.
  499. CODEPAGE.ASM:   Example using INT 21H Fxn 66H Subfxns 01H
  500.                 and 02H to force the active code page to be
  501.                 the same as the system's default code page.
  502.  
  503.  
  504.  
  505. Subdirectory \APP-L     Intel Hexadecimal Object File Format
  506.  
  507.  BIN2HEX.BAS:   QuickBASIC binary-to-hexadecimal file
  508.                 conversion utility.
  509.  
  510.  
  511.  
  512. Subdirectory \APP-N     An Object Module Dump Utility
  513.  
  514.    OBJDUMP.C:   Utility program that displays the contents
  515.                 of an object file as individual object
  516.                 records.
  517.