home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / advos2 / readme.txt
Encoding:
Text File  |  1988-12-12  |  16.3 KB  |  346 lines

  1. Companion Disk for ADVANCED OS/2 PROGRAMMING
  2. --------------------------------------------------------------------------
  3.  
  4. The source files and executable files available on this companion disk
  5. are placed in directories by chapter.  All MASM and C programs have
  6. instructions for assembly or compilation and for linking at the beginning
  7. of each file.  All MASM programs are supplied with appropriate MAKE files.
  8.  
  9. Programs marked with an asterisk (*) are not published in the book or
  10. are in the book only in fragmentary form.
  11.  
  12. Before you begin working with this disk, make a backup copy using the
  13. DOS DISKCOPY command.  If you have a question or comment about this disk,
  14. contact Ray Duncan via MCI Mail (user name LMI), CompuServe
  15. (user ID 72406,1577), or BIX (user name rduncan).
  16.  
  17. If this disk proves defective, contact Consumer Sales, Microsoft Press,
  18. 16011 NE 36th Way, Box 97017, Redmond, WA  98073-9717.
  19.  
  20.  
  21. Disk Contents
  22. -------------
  23.  
  24. Directory \CH03\    
  25.  
  26.     HELLO.ASM           MASM source file for HELLO.EXE, a
  27.                         trivial OS/2 application program that
  28.                         displays "Hello World!" on the standard
  29.                         output and then terminates.
  30.     HELLO.DEF           Module definition file for HELLO.EXE.
  31.     HELLO               Make file for HELLO.EXE.
  32.  
  33.     ARGC.ASM            MASM subroutine to return the number of
  34.                         command line arguments.  Illustrates
  35.                         use of DosGetEnv.
  36.     ARGV.ASM            MASM subroutine to return address and
  37.                         length of specific command line argument.
  38.                         Illustrates use of DosGetEnv.
  39.  
  40.     SHOWARGS.ASM      * MASM source code for SHOWARGS.EXE, a simple 
  41.                         MASM application which uses ARGC and ARGV
  42.                         to display its command line arguments.
  43.     SHOWARGS.DEF      * Module definition file for SHOWARGS.EXE.
  44.     SHOWARGS          * Make file for SHOWARGS.EXE.
  45.  
  46.     GETENV.ASM        * MASM subroutine to find environment variable
  47.                         and return the address and length of the
  48.                         associated "value" string.  Illustrates
  49.                         use of DosGetEnv.
  50.     GETENV2.ASM       * Alternative version of GETENV subroutine
  51.                         which uses API function DosScanEnv, shorter
  52.                         but slower.
  53.  
  54.     SHOWENV.ASM       * MASM source code for SHOWENV.EXE, an 
  55.                         interactive demonstration program that
  56.                         prompts the user for the name of an environment
  57.                         variable and then displays the associated
  58.                         "value" string.
  59.     SHOWENV.DEF       * Module definition file for SHOWENV.EXE.
  60.     SHOWENV           * Make file for SHOWENV.EXE.
  61.  
  62. Directory \CH05\    
  63.  
  64.     MOUDEMO.C           C source file for MOUDEMO.EXE a simple C
  65.                         demonstration of the Mouse API that tracks and
  66.                         displays the mouse position.
  67.  
  68. Directory \CH07\    
  69.  
  70.     SHOWCOM.C         * Simple C demonstration of DosDevIOCtl
  71.                         functions for COM port control; obtains
  72.                         and displays the current COM port baud
  73.                         rate, word length, parity, etc.
  74.  
  75. Directory \CH08\    
  76.  
  77.     DUMP.C              Source code for C version of DUMP.EXE,
  78.                         a utility program that displays the contents
  79.                         of a file in hex and ASCII on the standard
  80.                         output.
  81.  
  82.     DUMP.ASM            Source code for MASM version of DUMP.EXE.
  83.     DUMP.DEF            Module definition file for MASM version
  84.                         of DUMP.EXE.
  85.     DUMP                Make file for MASM version of DUMP.EXE.
  86.     ARGC.ASM            ARGC subroutine used by MASM version of DUMP.
  87.     ARGV.ASM            ARGV subroutine used by MASM version of DUMP.
  88.  
  89. Directory \CH09\    
  90.                                                                                 
  91.     SCHEX.ASM         * MASM source code for SCHEX.EXE, a simple
  92.                         demonstration of the use of DosFindFirst and
  93.                         DosFindNext.  Finds and displays all files
  94.                         with the extension .ASM in the current directory.
  95.     SCHEX.DEF         * Module definition file for SCHEX.EXE.
  96.     SCHEX             * Make file for SCHEX.EXE.
  97.         
  98.     VOLNAME.ASM       * MASM source code for VOLNAME.EXE, a simple
  99.                         demonstration of the use of DosQFSInfo.
  100.     VOLNAME.DEF       * Module definition file for VOLNAME.EXE.
  101.     VOLNAME           * Make file for VOLNAME.EXE.
  102.  
  103.     WHEREIS.C           Source code for C version of WHEREIS.EXE, a
  104.                         utility program to find and display all files
  105.                         matching the command line parameter (which may
  106.                         include wildcards).
  107.  
  108.     WHEREIS.ASM         Source code for MASM version of WHEREIS.EXE.
  109.     WHEREIS.DEF         Module definition file for MASM version 
  110.                         of WHEREIS.EXE.
  111.     WHEREIS             Make file for MASM version of WHEREIS.EXE.
  112.     ARGC.ASM            ARGC subroutine used by MASM version of WHEREIS.
  113.     ARGV.ASM            ARGV subroutine used by MASM version of WHEREIS.
  114.  
  115.     QFN.C             * C subroutine to fully qualify a filename.
  116.                         Illustrates use of DosChDir, DosSelectDisk,
  117.                         DosQCurDisk, DosQCurDir.
  118.  
  119.     TRYQFN.C          * C source code for TRYQFN.EXE, a demonstration 
  120.                         program which illustrates use of QFN.C.  
  121.  
  122.     QFN.ASM           * MASM subroutine to fully qualify a filename.
  123.                         Illustrates use of DosChDir, DosSelectDisk,
  124.                         DosQCurDisk, DosQCurDir.
  125.  
  126.     TRYQFN.ASM        * MASM source code for TRYQFN.EXE, a demonstration
  127.                         program which illustrates use of QFN.ASM.     
  128.     TRYQFN.DEF        * Module definition file for TRYQFN.EXE.
  129.     TRYQFN            * Make file for MASM version of TRYQFN.EXE.
  130.  
  131. Directory \CH10\    
  132.  
  133.     DASD.ASM          * MASM source code for DASD.EXE, a simple 
  134.                         demonstration of the use of direct disk access
  135.                         in a well-behaved OS/2 application.  Reads
  136.                         the boot sector for the current drive and then 
  137.                         writes it into a file named BOOT.BIN.
  138.     DASD.DEF          * Module definition file for DASD.EXE.
  139.     DASD              * Make file for DASD.EXE.
  140.  
  141. Directory \CH12\    
  142.  
  143.     BEEPER.ASM        * MASM source code for BEEPER.EXE, a simple
  144.                         demonstration of a multithreaded application.
  145.                         The main thread starts up a secondary thread
  146.                         which sounds a tone at 1-second intervals; the
  147.                         primary thread waits until any key is pressed
  148.                         and then terminates the program.
  149.     BEEPER.DEF        * Module definition file for BEEPER.EXE.
  150.     BEEPER            * Make file for BEEPER.EXE.
  151.  
  152.     EXEC1.ASM         * MASM source code for EXEC1.EXE, demonstrating
  153.                         the use of DosExecPgm to run CHKDSK as a
  154.                         synchronous child process.
  155.     EXEC1.DEF         * Module definition file for EXEC1.EXE.
  156.     EXEC1             * Make file for EXEC1.EXE.        
  157.  
  158.     EXEC2.ASM         * MASM source code for EXEC2.EXE, demonstrating
  159.                         the use of DosExecPgm and DosCwait to run 
  160.                         CHKDSK as an asynchronous child process.
  161.     EXEC2.DEF         * Module definition file for EXEC2.EXE.
  162.     EXEC2             * Make file for EXEC2.EXE.        
  163.  
  164.     EXEC3.ASM         * MASM source code for EXEC3.EXE, a simple 
  165.                         demonstration of DosStartSession.  Launches
  166.                         CMD.EXE to display a disk directory listing
  167.                         in a background, related child session.
  168.     EXEC3.DEF         * Module definition file for EXEC3.EXE.
  169.     EXEC3             * Make file for EXEC3.EXE.
  170.  
  171.     DUMBTERM.C          Source code for C version of DUMBTERM.EXE,
  172.                         a simple terminal emulator program that
  173.                         demonstrates the use of multiple threads.
  174.  
  175.     DUMBTERM.ASM        Source code for MASM version of DUMBTERM.EXE.
  176.     DUMBTERM.DEF        Module definition file for MASM version
  177.                         of DUMBTERM.EXE.
  178.     DUMBTERM            Make file for MASM version of DUMBTERM.EXE.
  179.  
  180.     TINYCMD.C           Source code for C version of TINYCMD.EXE, a
  181.                         simple table-driven command line interpreter.
  182.  
  183.     TINYCMD.ASM         Source code for MASM version of TINYCMD.EXE.
  184.     TINYCMD.DEF         Module definition file for MASM version
  185.                         of TINYCMD.EXE.
  186.     TINYCMD             Make file for MASM version of TINYCMD.EXE.
  187.  
  188. Directory \CH13\    
  189.  
  190.     SIGNAL.C          * Source code for C version of SIGNAL.EXE, a 
  191.                         simple demonstration of signal handling.
  192.                         Registers a signal handler for Ctrl-C signals
  193.                         and then sleeps for 10 seconds; when Ctrl-C
  194.                         is detected, the handler displays a message.
  195.  
  196.     SIGNAL.ASM        * Source code for MASM version of SIGNAL.EXE.
  197.     SIGNAL.DEF        * Module definition file for MASM version
  198.                         of SIGNAL.EXE.
  199.     SIGNAL            * Make file for MASM version of SIGNAL.EXE.
  200.  
  201. Directory \CH14\C\  
  202.  
  203.     PORTS.C             Source code for C version of PORTS.EXE,
  204.                         a simple demonstration program that reads
  205.                         and displays ports 00H-0FFH.
  206.     PORTS.DEF           Module definition file for C version
  207.                         of PORTS.EXE.
  208.     PORTS               Make file for C version of PORTS.EXE.
  209.     PORTIO.ASM          MASM source code for IOPL segment used by
  210.                         PORTS.EXE.  Contains RPORT and WPORT routines 
  211.                         to read and write I/O ports.
  212.  
  213. Directory \CH14\MASM\    
  214.  
  215.     PORTS.ASM           Source code for MASM version of PORTS.EXE,
  216.                         a simple demonstration program that reads
  217.                         and displays ports 00H-0FFH.
  218.     PORTS.DEF           Module definition file for MASM version
  219.                         of PORTS.EXE.
  220.     PORTS               Make file for MASM version of PORTS.EXE.
  221.     PORTIO.ASM          MASM source code for IOPL segment used by
  222.                         PORTS.EXE.  Contains RPORT and WPORT routines 
  223.                         to read and write I/O ports.
  224.  
  225. Directory \CH15\   
  226.  
  227.     CLOCK.ASM         * MASM source code for CLOCK.EXE, a simple
  228.                         demonstration of the use of semaphores and
  229.                         periodic timers.  Displays the time at
  230.                         1-second intervals in the upper right
  231.                         corner of the screen.
  232.     CLOCK.DEF         * Module definition file for CLOCK.EXE.
  233.     CLOCK             * Make file for CLOCK.EXE.
  234.  
  235.     TOUCH.C           * C source code for TOUCH.EXE, a utility
  236.                         program to stamp files with time and date.
  237.                         Illustrates use of DosGetDateTime,
  238.                         DosFindFirst, DosFindNext, DosSetFileInfo.
  239.  
  240. Directory \CH16\   
  241.  
  242.     PROTO.C             Source code for C version of PROTO.EXE, a
  243.                         prototype filter program.
  244.  
  245.     PROTO.ASM           Source file for MASM version of PROTO.EXE,
  246.                         a prototype filter program.
  247.     PROTO.DEF           Module definition file for MASM version
  248.                         of PROTO.EXE.
  249.     PROTO               Make file for MASM version of PROTO.EXE.
  250.  
  251.     LC.C              * Source code for C version of LC.EXE, a
  252.                         filter to translate uppercase letters
  253.                         to lowercase.
  254.  
  255.     LC.ASM            * Source code for MASM version of LC.EXE.
  256.     LC.DEF            * Module definition file for MASM version
  257.                         of LC.EXE.
  258.     LC                * Make file for MASM version of LC.EXE.
  259.  
  260.     CLEAN.C           * C source code for CLEAN.EXE, a simple
  261.                         filter which removes control characters
  262.                         except for linefeeds and carriage returns,
  263.                         and expands tabs to spaces.
  264.  
  265.     FIND.C              C source code for FIND.EXE, a simple
  266.                         filter which searches text streams for a
  267.                         pattern and sends all lines containing
  268.                         a match for the pattern to the standard
  269.                         output.
  270.  
  271.     EXECSORT.ASM        MASM source code for EXECSORT.EXE, a simple
  272.                         demonstration of the use of a filter as
  273.                         a child process.  EXECSORT runs SORT.EXE
  274.                         as a child to sort the contents of MYFILE.DAT
  275.                         and sends the output to MYFILE.SRT.
  276.     EXECSORT.DEF        Module definition file for EXECSORT.EXE.
  277.     EXECSORT            Make file for EXECSORT.EXE.
  278.  
  279.     MYFILE.DAT          Sample data file for EXECSORT.EXE and SORT.EXE.
  280.  
  281. Directory \CH17\   
  282.  
  283.     TEMPLATE.ASM        MASM source code for TEMPLATE.SYS, a skeleton
  284.                         OS/2 device driver.  Does nothing (except
  285.                         initialize and display an error message), but
  286.                         also does no harm.
  287.     TEMPLATE.DEF        Module definition file for TEMPLATE.SYS.
  288.     TEMPLATE            Make file for TEMPLATE.SYS.
  289.  
  290.     TINYDISK.ASM        MASM source code for TINYDISK.SYS, a simple
  291.                         OS/2 RAM Disk device driver.  Illustrates
  292.                         bimodal operation and proper use of PhysToVirt 
  293.                         and VirtToPhys.
  294.     TINYDISK.DEF        Module definition file for TINYDISK.SYS.
  295.     TINYDISK            Make file for TINYDISK.SYS.
  296.  
  297. Directory \CH18\   
  298.  
  299.     STAMPER.ASM       * MASM source code for STAMPER.EXE, a simple
  300.                         device monitor program which inserts ASCII
  301.                         date or time into keyboard data stream on
  302.                         command.  Monitors the keyboard for Alt-D, 
  303.                         Alt-T, and Alt-X hot keys.
  304.     STAMPER.DEF       * Module definition file for STAMPER.EXE.
  305.     STAMPER           * Make file for STAMPER.EXE.
  306.  
  307.     SNAP.C              Source code for C version of SNAP.EXE, a more
  308.                         complicated device monitor example.  Monitors
  309.                         keyboard data stream for hot key and copies
  310.                         current screen contents into a file on command.
  311.                         Illustrates use of multiple threads, file I/O, 
  312.                         video pop-ups, system semaphores, spawning of
  313.                         child processes, etc.
  314.  
  315.     SNAP.ASM            Source code for MASM version of SNAP.EXE.
  316.     SNAP.DEF            Module definition file for MASM version
  317.                         of SNAP.EXE.
  318.     SNAP                Make file for MASM version of SNAP.EXE. 
  319.  
  320. Directory \CH19\   
  321.  
  322.     ASMHELP.ASM         MASM source code for ASMHELP.DLL, a sample
  323.                         DLL that supplies MASM applications with
  324.                         command line scanning services.
  325.     ASMHELP.DEF         Module definition file for ASMHELP.DLL.
  326.     ASMHELP             Make file for ASMHELP.DLL.
  327.  
  328.     SHOWARGS.ASM        MASM source code for SHOWARGS.EXE, a 
  329.                         demonstration program that dynlinks to,
  330.                         and uses the services of, the sample
  331.                         dynlink library ASMHELP.DLL.
  332.     SHOWARGS.DEF        Module definition file for SHOWARGS.EXE.
  333.     SHOWARGS            Make file for SHOWARGS.EXE.
  334.  
  335.     CDLL.C              C source code for body of CDLL.DLL, a
  336.                         a simple sample dynlink library.
  337.     CDLL.DEF            Module definition file for CDLL.DLL.
  338.     CDLL.LIB            Import library for CDLL.DLL.
  339.     CDLL                Make file for CDLL.DLL.
  340.     CINIT.ASM           MASM source code for initialization entry
  341.                         point of CDLL.DLL.
  342.  
  343.     TESTCDLL.C        * C source code for a demonstration program
  344.                         that dynlinks to, and uses the services
  345.                         of, the sample dynlink library CDLL.DLL.
  346.