home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_144 / 5.ddi / DOC.ZIP / MANUAL.TSM < prev    next >
Encoding:
Text File  |  1992-06-10  |  6.9 KB  |  227 lines

  1. Corrections/Additions for Turbo Assembler User's Guide
  2. -------------------------------------------------------
  3.  
  4. Correction
  5. ==============
  6. p. 333 in Appendix D, "Utilities," says that Turbo Assembler's online
  7. help facility is called TASMHELP. You can use TASMHELP as documented
  8. in the manual only if you install Turbo Assembler in a different
  9. directory than Borland C++. Otherwise, you should use the THELP
  10. utility, which has been modified so that you can access any of a
  11. variety of help files from a menu. 
  12.  
  13. Here's how you should use the THELP utility:
  14.  
  15. 1) After installing Borland C++ and Turbo Assembler, invoke THELP at
  16.    your DOS prompt.
  17.  
  18. 2) Type ALT-F to bring up the menu of available help files.
  19.  
  20. 3) Choose TASM.TAH to access help for Turbo Assembler.
  21.  
  22. New features for Turbo Assembler version 3.1
  23. ===============================================
  24.  
  25. Turbo Assembler version 3.1 now provides the following features:
  26.  
  27. 1. Extended SETFIELD and GETFIELD instructions
  28.  
  29.   The SETFIELD instruction no longer ORs the source value to itself
  30.   when your source and target registers are the same. Instead, 
  31.   SETFIELD will ensure that the fields of the target register
  32.   not being set will be zero.
  33.  
  34.   Similarly, if you're using the GETFIELD instruction when your
  35.   source and target registers are the same, the instruction will
  36.   not generate the nonfunctional MOV target, source instruction.
  37.  
  38. 2. Additional command-line options
  39.  
  40.   Turbo Assembler 3.1 now lets you specify additional object 
  41.   formats to use with particular linkers. The options are:
  42.  
  43.   Option    Meaning
  44.   ------    --------
  45.     /o        Output standard TLINK-compatible objects with overlay
  46.         support enabled.
  47.     /oi        Output IBM linker-compatible objects
  48.     /op        Output Phar Lap-compatible objects.
  49.     /os        Output standard TLINK-compatible objects without overlay
  50.         support. This is the default selection.
  51.  
  52. 3. New segment attribute and uninitialized segment warning
  53.  
  54.   Segment attribute UNINIT lets you see if you have inadvertently 
  55.   written initialized data to uninitialized data segments. Using 
  56.   this attribute as part of your segment description lets you 
  57.   produce a warning message to alert you of this problem.
  58.  
  59.   Here's an example of a segment directive using this new attribute:
  60.  
  61.        BSS SEGMENT PUBLIC WORD UNINIT 'BSS'
  62.  
  63.   The warning message that this directive will produce is
  64.  
  65.        Warning: Data or code written to uninitialized segment
  66.  
  67.   To disable this warning message, use the NOWARN UNI directive. You
  68.   can reenable the warning message by using the WARN UNI directive.
  69.  
  70. 4. PUSHSTATE and POPSTATE directives
  71.  
  72.   The PUSHSTATE directive saves the current operating state on an
  73.   internal stack that is 16 levels deep. PUSHSTATE is particularly
  74.   useful if you have code inside a macro that functions independently
  75.   of the current operating state, but does not affect the current
  76.   operating mode.
  77.  
  78.   The state information that Turbo Assembler saves consists of:
  79.  
  80.   o current emulation version (for example T310)
  81.   o mode selection (for example IDEAL, MASM, QUIRKS, MASM51)
  82.   o EMUL or NOEMUL switches
  83.   o current processor or coprocessor selection
  84.   o MULTERRS or NOMULTERRS switches
  85.   o SMART or NOSMART switches
  86.   o the current radix
  87.   o JUMPS or NOJUMPS switches
  88.   o LOCALS or NOLOCALS switches
  89.   o the current local symbol prefix
  90.  
  91.   Use the POPSTATE directive to return to the last saved state
  92.   from the stack.
  93.  
  94. ; PUSHSTATE and POPSTATE examples
  95.  
  96. ideal
  97. model small
  98. codeseg
  99.  
  100. jumps
  101. locals  @@
  102.  
  103.  
  104.         ; Show changing processor selection, number radix, and JUMPS mode
  105.         pushstate
  106.         nojumps
  107.         radix   2          ; Set to binary radix
  108.         p386
  109.         jl      next1      ; No extra NOPS after this
  110.         mov     eax,100    ; Now 100 means binary 100 or 4 decimal.
  111. next1:
  112.         popstate           ; Restores JUMPS and non 386 mode.
  113.  
  114.         ; Back to jumps directive, no 386, and decimal radix
  115.         jl      next2      ; Three extra NOPS to handle JUMPS
  116.         xor     eax,eax    ; Not in 386 mode anymore!
  117.  
  118.         mov     cx,100     ; Now 100 means decimal 100
  119.  
  120.         pushstate
  121.         MULTERRS
  122.         mov     ax,[bp+abc
  123.         popstate
  124.  
  125.         mov     ax,[bp+abc
  126.  
  127.  
  128.         ; Show disabling local scoping of symbols
  129.         locals
  130. next2:
  131. @@a:    loop @@a
  132. next3:
  133. @@a:    loop @@a           ; Allowed because of scoping of NEXT2: and NEXT3:
  134.  
  135.         pushstate
  136.         nolocals
  137. next4:
  138. @@b:    loop @@b
  139. next5:
  140. @@b:    loop @@b           ; This will conflict because of nolocals
  141.         popstate
  142.  
  143.  
  144.  
  145.         ; Show changing local symbol prefix and MASM/IDEAL mode
  146.         pushstate
  147.         masm
  148.         locals @$
  149.  
  150. testproc proc              ; MASM mode for procedure declaration
  151.          jmp    @$end
  152.  
  153. @$end:   nop
  154. @@end:   ret
  155. testproc endp
  156.  
  157. testproc2 proc
  158.         jmp    @$end
  159. @$end:  nop                ; This doesn't conflict with label in TESTPROC
  160. @@end:  ret                ; This label does conflict
  161. testproc2 endp
  162.         popstate
  163.  
  164.  
  165.         ; Now back to @@ as a local label prefix, and IDEAL mode
  166. testproc2b  proc           ; This wont work since we are back in IDEAL mode!
  167.         ret
  168. testproc2b  endp           ; And this will give an error also.
  169.  
  170. proc    testproc3
  171.         jmp    @$end2
  172. @$end2: nop
  173. @@end2: ret
  174. endp    testproc3
  175.  
  176. proc    testproc4
  177.         jmp    @$end2
  178. @$end2: nop                ; This label does conflict
  179. @@end2: ret                ; This label doesn't conflict with
  180.                            ;   label in TESTPROC3
  181. endp    testproc4
  182.  
  183. end
  184.  
  185.  
  186. 5. New processor directives
  187.  
  188.   New processor directives added to accomodate use of the 486SX
  189.   chip are:
  190.  
  191.   .487    Enables assembly of 487 numeric processor instructions.
  192.           This instruction works only in MASM mode.
  193.   P487    Enables assembly of 487 numeric processor instructions.
  194.           This instruction works in both MASM and Ideal modes.
  195.  
  196. 6. Text Equate Substitution
  197.  
  198.   TASM 3.1 introduces changes to the way text equates are substituted,
  199.   for increased MASM compatibility. This may make old code produce
  200.   errors with TASM 3.1. There are two possible remedies:
  201.  
  202.      1) Use the /UT300 command line directive to select TASM 3.0 style
  203.         processing.
  204.  
  205.      2) Explicitly use the % text macro substitution operator at the
  206.         start of lines that cause errors with TASM 3.1 but not TASM 3.0.
  207.  
  208.   An example of this is in the WHEREIS example files. For WHEREIS, the
  209.   model size is defined on the commandline like this:
  210.       TASM /dMDL=small iwhereis.asm
  211.  
  212.   Then within IWHEREIS.ASM, the code checks to make sure that MDL has
  213.   been defined, and if it has, the following line of code was used with
  214.   TASM 3.0:
  215.  
  216.       model MDL
  217.  
  218.   TASM 3.0 automatically substituted the value of MDL before evaluating
  219.   the expression. TASM 3.1 now requires you to explicitly use the
  220.   % operator, like this:
  221.  
  222.     % model MDL
  223.  
  224.  
  225.  
  226.  
  227.