home *** CD-ROM | disk | FTP | other *** search
/ New Star Software Collection / NSS_Collection.iso / 5-029 turbo debugger and assem / disks.7z / 4 / HELPME!.DOC < prev    next >
Encoding:
Text File  |  1988-08-28  |  10.7 KB  |  252 lines

  1. TURBO ASSEMBLER 1.0: ANSWERS TO COMMON QUESTIONS
  2. ------------------------------------------------
  3.  
  4.   The following are tips, tricks, and hints you may find useful
  5.   when using Turbo Assembler.
  6.  
  7.  
  8.  Q. How do I install Turbo Assembler?
  9.  A. Run the INSTALL program from the TURBO ASSEMBLER/INSTALLATION
  10.     disk. To start the installation, change your current drive to
  11.     the one that has the install program on it and type INSTALL.
  12.     You will be given instructions in a box at the bottom of the
  13.     screen for each prompt. For example, if you will be
  14.     installing from drive A:, type
  15.  
  16.       A:
  17.       INSTALL
  18.  
  19.     At this point, the INSTALL program will appear with menu
  20.     selections and descriptions to guide you through the
  21.     installation process.
  22.  
  23.  Q. When should I use the different assembly modes TASM provides
  24.     for existing assembly programs?
  25.  A. Mode                   Conditions for Use
  26.     -------------------------------------------------------------
  27.     Normal(MASM)         - Program assembles under MASM 4.00 or
  28.                            MASM 5.00.
  29.     Quirks               - Program assembles under MASM 4.00 or
  30.                            MASM 5.00, but won't assemble under
  31.                            TASM without MASM51 or QUIRKS.
  32.     Masm51               - Program requires MASM 5.1 for assembly.
  33.     Masm51 and Quirks    - Program requires MASM 5.1 for
  34.                            assembly, but will not assemble
  35.                            under TASM with only the MASM51
  36.                            switch set.
  37.  
  38.  Q. Do I have to use MASM51 to assemble files written for MASM
  39.     5.1?
  40.  A. Most files will assemble even without using the MASM51
  41.     directive. However if your assembly code utilizes features
  42.     only found in MASM 5.1 you will need to use the MASM51 mode.
  43.     Check the list below to see which features of MASM51
  44.     emulation are enabled by combinations of MASM51 and QUIRKS
  45.     modes.
  46.  
  47.  Q. What are the items controlled by the QUIRKS and MASM51 mode?
  48.  A. The following table lists what the various combinations of
  49.     QUIRKS and MASM51 modes do:
  50.  
  51.     Mode                   Operations
  52.     -------------------------------------------------------------
  53.     Quirks               - Allows FAR jumps to be generated as
  54.                            NEAR or SHORT if CS assumes agree.
  55.                          - Allows all instruction sizes to be
  56.                            determined in a binary operation solely
  57.                            by a register, if present.
  58.                          - Destroys OFFSET, segment override,
  59.                            etc., information on '=' or numeric 'EQU'
  60.                            assignments.
  61.                          - Forces EQU assignments to expressions
  62.                            with "PTR" or ":" in them to be text.
  63.  
  64.     Masm51               - Instr, Catstr, Substr, Sizestr, and
  65.                            "\" line continuation are all enabled.
  66.                          - EQU's to keywords are made TEXT
  67.                            instead of ALIASes.
  68.                          - Leading whitespace is not discarded
  69.                            on %textmacro in macro arguments.
  70.  
  71.     Masm51 and Quirks    - Everything listed under QUIRKS above.
  72.                          - Everything listed under MASM51 above.
  73.                          - @@, @F, and @B local labels are
  74.                            enabled.
  75.                          - Procedure names are PUBLIC'ed
  76.                            automatically in extended MODELs.
  77.                          - Near labels in PROCs are redefinable
  78.                            in other PROCs.
  79.                          - "::" operator is enabled to define
  80.                            symbols that can be reached outside of
  81.                            current proc.
  82.  
  83.     Masm51 and Ideal     - Ideal mode syntax and the Masm51 text
  84.                            macro directives are supported, i.e.,
  85.                            Instr, Catstr, Substr, and Sizestr.
  86.  
  87.   Q. When should I use the DOSSEG or .STACK directives?
  88.   A. When you're developing Turbo Assembler modules to link with
  89.      high-level languages as Turbo C and Turbo Pascal, don't use
  90.      the DOSSEG or .STACK directives as these compilers will
  91.      handle segment-ordering and stack setup. These directives
  92.      define segment names and order that might conflict with
  93.      those used by the high-level language. You only need,
  94.      however, to define these once in any module of a stand-alone
  95.      assembler program. DOSSEG is only needed if you want your
  96.      segments to be ordered using Microsoft's conventions. You
  97.      can define your own segment-ordering by insuring that your
  98.      segments are encountered by TLINK in the order that you
  99.      wish. See the TLINK section of the manual for a full
  100.      description of how this works.
  101.  
  102.   Q. What options should I use when I use Turbo Assembler to
  103.      assemble the files that came with the Microsoft C Compiler.
  104.   A. When assembling assembly language modules provided with the
  105.      Microsoft compilers, make sure to use the MASM51 and QUIRKS
  106.      modes. For example,
  107.  
  108.        tasm /jmasm51 /jquirks filename
  109.  
  110.   Q. How do I create a .COM file?
  111.   A. Your assembler source should be assembled in the tiny model
  112.      (.MODEL TINY) and should include an ORG 100h following the
  113.      opening of the code segment as shown below:
  114.  
  115.                 .MODEL  TINY
  116.                 .CODE
  117.                 ORG     100h
  118.         start:
  119.                 ....          ; body of program
  120.         ENDS    start         ; defines the entry point as start
  121.         END
  122.  
  123.      Don't include a .STACK directive in a program designed to be
  124.      a .COM.
  125.  
  126.      TLINK will create a .COM file instead of an .EXE file if the /t
  127.      option is specified. For example,
  128.  
  129.         tlink -t SHOW87
  130.  
  131.      will create SHOW87.COM instead of SHOW87.EXE.
  132.  
  133.      There are certain limitations in converting an .EXE file to a
  134.      .COM file. These limitations are documented in the IBM Disk
  135.      Operating System manual under EXE2BIN.
  136.  
  137.   Q. How do I assemble multiple files with Turbo Assembler?
  138.   A. Turbo Assembler will assemble multiple files using either
  139.      wildcard characters or when they are separated by the plus
  140.      (+) character. As an example, the following command line
  141.  
  142.        tasm filt + o*
  143.  
  144.      would assemble the file FILT.ASM as well as all the .ASM
  145.      files beginning with the letter 'o'.
  146.  
  147.   Q. How can I assemble multiple files if they don't all use the
  148.      same command-line options?
  149.   A. Turbo Assembler uses the semicolon (;) character as a
  150.      command-line separator so that you can actually have
  151.      multiple assembler command lines on a single DOS command
  152.      line. As an example, the following command line
  153.  
  154.        tasm /zi filt; o*
  155.  
  156.      would assemble the file FILT.ASM with debug information
  157.      turned on, then assemble all the .ASM files beginning with
  158.      the letter 'o' without debug information.
  159.  
  160.   Q. Microsoft Macro Assembler allows me to define environment
  161.      variables so I don't have to enter them on every command
  162.      line. Can I also do this with Turbo Assembler?
  163.   A. No, but Turbo Assembler provides an even more flexible way to
  164.      eliminate typing in command-line options every time. Every
  165.      time you run Turbo Assembler, it looks in the current
  166.      directory, then in the directory from which it was started
  167.      (DOS 3.x and greater) for a special file called TASM.CFG
  168.      that can contain anything that the command line contains.
  169.      This file is processed first and then the command line is
  170.      processed so that the command-line options take priority
  171.      over those found in the TASM.CFG configuration file. If, for
  172.      instance, your command-line options are always
  173.  
  174.        /t /ml /zi /jJUMPS /jLOCALS
  175.  
  176.      You could create TASM.CFG file containing these lines
  177.  
  178.        /t
  179.        /ml
  180.        /zi
  181.        /jJUMPS
  182.        /jLOCALS
  183.  
  184.      Now, every time you run Turbo Assembler, those will be the
  185.      default options. This means that, if you need to, you can
  186.      have separate TASM.CFG files for each of your projects. If
  187.      you have multiple projects residing in a single subdirectory,
  188.      then you could create a separate configuration file for each
  189.      and use them as Turbo Assembler indirect command files.
  190.  
  191.   Q. What are Turbo Assembler indirect command files?
  192.   A. These are files that contain partial or complete Turbo
  193.      Assembler command lines and are preceded with an at-sign (@)
  194.      on the command line. For example, if you have a file named
  195.      "FILE.CMD" that contains the following:
  196.  
  197.        /t
  198.        /ml
  199.        /zi
  200.        /jJUMPS
  201.        /jLOCALS
  202.        file1 +
  203.        file2 +
  204.        file3 +
  205.        file4
  206.  
  207.      then you could use the command line
  208.  
  209.        tasm @FILE.CMD
  210.  
  211.      instead of the command line
  212.  
  213.        tasm /t /ml /zi /jJUMPS /jLOCALS file1+file2+file3+file4
  214.  
  215.      Note that the at-sign (@) is not actually part of the file's
  216.      name In fact, if you name a file name so that it starts with
  217.      an at-sign, Turbo Assembler will treat it as an indirect
  218.      command file.
  219.  
  220.   Q. I am linking my own assembly language functions with Turbo C.
  221.      The linker reports that all of my functions are undefined.
  222.   A. Make sure that you have put an underbar character (_) in
  223.      front of all assembly language function names to be called
  224.      by Turbo C. If you use simplified segmentation and include
  225.      the C language specifier on the .MODEL directive, Turbo
  226.      Assembler will pre-append the underbar automatically for you.
  227.      Your assembly language program should be assembled with Case
  228.      Sensitivity (/ML or /MX). See Chapter 6, "Interfacing
  229.      Turbo Assembler with Turbo C" in the Turbo Assembler User's
  230.      Guide for details.
  231.  
  232.   Q. Can I use the backslash (\) instead of the slash (/) as a
  233.      option specifier?
  234.   A. NO! Turbo Assembler (and MASM) will treat that as a file
  235.      that resides in the root directory of the default drive.
  236.      Since both assemblers treat the space character ( ) the same
  237.      as a comma (,) this could result in loss of files. If you
  238.      accidentally gave this command line:
  239.  
  240.       tasm \zi prid&joy.asm
  241.  
  242.      Turbo Assembler (and MASM) would treat this command line as
  243.      instructions to assemble a file called ZI.ASM that can be
  244.      found in the root directory and create an output file in the
  245.      current directory called PRID&JOY.ASM (note that the
  246.      assemblers think the default extension for the object file
  247.      of .OBJ has been explicitly overridden to .ASM). The file
  248.      PRID&JOY.ASM will either be overwritten with the object file
  249.      or deleted if the file \ZI.ASM can't be found and success-
  250.      fully assembled. In either case, the original contents of
  251.      PRID&JOY.ASM are now lost.
  252.