home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l350 / 2.ddi / DOCS / 386ASM.DOC next >
Encoding:
Text File  |  1993-02-11  |  12.7 KB  |  352 lines

  1. This file documents differences between the 5.0 version of 
  2. 386|ASM and the second edition of the "386|ASM Reference Manual," 
  3. published in January 1991.
  4.  
  5.  
  6. Summary of New Features
  7. -----------------------
  8.  
  9. Command line switches:
  10.  
  11. -[80]386R    Specify target CPU of 80386 real mode.
  12. -[80]486    Specify target CPU of i486.
  13. -[80]486P    Specify target CPU of i486 with privileged instructions.
  14. -[80]486R    Specify target CPU of i486 real mode.
  15. -[80]586    Specify target CPU of Pentium.
  16. -[80]586P    Specify target CPU of Pentium with privileged instructions.
  17. -[80]586R    Specify target CPU of Pentium real mode.
  18. -CV[SYM]    Generate CodeView symbol information in the object file.  
  19.         CodeView symbol records are used for source code debugging.
  20. -LN[UM]        Generate line number records in the object file.  Line number 
  21.         records are used for source code debugging.
  22. -NOCV[SYM]    Do not generate CodeView symbol information in the object 
  23.         file.  This is the default.
  24. -NOLN[UM]    Do not generate line number records in the object file.  
  25.         This is the default.
  26. -NOSIGNLOGI    Disable generation of undocumented form of arithmetic 
  27.         instructions.
  28. -NOW[ARN]E[RR]    Causes 386|ASM to exit with success (exit value 0) if there
  29.         are only warning errors during an assembly.
  30. -PUBPARSE c    Remove specified character from front of public symbol 
  31.         definition records.
  32. -SIGNLOGI    Enable generation of undocumented form of arithmetic 
  33.         instructions.  This is the default.
  34. -W[ARN]E[RR]    Causes 386|ASM to return exit with an error (exit value 1)
  35.         if there are only warning errors during an assembly.  This 
  36.         is the default.
  37.  
  38. Directives:
  39.  
  40. .386R        Specify target as 80386 real mode.
  41. .486        Specify target as i486.
  42. .486P        Specify target as i486 with privileged instructions.
  43. .486R        Specify target as i486 real mode.
  44. .586        Specify target as Pentium.
  45. .586P        Specify target as Pentium with privileged instructions.
  46. .586R        Specify target as Pentium real mode.
  47. COMM {NEAR|FAR} name size{:count}
  48.         Allocate communal variables at link time.
  49. .NOSIGNLOGI    Disable generation of undocumented form of arithmetic 
  50.         instructions.
  51. OBJCOMMENT    flags,class,"string"
  52.         Puts a comment record in the output object module.
  53.         The directive specifies a flags and class byte for the
  54.         comment record, and a string of bytes in quotes to place
  55.         in the record.
  56. .PUBPARSE c    Remove specified character from front of public symbol 
  57.         definition records.
  58. .SIGNLOGI    Enable generation of undocumented form of arithmetic 
  59.         instructions.
  60.  
  61. Applications instructions:
  62.  
  63. BSWAP        Byte swap between big and little endian.
  64. XADD        Exchange and add.
  65. CMPXCHG        Compare and exchange.
  66. Additional instructions for Pentium processor, as documented by Intel.
  67.  
  68. System instructions:
  69.  
  70. INVD        Invalidate data cache.
  71. WBINVD        Write back and invalidate data cache.
  72. INVLPG        Invalid TLB entry.
  73. Additional instructions for Pentium processor, as documented by Intel.
  74.  
  75. Control registers:
  76.  
  77. CR4
  78.  
  79. Test registers:
  80.  
  81. TR3, TR4 and TR5
  82.  
  83.  
  84. Support for source code debugging
  85. ---------------------------------
  86.  
  87. 386|ASM can now generate source debug information for use by 
  88. source code debuggers.  This information is automatically included by 
  89. 386|LINK in output symbol table formats that can represent source 
  90. debug information (see the 386|LINK Reference Manual).  Generation 
  91. of source debug information is controlled with two pairs of switches.
  92.  
  93. The -LNUM switch causes line number records to be included in the 
  94. object file.  The -NOLNUM switch disables generation of line number 
  95. records;  this is the default.
  96.  
  97. The -CVSYM switch causes CodeView symbol information to be 
  98. included in the object file, and also causes line number records to be 
  99. included in the object file even if -NOLVNUM is selected.  The 
  100. -NOCVSYM switch disables generation of CodeView symbol 
  101. information;  this is the default.
  102.  
  103.  
  104. Support for i486 instruction set
  105. --------------------------------
  106.  
  107. Support has been added for the new i486 instructions as described in 
  108. the i486 Microprocessor Handbook.  The new applications 
  109. instructions are:
  110.  
  111.     BSWAP    Byte swap between big and little endian
  112.     XADD    Exchange and add
  113.     CMPXCHG    Compare and exchange.  The base opcode for the 80486 CMPXCHG 
  114.         instruction was changed from 0FA6h to 0FB0h from step A to 
  115.         step B of the 486.  386|ASM produces the 0FB0 form of the 
  116.         opcode which is valid on all 80486 CPUs which are step B1 
  117.         or later.
  118.  
  119. The new system instructions are:
  120.  
  121.     INVD    Invalidate data cache
  122.     WBINVD    Write back and invalidate data cache
  123.     INVLPG    Invalid TLB entry
  124.  
  125. In addition, 3 new test registers are available when assembling 
  126. privileged instructions for an 80486 target.  They are TR3, TR4, and 
  127. TR5.
  128.  
  129. These new instructions and registers can be enabled with both 
  130. command line switches and assembler directives.  The new command 
  131. line switches are:
  132.  
  133.     -80486
  134.     -80486P
  135.     -80486R
  136.  
  137. The new assembler directives are:
  138.  
  139.     .486
  140.     .486P
  141.     .486R
  142.  
  143. The new switches and directives are used in exactly the same way as 
  144. their 80386 counterparts (-80386, .386, etc.) as documented in the 
  145. 386|ASM Reference Manual.
  146.  
  147.  
  148. Support for Pentium instruction set
  149. -----------------------------------
  150.  
  151. Support has been added for the new Pentium instructions as described in 
  152. the Intel Pentium documentation.  The new applications instructions are:
  153.  
  154.     See the Intel documentation for the Pentium processor.
  155.  
  156. The new system instructions are:
  157.  
  158.     See the Intel documentation for the Pentium processor.
  159.  
  160. In addition, a new control register is available when assembling 
  161. privileged instructions for an 80586 target.  The new register is CR4.
  162.  
  163. These new instructions and registers can be enabled with both 
  164. command line switches and assembler directives.  The new command 
  165. line switches are:
  166.  
  167.     -80586
  168.     -80586P
  169.     -80586R
  170.  
  171. The new assembler directives are:
  172.  
  173.     .586
  174.     .586P
  175.     .586R
  176.  
  177. The new switches and directives are used in exactly the same way as 
  178. their 80386 counterparts (-80386, .386, etc.) as documented in the 
  179. 386|ASM Reference Manual.
  180.  
  181.  
  182. Support for real mode 80386 programs to use 32-bit 
  183. instruction operands and addressing modes
  184. --------------------------------------------------
  185.  
  186. A new directive and command line switch have been added to 
  187. 386|ASM to support programs which will execute in real mode and 
  188. want to use the 32-bit registers and addressing modes of the 386.  
  189. They enable the full 80386 instruction set, but cause the assembler to 
  190. force all segments for the assembly to be USE16.  The assembler 
  191. generates all the necessary override bytes for the 32-bit instructions, 
  192. and creates an 8086 style object module.  This object module can then 
  193. be linked into an existing real mode program with any existing 8086 
  194. linkers.  Thus a module which contains 32-bit arithmetic routines 
  195. could be added to an existing 8086 program.
  196.  
  197. The command line switch which enables 80386 instructions for real 
  198. mode is called -386R.  It is specified in the same way as any of the 
  199. other CPU switches.  The equivalent assembler directive is named 
  200. .386R, and is subject to the same positioning rules as the other CPU 
  201. directives.
  202.  
  203.  
  204. Support for COMM directive
  205. --------------------------
  206.  
  207. 386|ASM now supports the COMM directive for allocating communal 
  208. variables at link time.  A communal definition for a symbol is 
  209. equivalent to an external definition at assembly time.  The only 
  210. difference is that the linker will allocate the memory for the variable at 
  211. link time if there has not been a public definition for the symbol.  The 
  212. syntax of the directive is as follows:
  213.  
  214.     COMM {NEAR | FAR} name:size{:count}
  215.  
  216. The NEAR or FAR keyword is optional and specifies the segment in 
  217. which the communal symbol will reside.  (See section 6.2.4 of the 
  218. 386|LINK Reference Manual for a complete explanation.)  The name 
  219. parameter specifies the name of the communal symbol.  It must follow 
  220. the same conventions as those for an external symbol.  The size 
  221. parameter specifies the size of each element in the variable.  It can be 
  222. BYTE, WORD, DWORD, PWORD, QWORD, or TBYTE.  The 
  223. count parameter is optional and specifies the number of elements in the 
  224. variable.  If it is omitted, a count of 1 is assumed.
  225.  
  226. Communal variables are used by C compilers for uninitialized global 
  227. data which appears in the program's BSS.  They do not usually need 
  228. to be used in assembly language.
  229.  
  230.  
  231. .PUBPARSE directive and -PUBPARSE switch for public 
  232. symbol table management
  233. ---------------------------------------------------
  234.  
  235. A new directive and command line switch have been added which 
  236. cause a specified character to be removed from the front of public 
  237. symbol definition records for the module being assembled.  This 
  238. allows symbols to be referenced by one name inside the module being 
  239. assembled and by another name from external modules.  The name of 
  240. the command line switch is -PUBPARSE, and its syntax is:
  241.  
  242.     -PUBPARSE c
  243.  
  244. The name of the directive is .PUBPARSE, and its syntax is:
  245.  
  246.     .PUBPARSE c
  247.  
  248. Both the directive and command line switch take a single argument c 
  249. which specifies the character to remove from the front of public 
  250. symbols.
  251.  
  252. This feature is useful to create or reference global symbols which 
  253. conflict with assembler reserved words.  For example, a high level 
  254. language routine named "mov" could be referenced from assembly 
  255. language as "_mov" by using the directive ".PUBPARSE _"
  256.  
  257.  
  258. Adding segments to a previously defined group
  259. ---------------------------------------------
  260.  
  261. The GROUP directive can now be used to add additional segments to 
  262. an existing group.  For example, it is now legal to have the following 
  263. two statements in the same assembly language source file:
  264.  
  265.     dgroup    group    dseg
  266.     dgroup    group    dseg,stackseg
  267.  
  268.  
  269. Creating a text substitution symbol
  270. -----------------------------------
  271.  
  272. The EQU directive can now be used to create a text substitution 
  273. symbol with any arbitrary text, including text that resolves to an 
  274. integer value.  To force the EQU directive to create a text substitution 
  275. symbol, enclose the desired text in angle brackets.  For example,
  276.  
  277.     textsym    equ    <1 + 2 + 3>
  278.  
  279. creates a text substitution symbol with the value "1 + 2 + 3", while
  280.  
  281.     constsym equ    1 + 2 + 3
  282.  
  283. creates a constant symbol with the integer value 6.
  284.  
  285.  
  286. Support for sign extended immediate values for logical 
  287. instructions
  288. ------------------------------------------------------
  289.  
  290. Two new assembler switches and assembler directives have been 
  291. added to control the size of the immediate value field for the AND, 
  292. OR, and XOR logical instructions when they are used with register or 
  293. memory immediate addressing modes.  All Intel CPU's since the 8086 
  294. have supported a 1-byte sign-extended form of the immediate operand 
  295. for full sized register and memory operands (just like ADD, SUB, 
  296. etc.), yet the opcodes have never been documented.
  297.  
  298. The new switches -SIGNLOGI and -NOSIGNLOGI can be used to 
  299. respectively enable and disable generation of the undocumented form 
  300. of the instruction.  The new directives .SIGNLOGI and .NOSIGNLOGI 
  301. directives can be used inside a program with the same effect.
  302.  
  303. If none of the new switches or directives are used, the default 
  304. operation of 386|ASM is to use the sign-extended form of the 
  305. immediate value if possible, for compatibility with earlier versions of 
  306. 386|ASM and Microsoft MASM.
  307.  
  308.  
  309. Count register size specification for JCXZ and LOOP 
  310. instructions
  311. ---------------------------------------------------
  312.  
  313. The JCXZ and JECXZ instructions have been modified to generate 
  314. address size override bytes when the size of the count register (CX or 
  315. ECX) differs from the USE attribute (USE16 or USE32) for the code 
  316. segment.  Previously, the assembler incorrectly generated an operand 
  317. size override byte.
  318.  
  319. New versions of the LOOP instruction were added which specify the 
  320. size of the count register to be decremented and tested, regardless of 
  321. the USE attribute for the segment.  When these instructions are used, 
  322. the assembler will generate override bytes as necessary.  The new 
  323. LOOP instructions which specifically modify the CX register are:
  324.     LOOP16
  325.     LOOPE16
  326.     LOOPZ16
  327.     LOOPNE16
  328.     LOOPNZ16
  329.  
  330. The new LOOP instructions which specifically modify the ECX 
  331. register are:
  332.     LOOP32
  333.     LOOPE32
  334.     LOOPZ32
  335.     LOOPNE32
  336.     LOOPNZ32
  337.  
  338.  
  339. Example use of DT directive in 386|ASM Reference 
  340. Manual is incorrect
  341. ------------------------------------------------
  342.  
  343. The example of the use of the DUP operator with the DT directive in 
  344. section 6.3 of the 386|ASM Reference Manual is incorrect.  The DT 
  345. directive treats all numbers as packed decimal if the current default 
  346. radix is base 10.  Since packed decimal numbers cannot be used as a 
  347. count for the DUP operator, a radix specifier must be given for the 
  348. DUP count when using the DT directive.  The example in section 6.3 
  349. should read:
  350.  
  351.     nest1    DT 10d DUP(5d DUP (1.0))
  352.