home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / PASCAL / TPA22.ZIP / TP&ASM2.REF < prev    next >
Encoding:
Text File  |  1989-04-22  |  22.8 KB  |  658 lines

  1.  
  2.   TP&Asm           Integrated Compile-Time Assembler          Version 2.0
  3.   TP&Asm-M   Memory Mode Assembly Language Development Tool   Version 2.0
  4.  
  5.                 Copyright (c) 1989  Richard W. Prescott
  6.                           All Rights Reserved
  7.  
  8. ═══════ Built-In Assembly Language Support for Turbo Pascal Compilers ═══════
  9.  
  10.  All brand and product names mentioned herein are trademarks or registered
  11.                 trademarks of their respective holders.
  12.  
  13.   ┌─────────────────────────────────────────────────────────────────────┐
  14.   │ This file contains detailed reference information to enable you to  │
  15.   │ make effective use of the TP&Asm assembly environment.  For general │
  16.   │ information on getting started please see the file README.          │
  17.   └─────────────────────────────────────────────────────────────────────┘
  18.  
  19.  
  20. The following topics are described below:
  21.  
  22.     8. Error Messages
  23.     9. Trouble Shooting
  24.  
  25.  
  26. The following additional topics are covered in the separate file
  27. TP&ASM.REF:
  28.  
  29.     1. Command Line Options
  30.     2. The Assemble Statement
  31.     3. The Asm Statement
  32.     4. The Internal Statement
  33.     5. General Assembler Syntax
  34.     6. TP&Asm-specific Options
  35.     7. Supported Mnemonics
  36.  
  37.  
  38.  
  39.  
  40. 8. Error Messages
  41.  
  42. The following is an alphabetical listing of all syntax error
  43. messages generated by the current version of TP&Asm, together with
  44. very brief explanations of messages which are not self-explanitory.
  45. All assembler syntax errors use error number 200.
  46.  
  47.  
  48.  
  49. [Symbol] Must be declared FORWARD or in INTERFACE
  50.   INTERNAL Assembly PROCs must be defined in your Pascal Code
  51.  
  52. "Dd $" Not Permitted
  53.  
  54. "Proc/Function + Offset" Not Allowed
  55.   The Turbo linker does not permit reference to Pascal Procedures
  56.   and Functions with non-zero numeric offsets.
  57.  
  58. (INTERNAL) Cannot refer to parameters/result by name
  59. (INTERNAL) Proc definition expected
  60.  
  61. (WARNING) Altered BP May Prevent Local Variable Access
  62. (WARNING) Altered Ds May Prevent Access to Turbo VARs
  63. (WARNING) Altered Seg May Prevent Access to Turbo VARs
  64.   Ss and Bp must be restored before referencing Local variables and
  65.   parameters by name.  Ds must be restored before referencing Global
  66.   variables and Typed Constants by name.
  67.  
  68. (WARNING) ES may be undefined
  69.   You have explicitly or implicitly (via a String mnemonic) used the
  70.   Es register without initializing it.
  71.  
  72. (WARNING) May Require Segment Override
  73.   TP&Asm will use the default segment for indexed memory references
  74.   which do not contain a named variable offset.  The default segment
  75.   is Ss for references involving the Bp register, and Ds for all
  76.   others.
  77.  
  78. (WARNING) Possible invalid operand or forward reference
  79.  
  80. Assembler Symbol Overflow
  81.   You have attempted to define more than 4K of symbols in the
  82.   current Assembly block or Internal PROC.  Break into smaller
  83.   blocks or convert some code or data labels to Pascal using
  84.   LABEL and VAR statements.
  85.  
  86. Bad Identifier Character
  87. Bad Identifier Start
  88.   TP&Asm Code and Data labels may contain only alphanumeric
  89.   characters and the special characters @, _, $, and ?.  They
  90.   must begin with a letter, @, or _.
  91.  
  92. Base or Index Register Required
  93.   When Presumptions are disabled you must supply a proper index
  94.   register (usually [Bp]) to reference local VARs.
  95.  
  96. BY requires Byte operand
  97. Byte operand required
  98.  
  99. Cannot Call Short
  100.   The processor does not support a two byte Call instruction
  101.  
  102. Cannot DUP Address Reference
  103. Cannot DUP Forward Reference
  104.  
  105. Cannot EQUate to Assembly Variable
  106. Cannot EQUate to Forward Symbol
  107. Cannot EQUate to Pascal Symbol
  108.   Operands to EQU must be numeric expressions or indexed memory
  109.   references.
  110.  
  111. Cannot Nest Far Procs
  112.   All Assemble PROCs and nested INTERNAL PROCs must be NEAR.
  113.  
  114. Cannot nest address reference
  115. Cannot Nest Memory Reference
  116. Cannot Nest Pascal Symbols
  117.   Parentheses may contain ONLY constants and numeric expressions.
  118.  
  119. Cannot Pop CS
  120.  
  121. Code Label Duplicates Pascal Symbol
  122.   Since TP&Asm allows forward references to Code labels, Code labels
  123.   must be unique from all Pascal symbols.  Data labels may redefine
  124.   Pascal symbols (within the current Assemble/Internal statement).
  125.  
  126. Colon or data size specifier required
  127.   Code labels require ':' or 'PROC'.  Data labels require a data
  128.   definition directive (DB, DW, DD, EQU) or size qualifier (B, W,
  129.   Byte Ptr, etc).
  130.  
  131. CsData MUST be First Code in Unit
  132.   A Procedure or Function BEGIN block has preceded the CsData
  133.   statement.  The CsData statement, if used, must be the first
  134.   code block in the program or unit.
  135.  
  136. Data Name expected
  137.   Labels are required in Data Segment data allocation statements
  138.  
  139. Duplicate Label
  140. Empty quote
  141. ENDP Expected
  142.  
  143. EQUate to CODE Symbol not supported
  144.   Operands to EQU must be numeric expressions or indexed memory
  145.   references.
  146.  
  147. Error In Define Data
  148.  
  149. Error in IF statement
  150.   A conditional statement in an (Assembly) Inline directive/MACRO
  151.   generated no code or exceeded 127 bytes.
  152.  
  153. Error In Jump Statement
  154.   The operand to a Call or Jmp must be a single Pascal or Assembly
  155.   label, a single Pascal Procedure or Function identifier, or a
  156.   variable or memory expression.
  157.  
  158. Error in Mnemonic
  159.   Invalid symbol found in mnemonic field
  160.  
  161. Full record specification required
  162.   References to record components must be prefixed by a valid
  163.   Record Variable or TYPE qualifier, as discussed in the notes
  164.   to the section on General Assembler Syntax.
  165.  
  166. Incorrect Syntax
  167.   When the 'Offset' qualifier is used, the DESTINATION operand
  168.   must be a Register;  'Mov Var1,Offset Var2' is not permitted.
  169.  
  170. INTERNAL Identifier required before NewLine
  171.   You must specify a unique Pascal identifier on the same line as
  172.   the keyword 'Internal'.  See sample file INTERNAL.PAS.
  173.  
  174. Invalid Absolute CSeg Reference in Assembly MACRO
  175.   Inline Directives must not make direct reference to code or data
  176.   labels except in Direct control transfer instructions.
  177.  
  178. Invalid Absolute CSeg Reference
  179.   Location counter ($) references and data type references to code
  180.   and data labels are permitted only in the FIRST code block within
  181.   any program or unit.  Location counter ($) references are not
  182.   permitted in Jumps or EQUates, nor in (Assembly) Inline directive/
  183.   MACROS.  Note: THIS MESSAGE MAY INDICATE AN UNDEFINED PASCAL
  184.   SYMBOL.  If the undefined symbol is a forward referenced ASSEMBLY
  185.   symbol, move the code to the FIRST Proc/Function in the Program or
  186.   Unit.
  187.  
  188. Invalid Address Reference
  189.   You have specified a sum or difference of symbol names that does
  190.   not resolve to a valid address, displacement, or pure constant.
  191.   NOTE: Mov Ax,PasVar1+PasVar2 is not valid because it instructs the
  192.   assembler to place MemW[Dseg: OFS(PasVar1) +OFS(PasVar2)] into Ax.
  193.   ( Instead you must: Mov Ax,PasVar1  and then: Add AX,PasVar2 ).
  194.   Please consult a reference on assembly language programming.
  195.  
  196. Invalid Base Specification [BX] + (implicit) [BP]
  197.   Disable presumptions to use [BX] in place of the presumed [BP]
  198.   indexing for local variables.  (an Ss override will then be
  199.   required, as the processor default segment for [Bx] is Ds).
  200.  
  201. Invalid BIT Syntax
  202.   Example:  Or Dx,Bit 6 ; same as Or Dx,64
  203.  
  204. Invalid Byte/Word Combination
  205.   Use B or W to override defined variable size:
  206.     Mov Al,B IntegerVar
  207.     Mov Ax,Word Ptr ByteVar
  208.  
  209. Invalid Byte/Word/Dword Combination
  210.   You have attempted to use a DWord POINTER as a Byte or Word VALUE,
  211.   or the reverse. (Remember that VAR parameters are DWord Pointers).
  212.   Use B, W, or D to override defined variable size.
  213.  
  214. Invalid Code Reference
  215.   Within the FIRST code block, expressions of the form
  216.     "label1-label2+numeric offset"
  217.   are permitted, where the labels are code or data labels within the
  218.   current assemble statement.
  219.  
  220. Invalid Conditional Transfer to Proc/Function
  221.   Pascal Procedure and Function identifiers are not permitted as
  222.   operands to conditional jumps and loops.
  223.  
  224. Invalid define string operation
  225.   Arithmetic is not permitted on DB strings with length >= 2.
  226.  
  227. Invalid Final Jump or Forward Reference
  228.   TP&Asm does not permit the LAST statement in an (Assembly) Inline
  229.   directive/MACRO to be a zero displacement jump or forward
  230.   reference.
  231.  
  232. Invalid Forward Absolute CSeg Reference
  233.   THIS MESSAGE MAY INDICATE AN UNDEFINED PASCAL SYMBOL.  If the
  234.   undefined symbol is a forward referenced Assembly symbol, move
  235.   the code to the FIRST Proc/Function in the Program or Unit.
  236.  
  237. Invalid Forward Reference in ASM Statement
  238.   Forward reference to undefined labels is not permitted in an
  239.   ASM statement.
  240.  
  241. Invalid Forward Symbol
  242.   Assembly Data labels cannot be forward referenced.  Forward
  243.   Reference to Code labels is permitted only in the FIRST code
  244.   block in a Program or Unit.
  245.  
  246. Invalid IF Condition
  247. Invalid IF Syntax
  248.   Example: IF A Xor Cx,Cx ;  Valid conditions are formed by removing
  249.   the 'J' from any conditional jump mnemonic EXCEPT jCXZ.
  250.  
  251.  
  252. Invalid Indirect Option
  253. Invalid Indirect Register
  254.   Indexed memory expressions can combine one base (Bx OR Bp), one
  255.   index (Si OR Di), and a numeric or symbolic offset.  In addition,
  256.   a segment override and a memory size qualifier may be specified.
  257.   Examples:  Inc B Es:[Bx+Di+SymName+2] ;  Shl SymName[Si],1 ;  etc.
  258.  
  259. Invalid Jmp Specification
  260.  
  261. Invalid Label or Proc/Function in Memory Reference
  262.   Pascal Labels and Procedure and Function identifiers are not
  263.   permitted in memory expressions.
  264.  
  265. Invalid memory operation
  266.   Arithmetic on memory references is limited to addition and
  267.   subtraction.  Four function arithmetic is supported for constants
  268.   and numeric expressions only.
  269.  
  270. Invalid Numeric Format
  271.  
  272. Invalid Offset to Pascal Proc/Function Reference
  273.   The Turbo linker does not permit reference to Pascal Procedures
  274.   and Functions with non-zero numeric offsets.
  275.  
  276. Invalid operand
  277. Invalid operand combination
  278. Invalid operand or forward reference
  279.   Please see USAGE.PAS for examples of valid operands for the given
  280.   mnemonic and/or consult an assembly language reference.
  281.  
  282. Invalid prefix combination
  283.   The processor does not support LOCK + repeat prefix
  284.  
  285. Invalid Proc/Function Call in Assembly MACRO
  286.   Inline Directives cannot make direct calls to Pascal Procedures
  287.   and Functions.  Indirect calls are permitted.
  288.  
  289. Invalid quoted operand
  290.   Quoted operands used as constants in numeric expressions must have
  291.   length 1 or 2.  Example: Add Al,'A'-1;  Quoted WORD operands have
  292.   most significant CHAR first, thus:  Mov Ax,'Ax';  puts 'x' in AL.
  293.   Note that  DB 'ab';  and  DW 'ba';  BOTH store the 'a' first since
  294.   Word data is stored in 'Byte-reverse' format.
  295.  
  296. Invalid Reference in Assembly MACRO
  297.   Inline Directives must not make direct reference to code or data
  298.   labels except in Direct control transfer instructions.
  299.  
  300. Invalid Reference to Pascal Label
  301.   Pascal labels may not be referenced in data manipulation
  302.   instructions.  For example, "Mov Bx,Offset PasLabel" is not
  303.   permitted.  "Mov Bx,Offset AsmLabel" is permitted in the FIRST
  304.   code block of a Program or Unit.
  305.  
  306. Invalid Relocatable Reference in Assembly MACRO
  307.   Inline Directives cannot make reference to Pascal Procedure
  308.   and Function offsets.  VAR and (Typed) CONST offsets are
  309.   permitted.
  310.  
  311. Invalid SEG Syntax
  312.   Only "SEG DATA" is permitted.
  313.  
  314. Invalid Segment Operation
  315.   Segment registers are allowed as operands to PUSH, POP, and MOV.
  316.  
  317. Invalid Shift Count
  318.   The 8086/88 processor supports only 'shift by 1' and 'shift by CL'
  319.   TP&Asm supports 'shift by n' by coding repeated shifts.  The shift
  320.   count n must be in [1..15].  NOTE: This coding convenience OFTEN
  321.   generates longer and slower code than a shift using CL.
  322.  
  323. Invalid statement in CsData
  324.   CsData permits only data allocation statements: Db, Dw, and Dd.
  325.  
  326. Invalid Symbol
  327.   Possible invalid forward data reference
  328.  
  329. Invalid syntax
  330.   A colon is not permitted within parentheses.
  331.  
  332. Invalid TP&Asm Directive
  333.   The combination ;# is reserved for TP&Asm directives.
  334.  
  335. Invalid use of > or <
  336.   > and < may be used only as prefixes to valid Pascal symbols or
  337.   (> only) a valid Assembly code label.
  338.  
  339. Invalid Use of String Prefix
  340.   Only string mnemonics allow repeat prefixes.
  341.  
  342. Invalid use of Type Qualifier
  343.   Record TYPE qualifiers must be followed by a "." and a valid
  344.   component for the given TYPE, with no embedded spaces.
  345.  
  346. Invalid use of Unit Qualifier
  347.   UnitName qualifiers must be followed by a "." and a Global
  348.   Pascal identifier from the appropriate Unit, with no embedded
  349.   spaces.
  350.  
  351. Label or Proc/Function Reference Required
  352.   The operand to a Direct Call or Jmp must be a single Pascal
  353.   or Assembly label or a single Pascal Procedure or Function
  354.   identifier.
  355.  
  356. MemArray Reference Not Supported
  357.  
  358. Memory operand required
  359.   LEA, LDS, and LES require the source operand to be a memory
  360.   expression.
  361.  
  362. Mismatched Parentheses
  363.  
  364. Multiple Memory Reference
  365.   The processor does not support memory to memory operations.
  366.   Note however that Movsb and Cmpsb are effectively memory to memory
  367.   versions of Mov and Cmp.
  368.  
  369. Multiple Prefix
  370. Multiple Segment Override
  371. Multiple Segment Prefix
  372.   Conflicting multiple prefix specifications is an error.  (TP&Asm
  373.   supports Segment+Repeat prefix combinations, however, by coding
  374.   an appropriate loop).
  375.  
  376. Multiple segments not allowed
  377.   Assemble allows at most one (optional) Segment statement.
  378.   Internal allows one (optional) Data Segment and one (required)
  379.   Code segment.  DSeg and CSeg are acceptable synonyms for "Data"
  380.   and "Code".
  381.  
  382. Nested BY Not Allowed
  383. Nested DUP not allowed
  384. Nested IFs not allowed
  385.  
  386. Nesting limit exceeded
  387.   TP&Asm supports 5 levels of parentheses.
  388.  
  389. No Code Assembled
  390.   An Assemble statement or Internal PROC generated no output code.
  391.  
  392. Output Line Code Limit Exceeded
  393.   A single assembly source line is limited to 28 bytes of output
  394.   code and/or 5 relocatable references.  Long DB strings should be
  395.   broken or declared in Pascal.  Push, Pop, Dw, etc, with repeated
  396.   operands may (very rarely) need to be coded with fewer repeats on
  397.   a single line.  (Total output for the entire assembly is NOT
  398.   LIMITED).
  399.  
  400. Parentheses not allowed in memory expressions
  401.  
  402. PAS Statement Invalid in INTERNAL
  403.   The PAS statement is not permitted within Internal PROCs.
  404.  
  405. PortArray Reference Not Supported
  406.  
  407. Proc Model does not match prior definition
  408.   You have used PROC NEAR in an Internal statement but the Pascal
  409.   declaration was FAR (or the reverse).
  410.  
  411. Quotes MisMatch
  412.  
  413. Record Component Expected
  414.  
  415. Reserved Word Error
  416.  
  417. Short Jump Out Of Range
  418.   Conditional jumps in (Assembly) Inline directive/MACROs are
  419.   limited to about 127 bytes forward or back.
  420.  
  421. Specify CMPSB or CMPSW
  422. Specify LODSB or LODSW
  423. Specify MOVSB or MOVSW
  424. Specify SCASB or SCASW
  425. Specify STOSB or STOSW
  426. Specify Word Or Byte
  427.  
  428. SysFunc Reference Not Supported
  429. SysProc Reference Not Supported
  430.   Non-standard System Proc/Functions cannot be called from assembly
  431.   language.
  432.  
  433. TP&Asm: Memory Mode Version cannot Compile to Disk
  434. Unrecognized Mnemonic
  435.  
  436. Unresolved Reference to [Symbol]
  437.   A reference was made to a symbol that was never defined in Pascal
  438.   or Assembly.  Forward reference to assembly labels which are not
  439.   defined in a Pascal LABEL statement must be resolved within the
  440.   current Assemble statement or Internal PROC.
  441.  
  442. Unsupported ORG Value
  443.   TP&Asm ignores ORG except to report an error if the specified
  444.   value is not 0 or $100.
  445.  
  446. Unsupported Radix Value
  447.   TP&Asm supports Radix 10 and Radix 16.
  448.  
  449. Unsupported Reserved Word
  450.  
  451.  
  452.  
  453. 9. Trouble Shooting
  454.  
  455.  
  456. Examining the TP&Asm Assembly.
  457.  
  458. The utility program EXAMINE.EXE in the archive TP-XMN is provided
  459. to facilitate verification that the TP&Asm Assembler has correctly
  460. assembled your assembly source code.  When used in conjunction with
  461. DEBUG.COM (on your DOS disk) it generates a "side by side" display
  462. of each Pascal or assembly source statement together with its
  463. corresponding DEBUG disassembly.  The disassembly you see is the
  464. same as you would get if you simply used DEBUG.COM to directly
  465. disassemble the compiled EXE file.  By displaying each piece of the
  466. disassembly alongside the corresponding assembly source statement,
  467. it is a simple matter to compare the two to verify proper assembly.
  468. Command line options permit you to limit the output to a range
  469. containing the assembly code, and to direct the output to the
  470. screen, printer, or a file.
  471.  
  472. EXAMINE.EXE requires a compiled EXE file and a MAP file as produced
  473. by Turbo/TPC Version 5.0 or Turbo/TPC Version 4.0 together with
  474. TPMAP.  Please refer to the file EXAMINE.DOC in the archive TP-XMN
  475. (or on your distribution disk) for instructions on how to use
  476. EXAMINE.EXE.
  477.  
  478. Full source code to EXAMINE.EXE is provided to registered users of
  479. TP&Asm.
  480.  
  481. The TP&Asm assembly may also be examined using a symbolic debugger
  482. such as the Turbo Debugger.  Since TP&Asm is fully integrated with
  483. Turbo Pascal, MAP files produced with both Version 4.0 and 5.0
  484. compilers contain Line Number detail for all assembly sections
  485. (Except [Assembly] Inline Directive/MACROs), permitting source level
  486. debugging in any MAP-file compatible debugger.
  487.  
  488.  
  489. Trouble Shooting Using a Debugger.
  490.  
  491. Turbo Pascal Version 5.0 provides an integrated debugger within the
  492. Integrated Development Environment.  Since Built-in assembly support
  493. was not anticipated, however, the integrated debugger provides no
  494. means of monitoring the state of the CPU registers and flags.
  495. TP&Asm/TP&Asm-M provides support for monitoring and modifying the
  496. CPU registers and flags through the Unit ASMWATCH which is provided
  497. on the distribution disk and in the archive TP-ASM.
  498.  
  499.  
  500. Version 5.0 Users: Using ASMWATCH.
  501.  
  502. With Turbo Version 5.0, you can trace (F7 Trace into, F4 Go to
  503. cursor, etc) your assembly code in the turbo integrated debugger.
  504. The unit  ASMWATCH.TPU  defines the record variable CPU which
  505. permits you to Watch, Evaluate, and Modify the state of all CPU
  506. registers and Flags as you Trace.  Simply include the statement
  507. "Uses ASMWATCH;" at the start of your program.
  508.  
  509. The details of the ASMWATCH interface section are given below.
  510. The following is a series of sample Watch expressions which are
  511. particularly useful.  These watch expressions may be copied into
  512. your source files to simplify setting the Watches - simply place
  513. the cursor in column 1, Hit <Ctrl><F7>, and cursor right to get
  514. the entire Watch Expression.
  515.  
  516. CPU.CsIp,p       - Segment:Offset of the current instruction
  517. CPU.CsIp^,m      - Hex Dump beginning at current instruction
  518. CPU.Flags-On     - Current state of CPU Flags
  519. CPU.SsSp,P       - Segment:Offset of the Stack Pointer
  520. W(CPU.SsSp^),$   - Memory Dump at current Stack Pointer
  521. CPU,$R           - Lists all register names and contents
  522. CPU.Si,$   (etc) - List contents of any Byte or Word Register
  523.  
  524. In these expressions, Pointers, Words, and Bytes are displayed in
  525. Hexidecimal.  The CPU Flags are displayed as a Pascal Set, eg:
  526.  
  527.    [C,P,A,Z,S,I,D]
  528.  
  529. where:
  530.  
  531.    C = Carry       [Bit 0]
  532.    P = Parity      [Bit 2]
  533.    A = Auxiliary   [Bit 4]
  534.    Z = Zero        [Bit 6]
  535.    S = Sign        [Bit 7]
  536.    T = Trace       [Bit 8]
  537.    I = Interrupts  [Bit 9]
  538.    D = Direction   [Bit 10]
  539.    O = Overflow    [Bit 11]
  540.  
  541. The set "On" is defined to be the set of "Don't Care" bits in the
  542. CPU Flags Word.  It can be used as in the sample above to supress
  543. the display of these "Don't Care" Flags.
  544.  
  545. To Modify a CPU Register:
  546.  
  547.    1) Hit <Ctrl><F4>, type (for example):  CPU.AX,$
  548.       and press <Enter>.  The current value of the Ax
  549.       register will appear in the Result Box.
  550.  
  551.    2) Move the cursor to the New value Box, type
  552.       (for example):  $1234   and press <Enter>.
  553.       The value of Ax will change to $1234.
  554.  
  555.    3) Again in the New value Box, type:  CPU.BX
  556.       and press <Enter>.  You have accomplished
  557.       the immediate instruction "Mov Ax,Bx".
  558.  
  559. To Modify the CPU Flags:
  560.  
  561.    1) Hit <Ctrl><F4>, type:   CPU.Flags
  562.       and press <Enter>.  The current state of the
  563.       CPU Flags (including the "Don't Care" bits)
  564.       will appear in the Result Box.
  565.  
  566.    2) Move the cursor to the New value Box, and
  567.       type (for example):
  568.         CPU.Flags - [Z]  - to Clear the Zero Flag
  569.         CPU.Flags + [C]  - to Set the Carry Flag
  570.  
  571.  
  572.  
  573. Type Definitions from ASMWATCH.TPU
  574. (The variable CPU above is of type CPUType):
  575.  
  576. TYPE FgBits = (C,X1,P,X3,A,X5,Z,S,T,I,D,O,X12,X13,X14,X15);
  577. Const On = [X1,X3,X5,X12..X15];
  578. TYPE W = ARRAY[0..32] OF WORD;
  579.  
  580. TYPE CPUType = RECORD
  581.  Case Integer OF
  582.   1: (Ax,Bx,Cx,Dx,Bp,Si,Di,Ds,Es,Ip,Cs,Fg,Sp,Ss :Word);
  583.   2: (Al,Ah,Bl,Bh,Cl,Ch,Dl,Dh : Byte);
  584.   3: (dum18 :Array[1..18] of byte;
  585.       CsIp : Pointer;
  586.       Flags : Set of FgBits;
  587.       SsSp : Pointer;);
  588. END;
  589.  
  590.  
  591. Source code for the Unit AsmWatch is available upon request to
  592. registered users of TP&Asm or TP&Asm-M.
  593.  
  594.  
  595.  
  596. Version 4.0 Users: Making do with DEBUG.
  597.  
  598. Version 4.0 users can use DEBUG or another external assembler from
  599. within the Integrated Environment.  The idea is to run Turbo within
  600. the debugger and place an "Int 3" instruction in the source code
  601. which will be trapped by the debugger when your source program is
  602. Run in memory.
  603.  
  604. For this technique it is ESSENTIAL that you run the debugger from
  605. TP&Asm (as shown below) rather than the other way around.  The
  606. following examples illustrate the proper syntax:
  607.  
  608. TPAM d turbo                <-- to use DEBUG.COM
  609. - OR -
  610. TPAM <debugger> turbo.exe   <-- to use an alternate Debugger
  611.  
  612. (TPA can of course be used in place of TPAM, above)
  613.  
  614. Note:
  615.  
  616. Some debuggers take certain liberties with the operating system
  617. that can interfere with the proper operation of TP&Asm.  If you
  618. experience difficulty with this technique, try using the standard
  619. debugger DEBUG.COM on your DOS system disk.
  620.  
  621. Once inside the Editor environment, insert an INT 3 (Trap to
  622. External debugger) into the Assemble/Internal statement under
  623. examination, as shown in the example below:
  624.  
  625.  
  626. PROCEDURE Test(VAR SourceString,DestString: St80; Count: Byte);
  627. Assemble
  628. Int 3   ;--> Trap to External debugger
  629. Mov Cx,Count
  630. Lds Si,SourceString
  631. Les Di,DestString
  632. Rep Movsb
  633. <etc>
  634.  
  635.  
  636. Before continuing: save, Save, SAVE ANY CHANGES!
  637.  
  638. Now Run in Memory.  The debugger will Trap and display the Int 3
  639. instruction.
  640.  
  641. At this point you can:
  642.  - display the disassembly to verify TP&Asm's assembly  - OR -
  643.  - skip past the Int 3 (or patch it from Hex CC to Hex 90 (Nop) ),
  644.    and then trace your assembly code instruction by instruction.
  645.  
  646. Please refer to the instructions provided with your debugger for
  647. information on how to disassemble, trace, and restart your runtime
  648. code.
  649.  
  650. If your assembly code has serious errors as discovered in the
  651. process of tracing, it may not be possible to restart with a 'g'
  652. instruction and return to the editor.  In that case you may need
  653. to Quit 'q' from the debugger, which will effectively ABORT turbo
  654. without saving.  Assuming that you heeded the call to Save, Save,
  655. Save, above, this presents no problem - and you can now return to
  656. the editor environment armed with the knowledge (from the trace)
  657. necessary to fix your assembly code (and retest).
  658.