home *** CD-ROM | disk | FTP | other *** search
/ For Beginners & Professional Hackers / cd.iso / softcrc / masm / masm.510 / readv5.01 < prev    next >
Encoding:
Text File  |  1988-02-01  |  38.4 KB  |  1,185 lines

  1.             Microsoft(R) Macro Assembler Package
  2.                   Version 5.10
  3.            Copyright 1988, Microsoft Corporation
  4.  
  5. Text files on the Macro    Assembler disks    are tabbed to save
  6. disk space. If your printer does not automatically handle
  7. tabs during printing, you must use a print program that
  8. expands    tabs. For example, use the DOS PRINT program to    print
  9. this and other document    or source files    on the disk.
  10.  
  11.     
  12.         The Microsoft Macro Assembler (MASM)
  13.  
  14. Mixed-Language Support for Variables and Procedures
  15. ---------------------------------------------------
  16. All EXTRN, PUBLIC, and PROC items, as well as uses of the .MODEL
  17. directive, support a language type.  The language type of EXTRN
  18. and PUBLIC variables determine whether or not an underscore is
  19. prefixed to the name (an underscore is prefixed only for variables
  20. with a C language type), and the language type of a procedure determines
  21. its calling and naming conventions.  For an explanation of calling
  22. and naming conventions, see the Microsoft Mixed-Language Programming
  23. Guide.
  24.  
  25. The language type consists of the word "C" or "Pascal" and uses the
  26. following syntax (lowercase items are placeholders, and bracketed items
  27. are optional):
  28.  
  29. EXTRN [<langtype>] <varname>:<type>
  30. PUBLIC [<langtype>] <varname>
  31. procName PROC [NEAR|FAR] [<langtype>] [USES <regs>,] <args>
  32.  
  33. For example, the C and Pascal keywords are used correctly in the
  34. following example:
  35.  
  36.     .MODEL    SMALL,C
  37.     EXTRN    Pascal DosOpen:FAR
  38.     PUBLIC    C myVar
  39. myOpen    PROC    Pascal fName:PTR, mode:WORD
  40. .
  41. .
  42. .
  43. myOpen    ENDP
  44.  
  45.  
  46. EVEN and ALIGN Directives
  47. -------------------------
  48. Padding for EVEN and ALIGN is now optimized.  Data segments
  49. are padded with zeros.    Code segments are padded with special
  50. two-byte NOP instructions where possible.  The two-byte NOP
  51. consists of the instruction XCHG BX,BX (87 DB hexadecimal)
  52. which is executed faster than two one-byte NOP instructions.
  53.         
  54. /B Option Ignored
  55. -----------------
  56. The /B option is now ignored, because its effect is irrelevant,
  57. given the new file buffering mechanism.  However, the option is
  58. still accepted for the purposes of compatibility.
  59.         
  60. The PTR Operator
  61. ----------------
  62. The PTR    operator can be    used to    specify    the size of a
  63. register indirect operand for a    CALL or    JMP instruction.
  64. However, the size cannot be specified with NEAR    or FAR.    Use
  65. WORD or    DWORD instead. (In 80386 32-bit    segments, use DWORD
  66. or FWORD.) Examples are    shown below:
  67.  
  68.       ; 8086, 80826, or 80386 16-bit mode
  69.  
  70.       jmp  WORD PTR    [bx]        ; Legal near jump
  71.       call NEAR PTR    [bx]        ; Illegal near call
  72.       call DWORD PTR [bx]        ; Legal far    call
  73.       jmp  FAR PTR [bx]        ; Illegal far jump
  74.  
  75.       ; 80386 32-bit mode only
  76.  
  77.       jmp  DWORD PTR [bx]        ; Legal near jump
  78.       call NEAR PTR    [bx]        ; Illegal near call
  79.       call FWORD PTR [bx]        ; Legal far    call
  80.       jmp  FAR PTR [bx]        ; Illegal far jump
  81.  
  82. This limitation    only applies to    register indirect operands.
  83. NEAR or    FAR can    be applied to operands associated with
  84. labels.    Examples are shown below:
  85.  
  86.       jmp  NEAR PTR    pointer[bx] ; Legal
  87.       call FAR PTR location        ; Legal
  88.  
  89. Assembler Behavior Change
  90. -------------------------
  91. Some errors and    questionable practices that were ignored by
  92. earlier    versions are now flagged as errors. As a result,
  93. existing source    code may produce errors    or warnings.
  94. The following are examples:
  95.  
  96.       - Labels defined only during pass 1 cause errors if
  97.         used in expressions.
  98.       - A CS ASSUME that changes from pass 1 to pass 2 causes
  99.         an error.
  100.       - Constants are now checked for type overflow.
  101.       - Reserved words used    as labels produce warnings.
  102.       - The    OFFSET operator    used with a constant causes an error.
  103.  
  104. The STACK Combine Type
  105. ----------------------
  106. The description of the STACK combine type in Section 5.2.2.3
  107. does not explain how multiple initialized stack    segments are
  108. combined. The total size of the    stack is the total size    of
  109. all stack definitions. LINK puts initialized data for each
  110. defined    stack segment at the end of the    stack. Data initialized
  111. in the last segment linked override data initialized in
  112. previous segments. This behavior is usually not relevant, since
  113. most programs only define one stack of uninitialized data.
  114. Stack data cannot be initialized with simplified segment
  115. directives.
  116.  
  117. Clarification of Parsing Error
  118. ------------------------------
  119. The following error can be difficult to interpret because of the
  120. way the assembler parses (analyzes) source code:
  121.  
  122. A2015: Symbol already different kind: <name>
  123.  
  124. Typically, the assembler generates this error message when a
  125. symbol is used in a way inconsistent with how it was declared: for
  126. example, a symbol is declared as an external absolute but then used
  127. as a local code label.  However, the assembler also generates this
  128. error when a symbol in the second source-code field can be interpreted
  129. as either an operation or an operand.  The following example illustrates
  130. this problem:
  131.  
  132. SYM1    MACRO    structName, varName
  133. varName    structName    <>
  134.     ENDM
  135.  
  136. SYM2    STRUCT
  137. field1    DB
  138. field2    DW
  139. SYM2    ENDS
  140.  
  141.  
  142. SYM1    SYM2, <mylabel>
  143.  
  144. The last line of code causes error A2015 to be generated.  The
  145. assembler first looks at the second field of the line, which
  146. contains the symbol SYM2.  Since SYM2 is a structure, the assembler
  147. considers SYM2 to be an operation rather than an operand, and therefore
  148. it considers SYM1 to be a label (rather than an operation). The way
  149. to avoid this error is simply code the instruction as:
  150.  
  151. SYM1    <SYM2>, <mylabel>
  152.  
  153.  
  154. HIGH and LOW Operators
  155. ----------------------
  156. The HIGH and LOW operators work reliably only with constants
  157. and with offsets to external symbols.  HIGH and LOW operations are
  158. not supported for offsets to local symbols.
  159.  
  160. Mixed-Mode Programming (386 Only)
  161. ---------------------------------
  162. When assembling code for .386 mode, the assembler now supports direct-
  163. addressing modes between segments with different USE sizes.  (Segments can
  164. have the USE16 or USE32 attribute; these attributes refer to the default
  165. size of offsets.)  Direct-addressing references to labels in other segments
  166. are correctly resolved.  In the following example, the assembler correctly
  167. uses a 32-bit offset to access the data at label a32:
  168.  
  169. .386
  170. SEG32    SEGMENT    USE32
  171. a32    DD    ?
  172. SEG32    ENDS
  173.  
  174. SEG16    SEGMENT    USE16
  175.     assume ds:seg32
  176.     mov    eax,a32
  177. SEG16    ENDS
  178.  
  179. You can also execute a CALL or a JMP to a label in a segment with a
  180. different USE size.  However, the label must be declared FAR, and the
  181. CALL or JMP must not be a forward reference.  The following example
  182. shows the correct method for executing such a CALL or JMP:
  183.  
  184. .386
  185. COD16    SEGMENT    USE16    'CODE'
  186. proc16    PROC    FAR
  187.     ret
  188. proc16    ENDP
  189.  
  190. lab16    LABEL    FAR
  191. COD16    ENDS
  192.  
  193. COD32    SEGMENT    USE32    'CODE'
  194.     call    proc16
  195.     jmp    lab16
  196. COD32    ENDS
  197.  
  198. Additional Error Messages
  199. -------------------------
  200.  
  201. 19    Wrong type of register
  202.  
  203. The register specified in the operand field was incompatible with the
  204. directive or instruction in the operation field.  For example, the following
  205. instruction causes this error because you cannot increment the
  206. code segment:
  207.  
  208.     inc cs
  209.  
  210.  
  211. 36    Extra NOP inserted
  212.  
  213. During pass 1 the assembler did not have enough information to
  214. correctly infer the length of the encoding for the instruction.
  215. During pass 2 the encoding was found to be shorter than the space
  216. allocated from pass 1, so one or more NOP instructions were inserted
  217. as padding.  It may be possible to generate a smaller amount of code
  218. by eliminating a forward reference to a symbol.
  219.  
  220.  
  221.        The Microsoft Cross-Reference Utility (CREF)
  222.  
  223. New Feature
  224. -----------
  225. Cross-reference    listing    files created with CREF    now have an
  226. additional symbol. A line number followed by + indicates
  227. that a symbol is modified at the given line. For example:
  228.  
  229.       TST .    . . . .    . . . .    . . . .    .  134#      237     544+
  230.  
  231. The symbol TST is defined at line 134, used at line 237, and
  232. modified at line 544.
  233.  
  234.  
  235.                           The Mouse Driver
  236.  
  237. If you use the Microsoft Mouse with the Microsoft CodeView(R) debugger
  238. you must have Version 6.0 or later of the Microsoft Mouse. If you do not, use
  239. the version of the MOUSE.COM driver provided in this package.  Copy MOUSE.COM
  240. to the appropriate mouse directory. When you are ready to use the mouse, type
  241.  
  242.     mouse
  243.  
  244. at the DOS command level. If you want to install the mouse driver automatically
  245. every time you reboot,  insert the "mouse" command in your AUTOEXEC.BAT file.
  246.  
  247. Note that in earlier releases of Microsoft C, both the MOUSE.SYS and the
  248. MOUSE.COM driver were provided.  If you have been using an earlier version
  249. of the MOUSE.SYS driver, delete the following line from your CONFIG.SYS file:
  250.  
  251.     device=\<directory>\mouse.sys
  252.  
  253. where <directory> is the directory where the earlier mouse driver resides.
  254.  
  255.  
  256.                   Microsoft CodeView Debugger
  257.  
  258. New Command-Line Option
  259. -----------------------
  260. If you have an IBM Personal System/2, then you can use the /50
  261. command-line option to start the CodeView debugger in 50-line mode.
  262. Note that you must be in 25-line mode to effectively use either the
  263. /43 or /50 command-line option.
  264.  
  265. CONFIG.SYS Setting for CVP
  266. --------------------------
  267. To run the protected-mode CodeView debugger (CVP.EXE), you must have
  268. the following line in your CONFIG.SYS file:
  269.  
  270.     IOPL=YES
  271.  
  272.  
  273. Using the 7 Command in Protected Mode
  274. -------------------------------------
  275. If you are using OS/2 protected mode and have a math coprocessor, then
  276. you need to use a patch before you can use the CVP 7 command.  To apply
  277. the patch, use the OS2PATCH.EXE and PTRACE87.PAT files that come on the
  278. same disk that CVP.EXE comes on.  You also need to locate the PATCH.EXE file
  279. that comes with OS/2 and make sure that this file is in a directory listed
  280. in your PATH environment variable.  Then follow these steps:
  281.  
  282. 1) Change the current drive and directory to the root directory of the
  283.    boot disk.  (If the boot disk is a floppy, make sure it is inserted
  284.    in the drive you used to boot from.)
  285.  
  286. 2) Give the following command line at the DOS prompt:
  287.  
  288.    OS2PATCH /A PTRACE87.PAT
  289.  
  290. Note that you may need to give the complete path names for the
  291. OS2PATCH.EXE and for the PTRACE87.PAT file.  You do not need to give
  292. a path name for the OS2PATCH.EXE file if you have placed this file
  293. in a directory listed in your PATH environment variable.
  294.  
  295. Using the Real-Mode Debugger in the Compatibility Box
  296. -----------------------------------------------------
  297. When running the real-mode CodeView debugger in the DOS 3.x
  298. compatibility box, start the debugger with the /S command-line
  299. option.  Otherwise, the mouse pointer will not appear.
  300.  
  301. Using the CodeView Debugger with BIND
  302. -------------------------------------
  303. The real-mode CodeView debugger cannot debug bound (dual-mode)
  304. applications.  However, the protected-mode CodeView debugger,
  305. CVP, can debug bound applications.
  306.  
  307. Expression Evaluator for BASIC Programs
  308. ---------------------------------------
  309. In the BASIC expression evaluator, "+" is not supported for string
  310. concatenation.
  311.  
  312. Stack Trace Command
  313. -------------------
  314. In order for the Stack Trace command (or the Calls menu) to work
  315. reliably, you need to execute to at least the beginning of the main
  316. function or procedure, and the current module should have full CodeView
  317. information (a module has full CodeView information if compiled or
  318. assembled with /Zi).
  319.  
  320. Error Messages
  321. --------------
  322. The error message "? cannot display" indicates that the Display
  323. Expression command (?) has been passed a valid symbol that it
  324. cannot display. In previous versions of the debugger, structures
  325. could not be displayed. With current version of the debugger, only
  326. the enums type cannot be displayed.
  327.  
  328. The error message "Expression not a memory address" occurs when
  329. the Tracepoint command is given without a symbol that evaluates to
  330. a single memory address.  For example, the commands "TP?1" and
  331. "TP?a+b" each produce this error message.  The proper way to put a
  332. tracepoint on the word at address 1 is with the command "TPW 1".
  333.  
  334. The error message "Function call before 'main'" occurs when you
  335. attempt to evaluate a program-defined function before you have entered
  336. the main function.  Execute to at least to the beginning of the main
  337. function before attempting to evaluate program-defined functions.
  338.  
  339. The error message "Bad emulator info" occurs when CodeView cannot
  340. read data from the floating-point emulator.
  341.  
  342. The error message "Floating point not loaded" has a special meaning
  343. for CVP (in addition to the explanation given in the CodeView and
  344. Utilities manual).  Each thread has its own floating-point emulator.
  345. This message is issued when the current thread has not initialized
  346. its own emulator.
  347.  
  348. Microsoft Pascal Programs
  349. -------------------------
  350. In this release, Microsoft Pascal programs cannot be debugged with
  351. the CodeView debugger.
  352.  
  353.  
  354.                  Exit Codes for Utilities
  355.  
  356. The exit codes for LINK and the utilities in the Microsoft CodeView
  357. and Utilities manual should appear as follows:
  358.  
  359. LINK
  360. ----
  361.     Code    Meaning
  362.  
  363.     0    No error.
  364.  
  365.     2    Program error--something was wrong with the commands
  366.         or files input to the linker.
  367.  
  368.     4    System error.  The linker
  369.  
  370.         - ran out of space on output files
  371.         - was unable to reopen the temporary file
  372.         - experienced an internal error
  373.         - was interrupted by the user
  374.  
  375. LIB, EXEPACK, EXEMOD, MAKE, and SETENV
  376. ---------------------------------------
  377.     Code    Meaning
  378.  
  379.     0    No error.
  380.  
  381.     2    Program error--something was wrong with the commands
  382.         or files input to the utility.
  383.  
  384.     4    System error.  The utility ran out of memory, was
  385.         interrupted by the user, or experienced an internal
  386.         error.
  387.  
  388.             Microsoft Overlay Linker (LINK)
  389.  
  390. Overlay Restrictions
  391. --------------------
  392. You cannot use long jumps (using the longjmp library function) or indirect
  393. calls (through a function pointer) to pass control to an overlay.  When a
  394. function is called through a pointer, the called function must be in the same
  395. overlay or in the root.
  396.  
  397. Changed LINK Error Messages
  398. ---------------------------
  399. The explanation for fatal-error message L1008 is changed as follows: 
  400.  
  401.     The /SEGMENTS option specified a limit greater than 3072 on the
  402.     number of segments allowed.
  403.  
  404. Error message L1009 has been changed to read as follows:
  405.  
  406.     L1009    <number> : CPARMAXALLOC : illegal value
  407.  
  408. Error message L1053 has been changed to read as follows:
  409.  
  410.     L1053   out of memory for symbol table
  411.  
  412.     The program had more symbolic information (such as public, external,
  413.     segment, group, class, and file names) than the amount that could fit
  414.     in available real memory.
  415.  
  416.     Try freeing memory by linking from the DOS command level instead of
  417.     from a MAKE file or from an editor. Otherwise, combine modules or
  418.     segments and try to eliminate as many public symbols as possible.
  419.  
  420. Warning message L4050 has been changed as follows:
  421.  
  422.     L4050    too many public symbols for sorting
  423.  
  424.     The linker uses the stack and all available memory in the
  425.     near heap to sort public symbols for the /MAP option.  If
  426.     the number of public symbols exceeds the space available
  427.     for them, this warning is issued, and the symbols are not
  428.     sorted in the map file but are listed in arbitrary order.
  429.  
  430. New LINK Error Messages
  431. -----------------------
  432. L1003    /QUICKLIB, /EXEPACK incompatible
  433.  
  434. You cannot link with both the /QU option and the /E option.
  435.  
  436. L1006   <option-text>: stack size exceeds 65535 bytes
  437.  
  438. The value given as a parameter to the /STACKSIZE option exceeds the
  439. maximum allowed.
  440.  
  441. L1063    out of memory for CodeView information
  442.  
  443. The linker was given too many object files with debug information,
  444. and the linker ran out of space to store it.  Reduce the number
  445. of object files that have debug information.
  446.  
  447. L1115   /QUICKLIB, overlays incompatible
  448.  
  449. You specified overlays and used the /QUICKLIB option.
  450. These cannot be used together.
  451.  
  452. L2013    LIDATA record too large
  453.  
  454. An LIDATA record contained more than 512 bytes.  This is
  455. probably a compiler error.
  456.  
  457. L2024   <name>: special symbol already defined
  458.  
  459. Your program defined a symbol name that is already used by the linker
  460. for one of its own low-level symbols.  (For example, the linker
  461. generates special symbols used in overlay support and other operations.)
  462. Choose another name for the symbol in order to avoid conflict.
  463.  
  464. L2025   <segmentname>: segment with > 1 class name not allowed with /INC
  465.  
  466. Your program defined a segment more than once, giving the segment
  467. different class names.  Different class names for the same segment
  468. are not allowed when you link with the /INCREMENTAL option.  Normally,
  469. this error should never appear unless you are programming with MASM.
  470. For example, if you give the two MASM statements
  471.  
  472. _BSS segment 'BSS'
  473.  
  474. and
  475.  
  476. _BSS segment 'DATA'
  477.  
  478. then the statements have the effect of declaring two distinct segments.
  479. ILINK does not support this situation, so it is disallowed when the
  480. /INCREMENTAL option is used.
  481.  
  482.  
  483. L2041    stack plus data exceed 64K
  484.  
  485. The total of near data and requested stack size exceeds 64K, 
  486. and the program will not run correctly.  Reduce the stack size.
  487. The linker only checks for this condition if /DOSSEG
  488. is enabled, which is done automatically in the library
  489. startup module.
  490.  
  491. L2043    Quick Library support module missing
  492.  
  493. When creating a Quick library, you did not link with the required
  494. QUICKLIB.OBJ module.
  495.  
  496. L2044    <name> : symbol    multiply defined, use /NOE
  497.  
  498. The linker found what it interprets as a public-symbol
  499. redefinition, probably because you have redefined a symbol that
  500. is defined in a library.  Relink with the /NOEXTDICTIONARY
  501. (/NOE) option. If error L2025 results for the same symbol, then you
  502. have a genuine symbol-redefinition error.
  503.  
  504. L4003    intersegment self-relative fixup at <offset> in segment <name>
  505.     pos: <offset> Record type: 9C target external '<name>'
  506.  
  507. The linker found an intersegment self-relative fixup. This error
  508. may be caused by compiling a small-model program with the /NT
  509. option. 
  510.  
  511. L4034    more than 239 overlay segments; extra put in root
  512.  
  513. Your program designated more than the limit of 239 segments to 
  514. go in overlays.  Starting with the 234th segment, they are assigned to 
  515. the root (that is, the permanently resident portion of the program).
  516.  
  517.  
  518.         Microsoft Library Manager (LIB)
  519.  
  520. New Option
  521. ----------
  522. There is a new option for LIB:  /NOIGNORECASE (abbreviated as /N).
  523. This option tells LIB to not ignore case when comparing symbols.
  524. names. By default, LIB ignores case.  Multiple symbols that are
  525. the same except for case can be put in the same library.  An
  526. example of this is: "_Open" and "_open". Normally you could not
  527. add both these symbols to the same library.
  528.  
  529. Note that if a library is built with /NOI, the library is
  530. internally "marked" to indicate /NOI.    All libraries built
  531. with earlier versions of LIB are not marked.
  532.  
  533. If you combine multiple libraries, and any one of them is
  534. marked /NOI, then /NOI is assumed for the output library.
  535.  
  536. In addition, LIB also supports the option /IGNORECASE (/I), which
  537. is completely analogous to /NOIGNORECASE.  /I is the default. The only
  538. reason to use it would be if you have an existing library marked /NOI
  539. that you wanted to combine with other libraries which were not marked,
  540. and have the output library be not marked. If you don't use
  541. /IGNORECASE, the output is marked /NOI (see above).
  542.  
  543. Changed LIB Error Messages
  544. --------------------------
  545. Warning    messages U4152,    U4155, and U4157-U4159 for LIB are now
  546. nonfatal error messages    U2152, U2155, and U2157-U2159, respectively.
  547.  
  548. Warning message U4151 has been changed to read as follows:
  549.  
  550.     U4151    '<name>' : symbol defined in module <name>, redefinition ignored
  551.  
  552. New LIB Error Messages
  553. ----------------------
  554. The following new warning messages have    been added for LIB:
  555.  
  556. U4155    <modulename> : module not in library
  557.  
  558. A module specified to be replaced does not already exist in the 
  559. library.  LIB adds the module anyway.
  560.  
  561. U4157    insufficient memory, extended dictionary not created
  562. U4158    internal error,    extended dictionary not    created
  563.  
  564. For the    reason indicated, LIB could not    create an extended
  565. dictionary. The    library    is still valid,    but the    linker
  566. is not able to take advantage of the extended dictionary
  567. to speed linking. 
  568.  
  569.  
  570.         Microsoft Program Maintenance Utility (MAKE)
  571.  
  572. New Error Message
  573. -----------------
  574. U1015: <file> : error redirection failed
  575.  
  576. This error occurs if the /X option is given and error output cannot
  577. be redirected to the given file (for example, because the file
  578. is read-only).
  579.  
  580. Inference Rules
  581. ---------------
  582. You cannot have inference rules in both the TOOLS.INI and the description
  583. file that use both the same inextension and outextension.  For example, you
  584. cannot place the following inference rule in the TOOLS.INI file:
  585.  
  586.     .c.obj:
  587.         cl /c /Zi /Od $*.c
  588.  
  589. while also placing the following line in the description file:
  590.  
  591.     .c.obj:
  592.         cl /Ot $*.c
  593.  
  594. However, you can define the same macro in both the TOOLS.INI and the
  595. description file.  In such cases, the definition in the description file
  596. takes precedence.
  597.  
  598. Backslash (\) as Continuation Character
  599. ---------------------------------------
  600. Note that MAKE considers a backslash immediately followed by a new-line
  601. character to be a continuation character.  When it finds this combination
  602. in a description file, MAKE concatenates the line immediately following
  603. the combination with the line where the combination appears.
  604.  
  605. If you define a macro that ends in a backslash, make sure that you put a
  606. space after the terminating backslash.  For example, if you want to define
  607. macros for the path C:\SRC\BIN and C:\SRC\LIB, you must use the format 
  608. illustrated below:
  609.  
  610.     BINPATH=C:\SRC\BIN\<space><newline>
  611.     LIBPATH=C:\SRC\LIB\<space><newline>
  612.  
  613. To illustrate the problems that can result if you do not put a space before the
  614. new-line character, assume that the macros above appear as shown below
  615. instead: 
  616.  
  617.     BINPATH=C:\SRC\BIN\<newline>
  618.     LIBPATH=C:\SRC\LIB\<newline>
  619.  
  620. Because a new-line character appears immediately after the backslash at the end
  621. of the first macro, MAKE assumes that you are defining the single macro shown
  622. below:
  623.  
  624.     BINPATH=C:\SRC\BIN\LIBPATH=C:\SRC\LIB\
  625.  
  626.  
  627.  
  628.         Microsoft STDERR Redirection Utility (ERROUT)
  629.  
  630. The ERROUT utility does not accept batch files. To redirect standard-error
  631. output from a batch file, you must enter a command of the following form:
  632.  
  633.     ERROUT COMMAND /c <batchcommand> 
  634.  
  635. If no /f option is given, then ERROUT redirects standard-error output to
  636. the standard-output device.
  637.  
  638.  
  639.             Mixed-Language Programming
  640.  
  641. Setting Up Calls to High-Level Languages
  642. ----------------------------------------
  643. Section 6.6 of the Microsoft Mixed-Language Programming Guide gives in-
  644. structions for setting up a call to a high-level language from assembly
  645. language.  Before you execute a call to a BASIC, Pascal, or FORTRAN routine,
  646. remember to declare an additional parameter if the return value is noninteger.
  647. This additional parameter must contain the offset address of the return value,
  648. for which you must allocate room within the stack segment (normally DGROUP,
  649. the same as the default data segment).
  650.  
  651.  
  652.                        The BIND Utility
  653.  
  654. Specifying Libraries
  655. --------------------
  656. You need to include DOSCALLS.LIB on the BIND command line. If
  657. DOSCALLS.LIB is not in the current directory, you must give the 
  658. complete path name to DOSCALLS.LIB.
  659.  
  660. BIND automatically searches for API.LIB by looking in directories
  661. listed in the LIB environment variable.  However, if API.LIB is
  662. specified on the command line, then BIND will not check the LIB
  663. environment variable; instead, you will need to give the complete
  664. path name.
  665.  
  666. For example, the following command line successfully uses BIND, if
  667. API.LIB is located in a directory listed in the LIB environment
  668. variable:
  669.  
  670. BIND FOO.EXE \LIB\DOSCALLS.LIB
  671.  
  672. Using BIND with Packed Files
  673. ----------------------------
  674. The version of BIND released with this package does not work with
  675. files that have been linked with the /EXEPACK linker option.
  676.  
  677. Running Bound Files with DOS 2.1
  678. --------------------------------
  679. A dual-mode executable file produced with BIND can be run in both
  680. DOS 3.x and DOS 2.x environments.  However, if you change the name
  681. of an executable file produced by BIND, then it will not run under
  682. DOS 2.1.
  683.  
  684.  
  685.                  The Microsoft Incremental Linker (ILINK)
  686.  
  687. ILINK Fatal Error Messages
  688. --------------------------
  689.  
  690. .sym seek error
  691. .sym read error
  692.  
  693.     The .SYM file is corrupted.  Do a full link.  If the error
  694.     persists, contact Microsoft.
  695.  
  696. .sym write error
  697.  
  698.     The disk is full or the .SYM file already exists with the
  699.     READONLY attribute.
  700.  
  701. map for segment <name> exceeds 64K
  702.  
  703.     The symbolic information associated with the given segment
  704.     exceeds 64K bytes, which is more than ILINK can handle.
  705.  
  706. can't ilink library <name>
  707.  
  708.         You tried to incrementally link an altered library.
  709.     ILINK does not link .LIB files but only .OBJ files.
  710.     Use a full link instead.
  711.  
  712. .obj close error
  713.  
  714.     The operating system returned an error when ILINK attempted
  715.     to close one of the .OBJ files.  Do a full link.  If the error
  716.     persists, contact Microsoft.
  717.  
  718. too many LNAMES in <modname>
  719.  
  720.     An object module has more than 255 LNAME records.
  721.  
  722. too many SEGDEFs in <modname>
  723.  
  724.     The given object module has more than 100 SEGDEF records.
  725.  
  726. too many GRPDEFs in <modname>
  727.  
  728.     The given object module has more than 10 GRPDEF records.
  729.  
  730. symbol <name> multiply defined
  731.  
  732.     The given symbol is defined more than once.
  733.  
  734. #3
  735.  
  736.     Please report this error to Microsoft.
  737.  
  738. Out of Memory
  739.  
  740.     ILINK ran out of memory for processing the input.  If you
  741.     are running ILINK under MAKE, try running it from the shell.
  742.     Otherwise, do a full link.
  743.  
  744. could not run exec
  745.  
  746.     ILINK was unable to find the file EXEC.EXE, which should be
  747.     placed somewhere in the search path or in the current
  748.     directory.
  749.  
  750. .exe file too big, change alignment
  751.  
  752.     The segment sector alignment value in the .EXE file is too
  753.     small to express the size of one of the segments.  Do a full
  754.     link and increase the alignment value with the /ALIGNMENT
  755.     option to LINK.
  756.  
  757. .ilk seek error
  758.  
  759.     The .ILK file is corrupted.  Do a full link.  If the error
  760.     persists, contact Microsoft.
  761.  
  762. Too many defined segments
  763.  
  764.     ILINK has a limit of 255 defined segments, which are segments
  765.     defined in an object module as opposed to an executable segment.
  766.     Reduce the number of segments if you want to use ILINK.
  767.  
  768. too many library files
  769.  
  770.     ILINK has a limit of 32 runtime libraries (.LIB files).  Reduce
  771.     the number of libraries.
  772.  
  773. too many modules
  774.  
  775.     ILINK has a limit of 1204 modules in a program.  Reduce the
  776.     number of modules.
  777.  
  778. .ilk write error
  779.  
  780.     The disk is full, or else ILINK cannot write to the .SYM file
  781.     because a .SYM file currently exists and has the READONLY attribute.
  782.  
  783. file <name> does not exist
  784.  
  785.     ILINK was unable to open the given file.  The file named was
  786.     in the file list in the .ILK file.
  787.  
  788. seek error on library
  789.  
  790.     A .LIB file was corrupted.  Do a full link and check your .LIB
  791.     files.
  792.  
  793. library close error
  794.  
  795.     The operating system returned an error when ILINK attempted
  796.     to close one of the .LIB files.  Do a full link.  If the error
  797.     persists, contact Microsoft.
  798.  
  799. error closing EXE file
  800.  
  801.     The operating system returned an error when ILINK attempted
  802.     to close the .EXE file.  Do a full link.  If the error
  803.     persists, contact Microsoft.
  804.  
  805. Invalid module reference <module>
  806.  
  807.     The program makes a dynamic link reference to a dynamic link
  808.     module which is not represented in the .EXE file.
  809.  
  810. could not update time on <filename>
  811.  
  812.     The operating system returned an error when ILINK attempted
  813.     to update the time on the given file.  Possibly the file had
  814.     the READONLY attribute set.
  815.  
  816. invalid flag <flag>
  817. only one -e command allowed
  818.  
  819.     The ILINK command syntax is incorrect.
  820.  
  821. User Abort
  822.  
  823.     The user issued CTRL+C or CTRL+BREAK.
  824.  
  825. file <name> write protected
  826.  
  827.     The .EXE, .ILK, or .SYM file needed to be updated and has the
  828.     READONLY attribute.  Change attribute to READWRITE.
  829.  
  830. file <name> missing
  831.  
  832.     One of the .OBJ files specified on the command line is missing.
  833.  
  834. file <name> invalid .OBJ format
  835. file <name> has invalid <recordtype> record
  836.  
  837.     The given .OBJ file has an invalid format or one that is not
  838.     recognized by ILINK.  This may have been caused by a compiler
  839.     or assembler.
  840.  
  841. file <module> was not full linked
  842.  
  843.     An .OBJ file was specified as input to ILINK, which was not in
  844.     the list of files in the original full link.
  845.  
  846. LOBYTE seg-relative fixups not supported
  847.  
  848.     This error message should occur only with MASM files.  See the
  849.     Microsoft Macro Assembler 5.0 Programmer's Guide. This type of
  850.     object module is not supported by ILINK.
  851.  
  852. <number> undefined symbols
  853.  
  854.     The given number of symbols were referred to in fixups but
  855.     never publicly defined in the program.
  856.  
  857. Incremental Violations
  858. ----------------------
  859. These errors cause a full link to occur if the -e option is used and -i
  860. is not used, else they are fatal errors:
  861.  
  862. symbol <name> deleted
  863.  
  864.     A symbol was deleted from an incrementally-linked module.
  865.  
  866. <modname> contains new SEGMENT
  867.  
  868.     A segment was added to the program.
  869.  
  870. <modname> contains changed segment <name>
  871.  
  872.     The segment contribution (code or data which the module
  873.     contributes to a segment) changed for the given module:    it
  874.     contributed to a segment it didn't previously contribute to,
  875.     or a contribution was removed.
  876.  
  877. <modname>'s segment <name> grew too big
  878.  
  879.     The given segment grew beyond the padding for the given module.
  880.  
  881. <modname> contains new GROUP <name>
  882.  
  883.     A new group was defined, via the GROUP directive in assembly
  884.     language or via the /ND C compiler option.
  885.  
  886. <modname> redefines group <name> to include <name>
  887.  
  888.     The members of the given group changed.
  889.  
  890. symbol <name> changed
  891.  
  892.     The given data symbol was moved.
  893.  
  894. can't add new communal data symbol <name>
  895.  
  896.     A new communal data symbol was added as an uninitialized variable
  897.     in C or with the COMM feature in MASM.
  898.  
  899. communal variable <name> grew too big
  900.  
  901.     The given communal variable changed size too much.
  902.  
  903. invalid symbol type for <name>
  904.  
  905.     A symbol which was previously code became data, or vice versa.
  906.  
  907. too many COMDEFS
  908. too many EXTDEFS
  909.  
  910.     The limit on the total of COMDEF records (communal data variables)
  911.     and EXTDEF records (external references) is 2000.
  912.  
  913. invalid CodeView information in .EXE file
  914.  
  915.     The CodeView information found is invalid.
  916.  
  917. <name> contains new Codeview symbolic info
  918.  
  919.     A module previously compiled without -Zi was compiled with -Zi.
  920.  
  921. <name> contains new linnum info
  922.  
  923.     A module previously compiled without -Zi or -Zd was compiled
  924.     with -Zi or -Zd.
  925.  
  926. <name> contains new public CV info
  927.  
  928.     New information on public-symbol addresses was added.
  929.  
  930. invalid .exe file
  931.  
  932.     The .EXE file is invalid.  Make sure you are using an up-to-date
  933.     linker.  If the error persists, contact Microsoft.
  934.  
  935. invalid .ilk file
  936. .ilk read error
  937. .ilk seek error
  938.  
  939.     The .ILK file is invalid.  Make sure you are using an up-to-date
  940.     linker.  If the error persists, contact Microsoft.
  941.  
  942. .SYM/.ILK mismatch
  943.  
  944.     The .SYM and .ILK files are out of sync.  Make sure you are using
  945.     an up-to-date linker.  If the error persists, contact Microsoft.
  946.  
  947. <libname> has changed
  948.  
  949.     The given library has changed.
  950.  
  951. can't link 64K-length segments
  952.  
  953.     ILINK cannot handle segments greater than 65,535 bytes long.
  954.  
  955. can't link iterated segments
  956.  
  957.     ILINK cannot handle programs linked with /EXEPACK.
  958.  
  959. Entry table expansion not implemented
  960.  
  961.     The program call tree changed in such a way that ILINK could
  962.     not handle it.
  963.  
  964. file <name> does not exist
  965.  
  966.     The .EXE, .SYM, or .ILK files are missing.
  967.  
  968. <name> has changed
  969.  
  970.     The given library module name has changed.
  971.  
  972. ILINK Warning messages
  973. ----------------------
  974.  
  975. Fixup frame relative to an (as yet) undefined symbol - assuming ok
  976.  
  977.     See documentation for LINK error messages L4001 and L4002,
  978.     in the Microsoft CodeView and Utilities manual.
  979.  
  980. <name> contains TYPEDEFs - ignored
  981. <name> contains BLKDEFs - ignored
  982.  
  983.     The .OBJ file contains records no longer supported by Microsoft
  984.     language compilers.
  985.  
  986. old .EXE free information lost
  987.  
  988.     The free list in the .EXE file has been corrupted.  The free
  989.     list keeps track of "holes" of free space in the EXE file.  These
  990.     holes are made available when segments are moved to new locations.
  991.  
  992. file <name> has no useful contribution
  993.  
  994.     The given module makes no contribution to any segment.
  995.  
  996. Main entry point moved
  997.  
  998.     The program starting address changed.  You may want to consider
  999.     doing a full link.
  1000.  
  1001.  
  1002.                              Microsoft Editor
  1003.  
  1004. Installing the Editor
  1005. ---------------------
  1006. The Microsoft Editor does not come with an MESETUP program. Instead,
  1007. run the setup program for the assembler. This program offers you choices
  1008. about how to set up the editor.
  1009.  
  1010. Keystroke Configurations
  1011. ------------------------
  1012. Some of the keystroke configurations listed in Table A.2 of the
  1013. Microsoft Editor User's Guide may need to be changed.
  1014.  
  1015. In the Quick/WordStar configuration, the Sinsert function is assigned
  1016. to ALT+INS, not CTRL+INS.
  1017.  
  1018. In the BRIEF configuration, the Plines function is assigned to CTRL+Z,
  1019. and the Refresh function is assigned to CTRL+].
  1020.  
  1021. In the EPSILON configuration, the Ppage function is assigned to PGDN,
  1022. and the Sdelete function is assigned to DEL and CTRL+D.
  1023.  
  1024. The Compile Function
  1025. --------------------
  1026. The commands
  1027.  
  1028.     Arg streamarg Compile
  1029.         Arg textarg Compile
  1030.  
  1031. each use the command specified by the extmake:text switch.  The
  1032. editor does not check the extension of the file name given as an
  1033. argument, but instead uses the "text" extension.  The streamarg
  1034. or textarg replaces a %s in the command.  These commands are typically
  1035. used to invoke MAKE.
  1036.  
  1037. The Setfile Function
  1038. --------------------
  1039. The commands that use Setfile, along with a streamarg or textarg,
  1040. accept a variety of input: either the name of a file, a file name
  1041. with a wild-card character (* or ?), the name of a directory, or the
  1042. name of a disk drive.  File names can also include environment variables,
  1043. such as $INIT.  If the streamarg or textarg is a directory name, then
  1044. the editor changes the current directory.  If the argument is a drive
  1045. name, then the editor changes the current drive.  Environment variables
  1046. are translated into directories to be searched for a file.  For example,
  1047. the following macro directs the editor to search the $INIT environment
  1048. variable in order to find the tools.ini file:
  1049.  
  1050.     tools.ini := Arg "$INIT:tools.ini" Setfile
  1051.     tools.ini :ctrl+j
  1052.  
  1053. Entering Strings in Macros
  1054. --------------------------
  1055. When you enter a text argument directly, no characters have special
  1056. meaning (except when the argument is interpreted as a regular
  1057. expression).  However, when you enter text as part of a macro, then
  1058. strings inside of quotes are interpreted according to the C string
  1059. format.  This format uses a backslash followed by double quotes (\")
  1060. to represent double quotes and it uses two backslashes (\\) to represent
  1061. a single backslash.  Therefore, to find the next occurrence of the string
  1062.  
  1063.     She wrote, "Here is a backslash: \ "
  1064.  
  1065. you could use the following macro definition:
  1066.  
  1067.     findit := Arg "She wrote, \"Here is a backslash: \\ \"" Psearch
  1068.  
  1069. Note that to indicate a backslash for a regular expression that is
  1070. also part of a macro definition, you must use four consecutive
  1071. backslashes.
  1072.  
  1073.  
  1074. Using Text Switches
  1075. -------------------
  1076. The text switches extmake and readonly each take a special
  1077. kind of syntax that allows you to specify drive, file name,
  1078. base name, or file extension. The syntax consists of the
  1079. characters:
  1080.  
  1081. %|<letters>F
  1082.  
  1083. where <letters> consists of any of the following: "p" for path,
  1084. "d" for drive, "f" for file base name, or "e" for file extension.
  1085. For example, if you are editing the file c:\dir1\sample.c, and you
  1086. make the following switch assignment:
  1087.  
  1088. extmake:c cl /Fod:%|pfF %|dfeF
  1089.  
  1090. then each time you give the command <Arg><Compile>, the editor
  1091. performs the following system-level command:
  1092.  
  1093. cl /Fod:\dir1\sample c:sample.c
  1094.  
  1095. The expression "%s" is equivalent to "%|feF" except that the former
  1096. only works once, whereas the latter can appear any number of times
  1097. in the extmake switch assignment. The expression "%|F" is equivalent
  1098. to "%|dpfeF".
  1099.  
  1100. The Filetab Switch
  1101. ------------------
  1102. The filetab switch is a numeric switch that determines how the
  1103. editor translates tabs when loading a file into memory.  The value
  1104. of the switch gives the number of spaces associated with each tab
  1105. column.  For example, the setting "filetab:4" assumes a tab column
  1106. every 4 positions on each line.  Every time the editor finds a tab
  1107. character in a file, it loads the buffer with the number of spaces
  1108. necessary to get to the next tab column.  Depending on the value of
  1109. the entab switch, the editor also uses the filetab switch to determine
  1110. how to convert spaces into tabs when writing to a file.  The default
  1111. value of filetab is 8.
  1112.  
  1113.  
  1114. Functions Callable by C Extensions
  1115. ----------------------------------
  1116. The following list summarizes functions from the standard compact-
  1117. memory-model library, which should work when called by a C-extension
  1118. module.  (The technique of programming C extensions is presented in 
  1119. Chapter 8 of the Microsoft Editor User's Guide.)  The memory model
  1120. of the extension is assumed to be /Asfu (small code pointers, far
  1121. data pointers, and stack segment unequal to data segment).  This list
  1122. uses the function categories from Chapter 4 of the Microsoft C
  1123. Optimizing Compiler Run-Time Library Reference (Version 4.0
  1124. or later.)
  1125.  
  1126. Buffer Manipulation: All functions can be called.
  1127.  
  1128. Character Classification and Conversion: All functions can be called.
  1129.  
  1130. Data Conversion: All functions can be called except for
  1131.  
  1132.      strtod()
  1133.  
  1134. Directory Control: All functions can be called except for
  1135.  
  1136.      getcwd()
  1137.  
  1138. File Handling: All functions can be called.
  1139.  
  1140. Low-Level I/O Routines: All functions can be called, but write()
  1141. will not work in binary mode.
  1142.  
  1143. Console and Port I/O: All functions can be called except for
  1144.  
  1145.      cgets()
  1146.      cprintf()
  1147.      cscanf()
  1148.  
  1149. Searching and Sorting: All functions can be called except for
  1150.  
  1151.      qsort()
  1152.  
  1153. String Manipulation: All functions can be called except for
  1154.  
  1155.      strdup()
  1156.  
  1157. BIOS Interface: All functions can be called.
  1158.  
  1159. MS-DOS Interface: All functions can be called except for
  1160.  
  1161.      int86()
  1162.      int86x()
  1163.  
  1164. Time: All functions can be called except for
  1165.  
  1166.      ctime()
  1167.      gmtime()
  1168.      localtime()
  1169.      utime()
  1170.  
  1171. Miscellaneous: All functions can be called except for
  1172.  
  1173.      assert()
  1174.      getenv()
  1175.      perror()
  1176.      putenv()
  1177.      _searchenv()
  1178.  
  1179.  
  1180. Linking Extensions in Protected Mode
  1181. --------------------------------------
  1182. To link C extension modules in protected mode, link with the
  1183. object file EXTHDRP.OBJ, instead of the real-mode header
  1184. EXTHDR.OBJ.
  1185.