home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c220 / 7.ddi / DOCS / 386ASM.DOC next >
Encoding:
Text File  |  1991-03-26  |  10.8 KB  |  297 lines

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