TSM HELP, Studia, Assembler

[ Pobierz całość w formacie PDF ]
/*************************************************************************/TSM_HELP.TXTTURBO ASSEMBLERThis file contains answers to common questions concerning Turbo Assembler.Q. When should I use the different assembly modes TASM providesfor existing assembly programs?A. Mode Conditions for Use-------------------------------------------------------------Normal(MASM) - Program assembles under MASM 4.00 orMASM 5.00.Quirks - Program assembles under MASM 4.00 orMASM 5.00, but won't assemble underTASM without MASM51 or QUIRKS.Masm51 - Program requires MASM 5.1 for assembly.Masm51 and Quirks - Program requires MASM 5.1 forassembly, but will not assembleunder TASM with only the MASM51switch set.Q. Do I have to use MASM51 to assemble files written for MASM5.1?A. Most files will assemble even without using the MASM51directive. However if your assembly code utilizes featuresonly found in MASM 5.1, you will need to use the MASM51 mode.Check the table in the next Q&A to see which features of MASM51emulation are enabled by combinations of MASM51 and QUIRKSmodes.Q. What items are controlled by the QUIRKS and MASM51 modes?A. The following table lists what the various combinations ofQUIRKS and MASM51 modes do:Mode Operations-------------------------------------------------------------Quirks - Allows FAR jumps to be generated asNEAR or SHORT if CS assumes agree.- Allows all instruction sizes to bedetermined in a binary operation solelyby a register, if present.- Destroys OFFSET, segment override,etc., information on '=' or numeric 'EQU'assignments.- Forces EQU assignments to expressionsthat contain "PTR" or ":" to be text.Masm51 - Instr, Catstr, Substr, Sizestr, and"\" line continuation are all enabled.- EQU's to keywords are made TEXTinstead of ALIASes.- Leading whitespace is not discardedon %textmacro in macro arguments.Masm51 and Quirks - Everything listed under QUIRKS above.- Everything listed under MASM51 above.- @@, @F, and @B local labels areenabled.- Procedure names are PUBLIC'edautomatically in extended MODELs.- Near labels in PROCs are redefinablein other PROCs.- "::" operator is enabled to definesymbols that can be reached outside ofcurrent proc.Masm51 and Ideal - Ideal mode syntax and the Masm51 textmacro directives are supported, i.e.,Instr, Catstr, Substr, and Sizestr.Q. When should I use the DOSSEG or .STACK directives?A. When you're developing Turbo Assembler modules to link withhigh-level languages like Turbo C++ and Turbo Pascal, youdon't need the DOSSEG or .STACK directives because thesecompilers will handle segment-ordering and stack setup.These directives define segment names and order that mightconflict with those used by the high-level language. Youonly need, however, to define these once in any module of astandalone assembler program. DOSSEG is only needed if youwant your segments to be ordered using Microsoft'sconventions. You can define your own segment-ordering byensuring that your segments are encountered by TLINK in theorder that you wish. See the TLINK section of the manual fora full description of how this works.Q. What options should I use when I use Turbo Assembler toassemble the files that came with the Microsoft C Compiler?A. When assembling the assembly language modules provided with theMicrosoft compilers, make sure to use the MASM51 and QUIRKSmodes. For example,tasm /jmasm51 /jquirks filenameQ. How do I create a .COM file?A. Your assembler source should be assembled in the tiny model(.MODEL TINY) and should include an ORG 100h following theopening of the code segment, as shown below:.MODEL TINY.CODEORG 100hstart:.... ; body of programEND start ; defines the entry point as startDon't include a .STACK directive in a program designed to bea .COM.TLINK will create a .COM file instead of an .EXE file if the /toption is specified. For example,tlink /t SHOW87will create SHOW87.COM instead of SHOW87.EXE.There are certain limitations in converting an .EXE file to a.COM file. These limitations are documented in the IBM DiskOperating System manual under EXE2BIN.Q. How do I assemble multiple files with Turbo Assembler?A. Turbo Assembler will assemble multiple files using wildcardcharacters or separating them by the plus (+) character.As an example, the following command linetasm filt + o*would assemble the file FILT.ASM, as well as all the .ASMfiles beginning with the letter 'o'.Q. How can I assemble multiple files if they don't all use thesame command-line options?A. Turbo Assembler uses the semicolon (;) character as acommand-line separator so that you can actually havemultiple assembler command lines on a single DOS commandline. As an example, the following command linetasm /zi filt; o*would assemble the file FILT.ASM with debug informationturned on, then assemble all the .ASM files beginning withthe letter 'o' without debug information.Q. Microsoft's Macro Assembler allows me to define environmentvariables so I don't have to enter them on every commandline. Can I do this with Turbo Assembler as well?A. No, but Turbo Assembler provides an even more flexible wayto eliminate typing in command-line options every time.Whenever you run Turbo Assembler, it looks in the currentdirectory, then in the directory from which it was started(DOS 3.x and greater) for a special file called TASM.CFG.This file can contain anything that the command linecontains. This file is processed first and then the commandline so that the command-line options take priority overthose found in the TASM.CFG configuration file. If, forinstance, your command-line options are always/t /ml /zi /jJUMPS /jLOCALSyou could create TASM.CFG file containing these lines/t/ml/zi/jJUMPS/jLOCALSNow, every time you run Turbo Assembler, those will be thedefault options. This means that, if you need to, you canhave separate TASM.CFG files for each of your projects. Ifyou have multiple projects residing in a single subdirectory,then you could create a separate configuration file for eachand use them as Turbo Assembler indirect command files.Q. What are Turbo Assembler indirect command files?A. These are files that contain partial or complete TurboAssembler command lines and are preceded with an at-sign (@)on the command line. For example, if you have a file named"FILE.CMD" that contains the following,/t/ml/zi/jJUMPS/jLOCALSfile1 +file2 +file3 +file4then you could use the command linetasm @FILE.CMDinstead of the command linetasm /t /ml /zi /jJUMPS /jLOCALS file1+file2+file3+file4Note that the at-sign (@) is not actually part of the file'sname. In fact, if you name a file with an at-sign at thebeginning, Turbo Assembler will treat it as an indirectcommand file.Q. I am linking my own assembly language functions with Turbo C.Why does the linker report that all of my functions areundefined?A. Make sure you've put an underbar character (_) in frontof all assembly language function names to be calledby Turbo C. If you use simplified segmentation and includethe C language specifier on the .MODEL directive, TurboAssembler will pre-append the underbar automatically for you.Your assembly language program should be assembled with CaseSensitivity (/ML or /MX).Q. Can I use the backslash (\) instead of the slash (/) as aoption specifier?A. NO! Turbo Assembler (and MASM) will treat that as a filethat resides in the root directory of the default drive.Since both assemblers treat the space character ( ) as acomma (,) this could result in the loss of files. If youaccidentally gave this command line,tasm \zi prid&joy.asmTurbo Assembler (and MASM) would treat this command line asinstructions to assemble a file called ZI.ASM that can befound in the root directory and create an output file in thecurrent directory called PRID&JOY.ASM. (Note that the... [ Pobierz całość w formacie PDF ]
  • zanotowane.pl
  • doc.pisz.pl
  • pdf.pisz.pl
  • cs-sysunia.htw.pl