FORTRAN Debugging Technique Reference Manual November 1986 This document describes the purpose of and explains how to use the FORTRAN Debugging Technique. OPERATING SYSTEM: RT-11 Version 5.4 FORTRAN IV Version 2.8 SOFTWARE: FDT Version 2.1 digital equipment corporation . maynard, massachusetts Page 2 First Printing, September 1978 Revised, June 1980 Revised, October 1981 Revised, November 1986 The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation. Digital Equipment Corporation assumes no responsibility for any errors that may appear in this document. The software described in this document is furnished under a license and may be used or copied only in accordance with the terms of such license. Digital Equipment Corporation assumes no responsibility for the use or reliability of its software on equipment that is not supplied by DIGITAL or its affiliated companies. Copyright C , 1978, 1980, 1981, 1986, Digital Equipment Corporation. All Rights Reserved. The following are trademarks of Digital Equipment Corporation: DIGITAL DECsystem-10 MASSBUS DEC DECSYSTEM-20 MINC-11 PDP DECtape OMNIBUS DECUS DIBOL OS/8 UNIBUS EDUSYSTEM PHA COMPUTER LABS FLIP CHIP RSTS COMTEX FOCAL RSX DDT INDAC TYPESET-8 DECCOMM LAB-8 TYPESET-11 ASSIST-11 DECSYSTEM-20 TMS-11 RTS-8 ITPS-10 Page 3 CONTENTS Page PREFACE CHAPTER 1 INTRODUCTION 1-1 1.1 USING FDT 1-1 1.2 FDT COMMAND TYPES 1-2 1.2.1 Program Control Commands 1-3 1.2.2 Information Transfer Commands 1-3 1.2.3 FDT Control Commands 1-3 1.3 FDT CONVENTIONS AND TERMINOLOGY 1-3 1.3.1 Syntax Conventions 1-3 1.3.2 Current Procedure 1-4 1.3.3 The Location Specification 1-5 1.3.4 Mode Codes 1-7 1.3.5 FDT Pauses 1-10 1.4 CAUTIONS AND PITFALLS 1-11 CHAPTER 2 DESCRIPTION OF THE FDT COMMANDS 2-1 2.1 ACCEPT 2-2 2.2 CONTINUE 2-5 2.3 DIMENSION 2-6 2.4 ERASE 2-7 2.5 GOTO 2-8 2.6 IF 2-9 2.7 MACRO 2-10 2.8 NAME 2-12 2.9 PAUSE 2-13 2.10 RESET 2-16 2.11 START 2-17 2.12 STEP 2-18 2.13 STOP 2-19 2.14 TYPE 2-20 2.15 WATCH 2-21 2.16 WHAT 2-22 Page 4 CONTENTS (CONT.) Page CHAPTER 3 ADVANCED TECHNIQUES 3-1 3.1 NAMED COMMON 3-1 3.2 HOW FDT GENERATES ADDRESSES 3-2 3.2.1 Octal Offsets 3-2 3.2.2 Names 3-3 3.2.3 Relative Addressing 3-3 3.2.4 Subscript Addressing 3-4 3.2.5 Indirect Addressing 3-4 3.3 FORMAT CONVERSION ROUTINES 3-4 3.4 ON-LINE DEBUGGING TECHNIQUE (ODT) 3-4 3.5 EXECUTION SPEED 3-5 CHAPTER 4 INSTALLATION AND VERIFICATION PROCEDURES 4-1 4.1 PREPARING TO USE THE FORTRAN DEBUGGING TECHNIQUE 4-1 4.2 ASSUMPTIONS MADE 4-1 4.3 INSTALLING FDT 4-2 4.3.1 Copying the Distribution Kit 4-2 4.3.2 Copying With Only Two Mass Storage Devices 4-3 4.3.3 File Protection 4-3 4.3.4 Applying Corrections 4-3 4.4 VERIFYING YOUR FDT SOFTWARE 4-4 4.5 CREATING A PROGRAM THAT USES FDT 4-6 APPENDIX A FDT COMMAND SUMMARY A-1 APPENDIX B FDT LOCATION SPECIFICATION FORMATS B-1 APPENDIX C FDT MODES C-1 APPENDIX D FDT ERROR MESSAGES D-1 INDEX Index-1 TABLES TABLE 1-1 FDT Mode Codes 1-8 Page 5 _______ PREFACE MANUAL OBJECTIVES AND READER ASSUMPTIONS This manual describes the FORTRAN Debugging Technique (FDT), an interactive debugging tool that you can use to make corrections to your FORTRAN programs. FDT runs on any PDP 11 with FORTRAN IV under the RT-11 operating system (Single Job (SJ) or Foreground/Background (F/B) monitor). FDT requires approximately 2K words of memory space during a debugging session. To use FDT successfully, you must know the FORTRAN IV programming language. You need not know details of internal data formats, machine operation, or the FORTRAN compilation process. MANUAL STRUCTURE The FORTRAN Debugging Technique Reference Manual contains four chapters and four appendixes. Chapter 1 introduces FDT and explains how to use the manual. Chapter 2 describes the FDT commands. Chapter 3 describes advanced techniques you can use with FDT. Chapter 4 explains how to install, test, and use FDT with your FORTRAN programs under the RT-11 operating system. Appendix A contains an alphabetical list of the FDT commands with their arguments and descriptions. Appendix B lists the FDT location specification formats and their meaning. Appendix C lists FDT modes, the FORTRAN data type each mode represents, and a description of each mode. Appendix D lists FDT error messages and describes the error that caused each message. Page 6 RELATED DOCUMENTS The following documents provide more information about the RT-11 operating system and the FORTRAN IV programming language. Reference Order Number PDP-11 FORTRAN Language Reference Manual AA-1855D-TC RT-11/RSTS/E FORTRAN IV User's Guide AA-5749B-TC RT-11 Programmer's Reference Manual AA-H378A-TC RT-11 Software Support Manual AA-H379A-TC RT-11 System User's Guide AA-5279B-TC RT-11 System Message Manual AA-5284C-TC DOCUMENTATION CONVENTIONS The following conventions apply to this manual: o In programming examples, all information the computer prints appears in black. All commands and responses you type appear in red. o means you must press the RETURN key on your terminal. o You produce certain characters by typing a combination of keys together. For example, hold down the CTRL key and type the letter C to produce the CTRL/C character. Combinations such as this are documented as . o Many commands in this manual contain the expression dvn:. When you execute the commands, specify a device and unit number in place of dvn:. If you do not include a unit number, the system uses unit 0 as a default. For a list of devices and their abbreviations, see Chapter 3 _____ ______ ______ _____ of the RT-11 System User's Guide. o In examples of commands or file names, capital letters represent actual commands, file names, or file types, which you must type exactly as shown. Lower case letters mean that you must supply a name. CHAPTER 1 ____________ INTRODUCTION The FORTRAN Debugging Technique (FDT) is an interactive debugging tool for FORTRAN IV programs. FDT gives you step-by-step control of the execution of your program and the ability to examine and change the contents of any variable in your program during program execution. This manual describes FDT and explains how to use it with your FORTRAN IV programs. The manual contains four chapters and four appendixes. The chapters explain how to use FDT and describe the FDT commands. Commands are arranged alphabetically for easy reference. The command name appears in large, boldface letters at the top of the page where the command description begins. In addition, the chapters describe some advanced techniques for using FDT and tell you how to install, verify, and use FDT with your FORTRAN IV programs under the RT-11 operating system. The appendixes summarize the FDT commands and list FDT location specification formats, FDT modes, and FDT error messages. _____ ___ 1.1 USING FDT The FDT software is contained in the file FDT.OBJ. Distributed with FDT.OBJ is FDTVER.FOR, a FORTRAN source file which you use to test the FDT software and verify that you installed FDT properly. If you have a program that does not work use the following procedure to begin an FDT debugging session. For complete information on installing, testing, and using FDT with your FORTRAN IV programs, see Chapter 4. 1. Compile your program. You must use the FORTRAN compiler option that produces threaded code; FDT does not work with inline code. Do not use the compiler option that suppresses internal statement numbers because FDT needs them. Obtain a source program listing and a storage map listing. You do not need the generated code listing. ____________ INTRODUCTION Page 1-2 2. Link your program units. Include FDT among the input files to be linked. If you are using overlays, place FDT in the root segment of your program. Generate a linker map if your program has named common blocks or assembly language subroutines that you might need to examine. ____________ INTRODUCTION Page 1-3 3. Run your program. FDT takes control and executes an automatic FDT pause before the first executable statement of the program. The following message is typed on the terminal: FDT V02-01 FDT PAUSE AT ISN xx IN mainprog ! where: xx is the internal statement number of the first executable statement in the FORTRAN program. mainprog is the main program being debugged. FDT refers to the main program with the name assigned to it in the FORTRAN PROGRAM statement. If you do not use the PROGRAM statement to name the program, FDT uses the default main program name, .MAIN. ! is the prompt FDT issues to indicate it is ready to accept a command. NOTE If you do not follow these steps, FDT may not be able to get control, and the program will then run without FDT. Sometimes FDT gets only partial control (as happens when the main program is compiled without internal statement numbers) and cannot continue. In this case, FDT issues the message FDT START FAIL and exits to the monitor. 4. Begin debugging your program. Type the FDT commands that you have decided to use to start solving your problem. At this point, you must type at least one command that causes an FDT pause. Otherwise, the program runs to completion without allowing you to enter any FDT commands. If you want to execute your program without FDT intervention, type CONTINUE or START. ___ _______ _____ 1.2 FDT COMMAND TYPES There are three types of FDT commands: o Program control commands ____________ INTRODUCTION Page 1-4 o Information transfer commands o FDT control commands ____________ INTRODUCTION Page 1-5 _______ _______ ________ 1.2.1 Program Control Commands Program control commands allow you to control the execution of your FORTRAN program. You can use the program control commands to halt program execution, to continue with the next executable statement or restart from the beginning, to step through the program one or more statements at a time, or to end a debugging session and exit to the operating system monitor. The program control commands are: START, STOP, CONTINUE, STEP, PAUSE, RESET, and WATCH. ___________ ________ ________ 1.2.2 Information Transfer Commands Information transfer commands allow you to examine the contents of any variable or array element in your program and to modify its value. As part of the command, you can define the data type of the variable, so that the contents of the variable appear in familiar notation (see Section 1.3.4 on mode codes and Section 1.3.3 on location specification). The information transfer commands are: NAME, DIMENSION, TYPE, ACCEPT, and ERASE. ___ _______ ________ 1.2.3 FDT Control Commands FDT control commands allow you to control the operation of sequences of FDT commands. Using these commands, you can define and execute macros composed of FDT commands, and can branch, conditionally or unconditionally, to another FDT command. The FDT control commands are GOTO, IF, MACRO, and WHAT. ___ ___________ ___ ___________ 1.3 FDT CONVENTIONS AND TERMINOLOGY The following sections describe syntax conventions and terminology that you should be familiar with to use FDT. ______ ___________ 1.3.1 Syntax Conventions The general form of an FDT command is the command name followed by its arguments. A simple example is: STEP 3 where STEP is the command name and 3 is the argument. You can enter a command whenever FDT has issued its exclamation-point prompt. ____________ INTRODUCTION Page 1-6 The syntax conventions you use to enter FDT commands are as follows: o Spaces between the prompt and the command are optional. You can place the command directly after the prompt, or you can separate the command from the prompt by any number of spaces. The following forms are correct: !command ! command ____________ INTRODUCTION Page 1-7 o FDT recognizes only the first three letters of any command. You can abbreviate any FDT command name to its first three letters, but you cannot include any spaces between the letters in the command name. The following examples are correct: !START !STA !STAT FDT interprets this command as STA. The following examples are incorrect: !ST A There is an embedded space in the command. !CO The abbreviation is too short. o Spaces are required between a command name and its argument(s). Some FDT commands can accept arguments. You must leave at least one space between the command name and the argument. The following examples are correct: !MACRO 1 !PAUSE .MAIN.,20 MACRO 2 AFTER 10 The following example is incorrect: !MACRO1 o Two formats exist for entering a series of FDT commands. You can enter the commands as a list with one command on each line, or you can enter several commands on a line, separating the commands with semicolons. The following example shows two commands on a line: !MACRO 1; TYPE I,J o The maximum command length is one line. There is no continuation character to permit a command longer than one line. You can continue MACRO definitions (but not the MACRO command) onto more than one line (see Section 2.7). If you type a command that is either spelled or spaced incorrectly, FDT prints the error message ?UNDEFINED and prompts for a new command. ____________ INTRODUCTION Page 1-8 _______ _________ 1.3.2 Current Procedure An important concept in using FDT is the "current procedure." In FDT, the current procedure is the procedure (main program, subroutine, or function) being executed when an FDT pause occurs (see Section 1.3.5). You must know what the current procedure is when you define locations for FDT (see Sections 1.3.3, 1.3.4, and 3.2). ____________ INTRODUCTION Page 1-9 ___ ________ _____________ 1.3.3 The Location Specification The FDT information transfer commands require you to specify the location of a variable or array element in the FORTRAN program. The location specification consists of two parts, the location itself, and the data type for the location. To specify a location for a variable, you can use an offset location, a named location, or a relative location. To specify a location for an array element, you use a subscripted name location. ______ ________ Offset Location The most direct way of specifying a variable's location is to give its offset. The offset is the difference between the address of the variable and the base location of the current procedure's data block. The offset for any variable appears in the storage map produced by the FORTRAN compiler. You specify the offset of a location by typing an octal number: nnn where: nnn is the offset of the variable as shown on the FORTRAN storage map. (The offsets in the storage map are expressed in octal bytes.) You need not enter leading zeros. The following is a fragment from a FORTRAN IV storage map: FORTRAN IV Storage Map for Program Unit .MAIN. Local Variables, .PSECT $DATA, Size = 000322 ( 105. words) Name Type Offset Name Type Offset Name Type Offset DAY I*2 000306 I I*2 000314 I4 I*2 000312 J I*2 000316 MONTH I*2 000304 YEAR I*2 000310 The offset of the variable DAY is 306; the offset of the variable YEAR is 310. You can specify the offset of a location only for unsubscripted variables in the current procedure. You cannot use a location offset specification for subscripted array elements, variables in common, or variables in a FORTRAN routine that is not the current procedure. The two exceptions to this rule are for variables in blank common and variables in the main program. (Section 3.1 describes how to specify the offsets of variables in named common.) ____________ INTRODUCTION Page 1-10 1. Variable Offsets in Blank Common To specify an offset location for a variable in blank common, type: .BCOM.+nnn where: nnn is the offset of the variable (as shown in the FORTRAN storage map). ____________ INTRODUCTION Page 1-11 2. Variable Offsets in the Main Program Any variable in the main program can be referenced at any time by typing: mainprog+nnn where: mainprog is the name of the main program and nnn is the offset of the variable. _____ ________ Named Location You can specify the location of a variable by using a name that you have associated with the location. You use the NAME command in FDT to define a name and associate it with a location (see Section 2.8). After you have defined a name, you can use it in any location specification. The name you define is valid in any procedure. ________ ________ Relative Location You can specify the location of a variable relative to a previously named variable. To do this, you enter the name and the displacement of the variable from the named location. This practice is useful primarily for referencing sequences of variables in consecutive locations. The format of the specification is: name+nnn where: name is the named location previously defined in a NAME command. nnn is the displacement in octal between the location to be specified and the location associated with the name. (The displacement is the difference between the address of the variable and the address of the named location.) ___________ ____ ________ Subscripted Name Location You can specify the location of an array element by using a subscripted name. The FDT DIMENSION command allows you to define a subscripted name and associate it with the location of a FORTRAN array. After you have defined a subscripted name and associated it with an array, you can specify the location of any element within the array with the subscripted name and the appropriate subscripts in parentheses. For example: ____________ INTRODUCTION Page 1-12 ARRAY(3,7) There are two ways to specify the subscript of an array element: o Use an integer constant. o Use a name defined in a previous NAME command. If you use a name as a subscript, FDT assumes that the variable associated with the name has an integer value. ____________ INTRODUCTION Page 1-13 There are certain conventions you must follow when you use a subscripted name location: o Each subscript value must be within the range defined for that dimension. If the subscript value is outside this range, FDT prints the following warning message: %SUBSCR OUT OF BOUNDS Since the message is only a warning, FDT references the location using the subscripts specified. o The number of subscripts you specify in a subscripted name must be less than or equal to the number of dimensions in the DIMENSION command that defined the name. If the number of subscripts is equal to the number of dimensions, FDT uses the FORTRAN subscript reference algorithm to locate the array element. If the number of subscripts is less than the number of dimensions, FDT assumes that the missing subscripts have a value of 1. For example, if ARRAY is defined as a three-dimensional array, ARRAY(3) is equivalent to ARRAY(3,1,1). o A subscripted name retains its association with a location even if that location is not in the current procedure. The name loses its association with the location only when you redefine the name with another NAME or DIMENSION command or when you cancel the name with an ERASE command. ____ _____ 1.3.4 Mode Codes The second major component of a location specification is the data type or mode for the location. To specify a mode for a location, type: loc[/mode] where: loc is the location (see Section 1.3.3). mode is the FDT mode code for the location. The FDT modes are similar to FORTRAN data types. The default mode for a location is I, corresponding to the INTEGER*2 data type in FORTRAN. Table 1-1 lists the FDT modes and the nearest corresponding FORTRAN data type. ____________ INTRODUCTION Page 1-14 Table 1-1 FDT Mode Codes Mode FORTRAN Type Description I INTEGER*2 16-bit value displayed in decimal J INTEGER*4 32 bits, first 16 bits displayed in decimal L LOGICAL*4 32 bits, displayed as T or F M LOGICAL*1 8 bits, displayed as T or F E REAL*4 32 bits, scientific notation D REAL*8 64 bits, scientific notation C COMPLEX 64 bits, real and imaginary parts B BYTE 8 bits, displayed in decimal R ---- 16 bits, displayed as three RAD50 characters O ---- 16 bits, displayed in octal An ---- A string of n ASCII characters (where n is in the range 1 to 255) Z ---- ASCIZ string (as used in the FORTRAN string handling package) P ---- Dummy variable mode When you need to indicate that the associated variable is an argument or parameter (dummy variable), you can use the letter P preceding any of the FDT modes. In fact, you must specify this form for any variable listed as a parameter in the attributes section of the FORTRAN storage map. Examples: _____________ _______ Specification Meaning 204/E A REAL*4 variable at offset 204. ____________ INTRODUCTION Page 1-15 16/PI An INTEGER*2 parameter variable at offset 16. POWER/C A COMPLEX variable at a location associated with the name POWER. Any location specification can include a mode specification. For example: TYPE 202/E The offset of the location is 202 and the data type of location offset 202 is REAL*4. ____________ INTRODUCTION Page 1-16 If a location specification occurs without a mode, two actions are possible. 1. If the specification does not involve a name, then FDT assumes the default mode I. For example, TYPE 202 is the same as TYPE 202/I 2. If the specification includes a name (a named location or a subscripted name), then FDT assumes the mode associated with that name. (The mode becomes associated with the name when you define the name in an FDT NAME or DIMENSION command.) For example, NAME PI,202/E TYPE PI has the same result as TYPE 202/E Similarly, NAME ANGLE,202 TYPE ANGLE has the same result as TYPE 202 The original mode definition can be overridden in subsequent commands. For example, if the name definition is NAME PI,202/E the following commands have the effects shown: TYPE PI/D Uses mode D for output. TYPE PI Uses originally defined mode E for output. TYPE 202 Uses the default mode I for output. The mode code is important for subscripted names in a DIMENSION command because the mode code determines how FDT locates the required array element. You can use the default mode in a DIMENSION command. ____________ INTRODUCTION Page 1-17 However, it is better to specify the intended mode explicitly in the DIMENSION command. You can specify a mode only in a location specification. Subscripts and other command parameters are not location specifications, so you cannot associate modes with them. ____________ INTRODUCTION Page 1-18 ___ ______ 1.3.5 FDT Pauses FDT contains a pause feature similar to a FORTRAN PAUSE statement: the FDT pause halts execution of the program, and you continue the program by entering additional commands. When the pause occurs, you can enter FDT commands. (Do not confuse the FDT pause with the FORTRAN pause. The FORTRAN PAUSE statement cannot cause an FDT pause.) There are five types of FDT pause. The pause name indicates the situation causing the pause: o automatic pause o entry pause o statement pause o step pause o watch pause An automatic pause occurs before the first executable statement in the main program. (FDT does not have a command for invoking the automatic pause.) The automatic pause occurs only during the first run of the program in a debugging session and not during subsequent runs. That is, subsequent FDT START commands or monitor START or REENTER commands do not invoke the automatic pause. An entry pause occurs at the entry point of a procedure such as a subroutine or function. You use the PAUSE command to specify the procedure name, and FDT pauses before the procedure begins executing. A statement pause occurs before execution of a particular FORTRAN statement. You use a PAUSE command to specify the statement where you want the pause to occur. FDT pauses when that statement is the next one to be executed. A step pause occurs after a defined number of FORTRAN statements have executed. You specify the number of statements by using the STEP command, and FDT pauses after that number of statements has executed. A watch pause occurs when the value of a variable being watched changes. You specify the variable for FDT to watch by using the WATCH command. FTD pauses when the statement containing the variable is the next one to be executed. When an FDT pause occurs, FDT prints the following message on the terminal: ____________ INTRODUCTION Page 1-19 FDT PAUSE AT ISN nnn IN proc ! where: nnn is the internal statement number of the next executable FORTRAN statement. proc is the name of the procedure in which the FDT pause occurred. A procedure is a main program, subprogram, or function. FDT defines procedure proc as the current procedure. This procedure remains the current procedure until the next FDT pause occurs. ____________ INTRODUCTION Page 1-20 ________ ___ ________ 1.4 CAUTIONS AND PITFALLS The following are some cautions you should observe when you use FDT: o Correct use of spaces is important in FDT. o Invalid location specifications or constants out of range cause unpredictable results. o Under the RT-11 SJ operating system, the ends of long lines of text printed at the terminal can be lost when the terminal reaches its right margin. FDT does not provide automatic carriage return or line feed. o For purposes of subscripting and copying, FDT considers locations with ASCIZ mode (/Z) to have a length of one byte. For example, the following command copies only the first character from INPUT to NAME: ACCEPT NAME/Z=INPUT To copy an ASCIZ string, use mode An, where n is equal to the maximum possible length of the ASCIZ string, including the terminating zero byte. For example, the following command copies 25 bytes from INPUT to NAME: ACCEPT NAME/A25=INPUT o An FDT error message does not indicate that an entire command was aborted. Some action may have occurred before discovery of the error. In this case, side effects can result. For example, the following command produces the error message ?UNDEFINED, but it acts like the command PAUSE SUBR: PAUSE SUBR+12 o FDT ignores any commands following CONTINUE, START, or STEP. For example, if you type the command line: STEP 3 ; TYPE INDEX FDT executes three FORTRAN statements and then pauses without typing anything. However, commands following CONTINUE, START, or STEP are executed if FDT control branches around CONTINUE, START, or STEP. For example, if you type the command line: IF SPY<50;CONTINUE;TYPE INDEX FDT resumes execution if SPY is less than 50, but types the contents of INDEX and waits for another FDT command if SPY is ____________ INTRODUCTION Page 1-21 greater than or equal to 50. o You cannot place an FDT pause on the GO TO of a logical IF statement. For example, suppose the FORTRAN source listing contains the following statements: 0008 NEXT=NOW+1 0009 IF(ITEMS(NEXT).GT.ITEMS(NOW)) GO TO 50 0011 TEMP=ITEMS(NOW) ____________ INTRODUCTION Page 1-22 You cannot place an FDT pause on internal statement 10. That is, the FDT command: PAUSE ,10 never causes a pause. However, an FDT pause on statement 10 would be valid if the source listing contained the following statements: 0008 DO 50 NEXT=1,N 0009 IF (ITEMS(NEXT).GT.MAX) MAX=ITEMS(NEXT) 0011 50 CONTINUE In this case, the FDT pause occurs before the value of MAX changes if the condition is true. If the condition is false, an FDT pause does not occur. CHAPTER 2 ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS This chapter describes the FDT commands. The commands are arranged alphabetically for convenient reference. Appendix A contains a summary of the commands. Useful commands for a new FDT user are: o PAUSE, STEP, and CONTINUE to control execution o NAME to refer to variables o TYPE and ACCEPT to display and change values ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-2 ACCEPT ______ 2.1 ACCEPT The ACCEPT command assigns new values to FORTRAN variables. There are three forms of arguments for the ACCEPT command. You can mix all three forms freely within a macro definition. (The third form is not valid outside a macro.) You can specify as many arguments as fit on a single command line. The arguments must be separated by commas. The first form is: ACCEPT loc=value where: loc is the location whose value is to be changed. value is the new value to be assigned to loc. The new value can be a constant in the same data format as the mode of loc, or it can be a previously defined name or subscripted name. The second form is: ACCEPT 'text' where: 'text' is the literal string to be printed. This form of the ACCEPT command is identical to the analogous form of the TYPE command. The FORTRAN conventions for text literals apply. The text literal form of ACCEPT is useful for FDT macros, where you can use the text as a prompt to enter new values. The third form is: ACCEPT loc where: loc is the location specification for a value entered from the terminal. This form of the ACCEPT command is valid only in FDT macros. It ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-3 requires an input value from your terminal, and prompts for the value with a question mark. The value you enter must follow the same conventions required for other forms of the ACCEPT command. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-4 The following mode conventions apply to the values in the ACCEPT command: o The value can be a previously defined name. If it is, FDT copies its contents into loc. When you use a name as the value, its mode should match the mode of loc, but it will work if it does not match. If the modes of loc and name are different, the mode of loc determines the number of bytes copied from name into loc (see Table 1-1). For example: Mode of loc Data Type Number of Bytes Copied I INTEGER*2 2 J INTEGER*4 4 E REAL*4 4 D REAL*8 8 Z ASCIZ 1 When you use a name as a value, FDT ignores the mode of name and uses name only to find the address of the value to be copied. FDT never converts from one mode to another. o String-mode constants (/Z or /An) must appear enclosed in single quotes. The FORTRAN conventions for text literals apply. o RAD50 constants and logical constants (/R, /L, and /M) must be preceded by the character # to indicate that they do not represent names. For example, the logical constants T and F are represented by #T and #F. o Complex constants appear as two real constants separated by a comma, in the order: real, imaginary. o Nonstring constants can include up to 40 characters. The number of characters represented by a string constant is limited by the length of the input line. Examples: _______ _______ Command Meaning ACCEPT 202=1 Sets the INTEGER*2 value at offset 202 to the value 1. ACC DELTA=EPSILON Replaces the contents of DELTA with ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-5 the contents of EPSILON. ACC 'DELTA=',DELTA Prints DELTA=? on the terminal and waits for an input value. (Valid only within an FDT macro.) ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-6 _______ _______ Command Meaning ACC I=0,J=1,244/E=3.14159 Sets the values of locations named I and J to 0 and 1, respectively; sets the REAL*4 variable at offset 244 to 3.14159. ACCEPT I=12,'J=',J Sets the location named I to 12; prints J=? on the terminal and waits for input to set the location named J. (Valid only within an FDT macro.) NOTE Both ACCEPT and TYPE use subroutines that FORTRAN loads to process FORMAT statements. If you are debugging a program without D, E, F, or G FORTRAN format specifications, then some of the format conversion routines are not loaded, and FDT cannot accept or type variables with modes C, D, or E. If you attempt to use modes C, D, or E when the format conversion routines are not present, FDT prints the error message ?NO CONVERSION and continues execution. Section 3.3 describes a way to avoid this problem. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-7 CONTINUE ________ 2.2 CONTINUE The CONTINUE command resumes program execution after any FDT pause. The next statement executed is the statement whose internal statement number and procedure name appeared in the last pause message. When it executes a CONTINUE command, FDT ignores any commands remaining on the line. If the current FDT pause occurred as the result of a PAUSE command, the CONTINUE command can have one optional argument called the execution count. FDT ignores the execution-count argument if the current pause is an automatic pause or if the current pause occurred as a result of a STEP or WATCH command. The form of the command is: CONTINUE [ntimes] where: ntimes is the execution count. The execution count is an integer that specifies the number of times the FORTRAN program must reach this point before another FDT pause can occur here. If you omit the ntimes argument or if ntimes = 1, an FDT pause occurs the next time control reaches this point (unless the PAUSE command is replaced or cancelled by subsequent commands). ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-8 DIMENSION _________ 2.3 DIMENSION The DIMENSION command names and lists the dimensions of a FORTRAN array you define and stores them in the FDT internal tables. This allows you to use the name as a subscripted name and to access arrays you have stored data in. FDT cannot access FORTRAN virtual arrays. DIMENSION command is the subscripted-name equivalent of the NAME command. The form of the command is: DIMENSION name(i,j,...)[,loc] where: name is the FDT name to be associated with the array. (i,j,...) is the list of dimensions for the array. There can be up to seven dimensions. Each dimension value in the list must be an integer in the range 1 through 32767. loc is the location specification for the first element (base) of the array. The offset for the base of the array appears in the FORTRAN storage map. Offsets for FORTRAN virtual arrays are not valid loc arguments. If you omit the loc argument, FDT erases the name specified (see ERASE command, Section 2.4). The mode code is an important part of the location specification for subscripted names. You can default the mode in a DIMENSION command. However, it is better practice to specify the intended mode explicitly in the DIMENSION command. FDT uses the specified mode in all subscript calculations that refer to the array. ASCII mode (/An) is not valid in a DIMENSION command because it does not mean anything when used to calculate subscripts. You do not get an error message if you specify ASCII mode in a DIMENSION command. However, when you attempt to use the subscripted name, FDT responds with the error message ?UNDEFINED. Examples: _______ _______ Command Meaning DIMENSION DATA(10,10),46/E A REAL*4 array named DATA with 10 ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-9 by 10 dimensions at offset 46. DIM COLUMN(10),DATA(1,3)/E A one-dimensional REAL*4 array COLUMN equivalenced to the third column of the array DATA. The following example shows a useful way to name one element of an array. NAME W,DATA(5,5)/E A REAL*4 variable W equivalenced to array element (5,5) of DATA (see NAME command in Section 2.8). ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-10 ERASE _____ 2.4 ERASE The ERASE command cancels the assignment of a name to a location, and frees the space in FDT's internal tables. The form of the command is: ERASE name1[,name2,...] You can specify as many names or subscripted names in an ERASE command as you can type on a single line. The names must be separated by commas. Subscripted names must appear without subscripts; subscripts are invalid in the ERASE command. You cannot erase the name for part of an array. Examples: ERASE TIME ERASE SPEED,DIST,DATA,ICOUNT ERASE does not change the values of the variables whose assigned names are erased. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-11 GOTO ____ 2.5 GOTO The GOTO command changes the order of execution of commands in an FDT macro. GOTO causes an unconditional transfer of control, like that caused by the FORTRAN GO TO statement. Do not confuse the FDT GOTO and the FORTRAN GO TO; the FDT GOTO cannot change the order of execution of FORTRAN statements. Like the FORTRAN GO TO, the FDT GOTO requires numeric statement labels. The form of the command is: GOTO label Remember that FDT command names must not contain spaces; GO TO is an invalid FDT command. where: label is the numeric label of the command to which control is transferred by the GOTO command. The label must be an integer in the range 1 to 32767. Embedded spaces are not valid. If two or more labels have the same value, FDT uses the first occurrence of the label. If the label you reference does not exist within the current macro, FDT prints the error message ?LABEL. You can use the IF command and the GOTO command to create loops of FDT commands similar to simple FORTRAN loops or FORTRAN DO loops (see Sections 2.6 and 2.7). For example, if the first command in the loop has the label 100, the last command in a loop might be IF NEXT<>0;GOTO 100. You can create loops only on conditions or values. You cannot increment an index in FDT. If FDT is executing an infinite loop, you can terminate execution only by typing twice to return to the monitor. Then the monitor's START or REENTER commands can operate in the same way as the START command in FDT. However, in some cases, you will have to use the RUN command to reload the FORTRAN program and start the debugging session from the beginning. ________ _ _____ Defining a Label You label a command by preceding it with an integer. The label must ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-12 follow either the left parenthesis that marks the beginning of the macro definition or the semicolon that delimits the preceding command. The label can be set off by spaces in its defining occurrence. The following macro definition contains a label: MACRO 1(TYPE MAX; 10 ACCEPT 'INIT=',INIT ;IF INIT>MAX; GOTO 10; S 3) ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-13 IF __ 2.6 IF The IF command requests conditional execution of another FDT command. You use IF to specify that another FDT command is to be executed only if a given condition is met. The form of the command is: IF locvalue;FDT command where: loc is the location specification for the value to be compared. The mode of loc must be E, I, or J. is the logical relation tested. The argument is one of the six logical relations: = (equal), <> (not equal), > (greater than), >= (greater than or equal), < (less than), or <= (less than or equal). value is the value to be compared to loc. The value argument may be either a constant in the same mode as loc or a previously defined FDT name. Subscripted names are valid. The mode of the name should (but need not) match the mode of loc. FDT assumes that name has the same mode as loc, and ignores the actual mode of name. FDT compares the contents of loc and name in the mode defined by loc. FDT never does conversions from one mode to another. (See the discussion of mixed modes in the ACCEPT commmand, Section 2.1.) FDT command is the single FDT command that is executed only if the logical relation specified between loc and value is true. The entire IF command must fit on one line. The IF command compares the value in loc to the value specified. If the relation is true, FDT executes the FDT command specified in the IF command. If the relation is not true, FDT does not execute the command but skips to the next command. Example: ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-14 IF PARM/I>5;WATCH COUNT;STEP If PARM is greater than 5, FDT sets a watch on the location named COUNT, and executes the next FORTRAN statement; otherwise, FDT simply executes the next FORTRAN statement. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-15 MACRO _____ 2.7 MACRO The MACRO command defines, executes, or deletes an FDT macro. An FDT macro is a sequence of FDT commands that is executed as a unit. Thus, an FDT macro is like a FORTRAN subroutine or function subprogram. ________ _ _____ 1. Defining a Macro You can create a new macro, or change an existing macro, with a MACRO command by typing: MACRO m(FDT commands) where: m is the number of the macro where m is a value in the range 0 to 7. FDT commands is any valid FDT command or series of commands. Do not type a space between the macro number (m) and the left parenthesis. Type the FDT commands within the parentheses, separated by semicolons. There is no limit to the number of commands you can use to define a macro. The definition may continue on as many lines as necessary. FDT prompts for each new line. The end of the macro is defined by the right paranthesis. Examples: In the following example, the MACRO command prints the values of the variables associated with the names TIME, SPEED, and DIST, and the first two elements of the array named DATA: MACRO 3(TYPE TIME,SPEED,DIST,DATA(1),DATA(2)) The following example shows a multiple-line macro definition. The macro accepts a floating-point value VAR from the terminal, and tests whether VAR is within the limits required by the program. If VAR is outside the limits, FDT goes to the command labeled "100" and prompts for another value. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-16 Previous definitions: NAME VAR,234/E NAME TOP,240/E Macro definition: MACRO 5(100 ACCEPT 'VAR=',VAR; IF VAR<12.; GOTO 100; IF VAR>TOP; GOTO 100; CON) ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-17 _________ _ _____ 2. Executing a Macro You can execute a macro either automatically or manually: FDT executes a macro automatically whenever it executes an FDT pause that was set up by a PAUSE command containing a MACRO argument (see Section 2.9). You can execute a macro manually by typing the following command: MACRO m where: m is the number of the macro to be executed. The value of m is a number in the range 0 to 7. The specified macro executes until FDT reaches the end of the macro. When the end of the macro is reached, FDT prompts you for more commands by printing !. When a START, STEP, or CONTINUE command within the MACRO is executed, FDT resumes execution of the FORTRAN program. ________ _ _____ 3. Deleting a Macro You can delete a macro by redefining it with a null command string. The form of the command is: MACRO m() where: m is the number of the macro in the range 0 to 7. () is the null command string. The left and right parentheses must not enclose any characters or spaces. ________ _____ Implicit Macro MACRO 0 is a special macro number that you cannot associate explicitly with a PAUSE. Any current PAUSE command that you have not explicitly associated with another MACRO is implicitly associated with MACRO 0. MACRO 0 is usually not defined. If you do define MACRO 0, every PAUSE command without a MACRO parameter executes MACRO 0. You can execute MACRO 0 manually. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-18 NAME ____ 2.8 NAME The NAME command assigns a name to a location and a mode. The name must be unique in the first six characters. Any characters after the sixth are ignored. The first character of the name must be a letter. The other characters can be either letters or digits. The form of the command is: NAME name[,loc] where: name is the name assigned to the variable. If the name you specify has already been defined, this NAME command redefines the name. The old definition is lost. loc is the location specification (as described in Sections 1.3.3 and 1.3.4). If you omit the location specification, FDT cancels the assigned name (see ERASE command, Section 2.4). Examples: _______ _______ Command Meaning NAME I,202 INTEGER*2 variable I at offset 202. NAM PARM,16/PI INTEGER*2 parameter PARM at offset 16. NAM DELTA,I+2/E REAL*4 variable DELTA at offset 204. (Relative location I+2 is location 202+2.) NAM EPSILON,DELTA+4/E REAL*4 variable EPSILON at offset 210. NAM PARM Erases the definition of PARM. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-19 PAUSE _____ 2.9 PAUSE The PAUSE command defines statement pauses and entry pauses (see Section 1.3.5). The PAUSE command marks the place in your program immediately preceding the statement where you want an FDT pause to occur. You mark the statement using its internal statement number. The pause occurs only when the marked statement is the next one to be executed. You can define a statement pause for any executable FORTRAN statement in your program even if that statement is located in a procedure that is nonresident or in a shared library. The location of the pause is stored internally by FDT; it is not stored in the FORTRAN program itself. You can place an entry pause on the entry point of any FORTRAN subroutine or function. Whenever the subroutine or function is called, FDT issues the message FDT PAUSE AT ISN 0 IN proc. You can use this feature to detect calls to a procedure without having to determine the first executable statement of the procedure. The PAUSE command requires you to specify the location of the pause. There are two optional arguments. You can specify the optional arguments MACRO and AFTER in either order. The complete form of the PAUSE command is: PAUSE [proc],isn MACRO m AFTER ntimes proc where: proc,isn is the location of the statement to be marked. proc is the name of the procedure in which the pause occurs. The default value for the procedure name is the name of the current procedure. The current procedure is defined as the main program, subroutine, or function whose name was printed in the last FDT pause message. If you specify a subroutine or function as the procedure and omit the isn argument, FDT establishes an entry pause at the entry point of the FORTRAN procedure you specified. You cannot place an entry pause on the entry point of an ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-20 assembly language routine. (Note that "proc,0" is not equivalent to "proc" because internal statement number 0 is undefined.) isn is the internal statement number of the FORTRAN source statement before which you want the FDT pause to occur. The internal statement number appears to the left of each statement in the source listing. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-21 NOTE FDT does not print an error message if proc,isn specifies a nonexistent or nonexecutable statement in the FORTRAN program. The command containing an invalid internal statement number is ignored; the nonexistent or nonexecutable point is not executed by the program and thus cannot cause an FDT pause to occur. MACRO m is the FDT macro that is executed when the FDT pause occurs. An FDT macro is a sequence of FDT commands that is executed as a unit. It is similar to a subroutine or function in FORTRAN. (For more information on FDT macros, see Section 2.7.) The m argument specifies the number of the FDT macro you want to associate with the FDT pause you are creating. The macro number must be an integer in the range 1 to 7. The MACRO m argument is valid whether or not macro m exists. The macro can be defined or changed at any time without affecting the PAUSE command. If the macro does not exist when the pause occurs, FDT operates as if the macro argument were not specified. If the macro exists when the pause occurs, FDT executes the macro without issuing an FDT pause message. If the macro contains a CONTINUE command, execution of the FORTRAN program resumes. If the macro does not contain a CONTINUE command, FDT prompts for more commands when it has finished executing the macro. You can abbreviate the word MACRO to MAC. FDT checks only the first three characters for spelling accuracy. (Remember that there must be a space between the word MACRO and the macro number, m.) AFTER ntimes is the execution count. The ntimes argument specifies the number of times that the program must reach (but not execute) the marked statement before an FDT pause occurs at that point. The ntimes value must be an integer in the range 1 to 32767. The default value for the AFTER ntimes ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-22 argument is 1, which causes an FDT pause the first time program control reaches the statement. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-23 FDT decrements the execution count each time control reaches the internal statement number specified. An FDT pause occurs when the count is zero. When the pause occurs, FDT automatically resets the execution count to the default value of 1. If you want to override the default execution count, specify the required execution count in a CONTINUE ntimes command (see Section 2.2). (The pause definitions printed by the WHAT command contain the current value of the execution count, not the initial value.) You can abbreviate the word AFTER to AFT. FDT checks only the first three characters for spelling accuracy. (Remember that there must be a space between the word AFTER and the execution count, ntimes.) A program can contain no more than eight active PAUSE commands at any one time. If you attempt to define more than eight pauses in a program, FDT prints the error message ?NO ROOM. You cannot place two pause definitions at the same point in your program. If you try to place two pauses at the same point, the second pause definition cancels the first. Statement pauses are disabled when FDT is in step mode (see STEP command, Section 2.12). Example: The following command line places an entry pause on procedure SUBR and a statement pause on statement 10 of the current procedure: PAUSE SUBR;PAUSE ,10 ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-24 RESET _____ 2.10 RESET The RESET command removes pauses created by the PAUSE command. The form of the command is: RESET proc,isn where: proc,isn is the location in the FORTRAN program for which the pause was defined. The location specified must be exactly the same as the location specified in the pause definition. proc is the name of the procedure where the pause was to occur. isn is the internal statement number of the FORTRAN source statement where the pause was to occur. Example: The following command line removes the statement pause on statement 10 of the current procedure and the entry pause on procedure SUBR: RESET ,10;RES SUBR ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-25 START _____ 2.11 START The FDT START command begins executing your FORTRAN program at the first executable statement in the main program. You can issue the START command whenever FDT prints its command prompt. However, START might not work when the system is not in an initial or ready condition. For example, if any files are open, a START command causes an error message and FDT returns control to the monitor. The START command has no arguments. When the START command is executed, FDT ignores any commands remaining in the line. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-26 STEP ____ 2.12 STEP The STEP command continues execution of your program in step mode and indicates the number of statements that you want to execute before the next FDT pause. The forms of the command are: STEP [n] S [n] (Notice that the STEP command has the special abbreviation S.) where: n is an integer in the range 1 to 32767. FDT executes n FORTRAN statements before pausing. The default value for n is 1, which results in a single-step operation with a pause before each statement. Step mode disables all statement pause definitions. You can cancel step mode and reenable the pause definitions by entering any FDT command (other than another STEP command). The occurrence of an FDT pause also cancels step mode. STEP counts only executable statements. A logical IF statement counts as one executable statement if it contains a GOTO; otherwise, a logical IF statement can be one or two executable statements (depending on the outcome of the IF test). The END statement is an executable statement. FORMAT statements, declaration statements, and SUBROUTINE and FUNCTION statements are nonexecutable statements. After executing a STEP command, FDT ignores any commands remaining in the line. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-27 STOP ____ 2.13 STOP You issue the STOP command to end a debugging session. The STOP command in FDT is equivalent to a STOP statement in the FORTRAN program. The STOP command closes any open logical units, performs necessary exit actions, and returns control to the operating system. The STOP command has no arguments. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-28 TYPE ____ 2.14 TYPE The TYPE command prints the values of variables in the FORTRAN program during a debugging session. The forms of the command are: TYPE loc[,more] or TYPE 'text'[,more] where: loc is the location specification of the variable whose value you want to examine. 'text' is a literal text string you want to print on the terminal. The FORTRAN conventions for text literals apply to FDT literals. more is another loc or text argument. Multiple loc or text arguments can appear in a single TYPE command. The arguments must be separated by commas. The maximum length of the TYPE command is one line. FDT finds each location specified and prints the contents of the location in the mode indicated by the location specification. FDT prints text literals exactly as you type them (except for the enclosing quotation marks). If you use multiple arguments in a TYPE command, FDT separates the values with commas. Examples: _______ _______ Command Meaning TYPE 202 Prints INTEGER*2 variable at offset 202. TYPE 'HI' Prints HI. TYPE 'DON''T' Prints DON'T. TYPE DELTA,EPSILON Prints two values separated by a comma. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-29 TYPE DELTA/O Prints the first 16 bits of DELTA in octal. TYPE 'DELTA=',DELTA Prints DELTA= followed by the value of DELTA. TYPE DATA(I,J) Prints the value of the (I,J) array element in DATA. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-30 WATCH _____ 2.15 WATCH The WATCH command directs FDT to watch the contents of a location and to perform a watch pause whenever the value in that location changes. The form of the command is: WATCH [loc] where: loc is the specification of the location you want to watch. (Sections 1.3.3 and 1.3.4 describe how to specify a location.) You can watch only one location at any given time. A new WATCH loc command cancels the previous WATCH command. A WATCH command without a location specification cancels the previous WATCH loc command. The location you want to watch can have any FDT mode except Alpha (/An). Only the first character of the string is watched for locations in ASCIZ string mode (/Z). When the value of a watched location changes, FDT prints the message WATCH PAUSE, and performs an FDT pause at the next executable FORTRAN statement. The value must actually change or FDT does not perform a pause. For example, if IVALUE is equal to 5, then the statement IVALUE=5 does not cause a watch pause. If another FDT command changes the value of a watched location, a watch pause does occur. For example, you can deliberately trigger a watch pause by using FDT's information transfer commands to change the value in a watched location. Each time a watch pause occurs, FDT cancels the WATCH command that initiated the pause. You must issue another WATCH command with the same location specification if you want FDT to continue watching the same location. Watch pauses are independent of other FDT pauses. You can place a watch pause and any other command causing a pause (for example, PAUSE or STEP) on the same FORTRAN statement. If you specify a watch pause and another pause for the same statement, FDT processes the other pause first. You must resume execution using CONTINUE, STEP, or START before the watch pause can occur. ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-31 Examples: WATCH MAX WATCH ARRAY(3,2) ___________ __ ___ ___ ________ DESCRIPTION OF THE FDT COMMANDS Page 2-32 WHAT ____ 2.16 WHAT The WHAT command displays the current status of the FDT system. When you type WHAT, FDT returns the following information: o A list of the definitions for all the active pauses. For each pause, FDT prints the location of the pause (the procedure name and optional internal statement number), the current value of the execution count (when it is greater than 1), and any associated macro number. The pause listing for an entry pause has no internal statement number. o A list of all currently defined macro numbers and the contents of the macros. CHAPTER 3 ________ __________ ADVANCED TECHNIQUES This chapter describes some advanced techniques that you can use to extend FDT's power. _____ ______ 3.1 NAMED COMMON FDT can access variables in a FORTRAN named common block after you define the block using the NAME command. Use the following procedure: 1. Locate the address of the named common block. The absolute address of the named common block appears in the link map. The name given to the block in the FORTRAN source code appears in the link map under the column labeled SECTION. The 6-digit number following the name is the address of the block. For RT-11 foreground programs, the named common block address appearing in the link map is a relative address. The desired absolute address is the sum of the link map relative address and the foreground job load address. Obtain the foreground load address by issuing the FRUN command with the /P option. (The /P option causes control to return to the monitor; type RESUME to execute the foreground job.) 2. Describe the named common block to FDT. A NAME command in the following form defines the block's location: NAME block,.ABS.+addr where: ________ __________ ADVANCED TECHNIQUES Page 3-2 block is the FDT name of the common block. If the block name is the same as that of a variable in a previous NAME command, FDT erases the previous name. addr is the 6-digit absolute address of the named common block. 3. Refer to locations in named common. The location of any variable in named common is expressed as follows: block+nnn ________ __________ ADVANCED TECHNIQUES Page 3-3 where: block is the FDT name of the common block. nnn is the offset of the variable as given in the FORTRAN storage map. You can assign FDT names to variables in named common by using block+nnn as a location in a NAME command. Examples: Assume that the name of the FORTRAN named common block is COMBLK and the link map gives its address as 063524. Describe the named common block to FDT: NAME COMBLK,.ABS.+63524 Print the contents of an INTEGER*2 variable at offset 000010 in COMBLK: TYPE COMBLK+10 Name the variable at location COMBLK+10: NAME INDEX,COMBLK+10 Print the contents of the variable: TYPE INDEX ___ ___ _________ _________ 3.2 HOW FDT GENERATES ADDRESSES FDT uses the location specification to generate the address and mode information of a FORTRAN variable. The manner in which FDT generates the 16-bit PDP-11 address depends on the information in the location specification. The following section describes the address-generation process for the five kinds of location specifications. _____ _______ 3.2.1 Octal Offsets The form of the location specification is: oct An octal number in the range of 0 to 177777. ________ __________ ADVANCED TECHNIQUES Page 3-4 When you give an octal number as a location specification, FDT always interprets the number as an offset from the base address of the current procedure's data block. In other words, FDT adds the octal number to the base address to generate the 16-bit address. Thus, you can use the offsets produced by the FORTRAN compiler to generate addresses for any locations shown in the FORTRAN storage map. ________ __________ ADVANCED TECHNIQUES Page 3-5 _____ 3.2.2 Names The form of the location specification is: name An alphanumeric name unique in the first six characters. The first character must be a letter. FDT ignores any characters after the sixth. The NAME command associates a name with a location. Once the association has been established, the name refers directly to the location of the variable. ________ __________ 3.2.3 Relative Addressing The form of the location specification is: name+oct An alphanumeric name unique in the first six characters, a plus sign, and an octal number in the range 0 to 177777. This location specification is a form of relative addressing in which the base address is the location associated with the name. FDT adds the octal displacement to the base address to determine the location of the variable. Displacements in the range 100000 to 177777 are negative displacements. FDT assumes that all octal numbers represent two's complement binary integers. For example, the displacement 177776 represents a displacement of -2 bytes (the word preceding the name). You must determine the displacement yourself; it is not in the storage map. You could use relative addressing for array subscripts. However, this is unnecessary because FDT lets you define subscripted names. Relative addressing lets you address variables in named common blocks after you have supplied the base address of the common block. You can use the following predefined names in FDT as base addresses for relative addressing: .MAIN. The default name assigned by FDT to the base address of the FORTRAN main program. You can reference any location in the main program using this base. If you named your main program with the FORTRAN PROGRAM statement, then FDT uses that name to find the base address for a relative address. .BCOM. The name assigned by FDT to the base address of the FORTRAN blank common area. Use .BCOM. to reference ________ __________ ADVANCED TECHNIQUES Page 3-6 variables in blank common. .ABS. The zero address of memory. FDT uses this name as the base address for referencing any absolute memory location. For example, the following command prints the contents of absolute location 56 (octal) in octal format: TYPE .ABS.+56/O ________ __________ ADVANCED TECHNIQUES Page 3-7 _________ __________ 3.2.4 Subscript Addressing The form of the location specification is: name(i,j,k,...) A subscripted name for specifying arrays with up to seven dimensions. The base address for this form of addressing is the address of name(l,l,l,...). FDT uses the FORTRAN subscripting algorithm to compute the displacement from the base address and to locate the specified array element. ________ __________ 3.2.5 Indirect Addressing When you define a name as an argument or parameter (by specifying its mode as P), FDT uses the location associated with the argument name as an indirect address. That is, FDT regards the value associated with the name as the address of the desired value. For example, if the location of the argument PARM contains 2000 and location 2000 contains 1234, then the command TYPE PARM/I,PARM/PI prints 2000,1234 ______ __________ ________ 3.3 FORMAT CONVERSION ROUTINES TYPE, ACCEPT, and IF commands use the FORTRAN library format conversion routines. If the program you are debugging does not have D, E, F, or G format specifications, then the linker does not load the routines that FDT requires for C, D, and E modes. If you require C, D, or E modes, you can force the linker to load the required routines with the following procedure: 1. When you link your program, include the /I switch in the first linker command line. 2. The linker responds with: LIBRARY SEARCH: Type RCI$ to request the floating-point conversion routines. Type (the null line) to end the library ________ __________ ADVANCED TECHNIQUES Page 3-8 search list. The resulting program contains all the necessary conversion routines. _______ _________ _________ _____ 3.4 ON-LINE DEBUGGING TECHNIQUE (ODT) If you use assembly language routines with FORTRAN routines, you may sometimes need to use FDT and ODT at the same time. No interaction occurs between the two debugging techniques except when ODT, which runs at a higher priority, occasionally interrupts the output of FDT or of the FORTRAN program. FDT does not use breakpoint or T-bit traps. _________ _____ 3.5 EXECUTION SPEED FDT uses the FORTRAN internal statement number traceback feature to gain control at the beginning of a FORTRAN program and to execute PAUSE and STEP commands. Therefore, FDT adds some overhead to the execution of each FORTRAN statement and slightly reduces the execution speed of any FORTRAN program. The amount of FDT overhead time in a main FORTRAN program is difficult to reduce. However, you can get fully debugged, time-critical subroutines to run at full speed. You should compile these routines with the traceback feature disabled. You cannot use FDT within these routines. However, you can use the entry-pause feature of FDT for these routines because the entry pause does not require the traceback feature. If you issue a STEP command immediately before a subroutine compiled without internal statement numbers, control proceeds to the next executable FORTRAN statement in a routine with the traceback feature enabled. Execution speed with FDT is affected by FDT pauses. Each active pause slows the execution of all FORTRAN statements. An active pause particularly slows those with internal statement numbers greater than that of the statement where the pause occurs. The program runs faster if you reset pauses that are no longer necessary. Entry pauses (see Section 2.9) do not require overhead for traceback and hence are faster than other PAUSE commands. CHAPTER 4 ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT This chapter explains how to install and test the FDT software and how to use it with FORTRAN IV programs under the RT-11 operating system. The chapter also provides general information about how to create FORTRAN IV programs, but it does not provide specific information about the FORTRAN IV programming language, the FORTRAN IV compiler, or the RT-11 operating system. For additional information on these topics, see the appropriate RT-11 or FORTRAN IV documentation cited in this chapter. ___ ___ ________ 4.1 THE FDT SOFTWARE The FDT software consists of two files called FDT.OBJ and FDTVER.FOR. FDT.OBJ contains the FDT software. FDTVER.FOR is a test program to be used after you install FDT; FDTVER verifies that you performed the installation procedure correctly and that your FDT software is in good working order. ____________ ____________ 4.2 INSTALLATION REQUIREMENTS Instructions in this chapter require that: 1. All files acted upon by system programs are on the default device, DK:, unless otherwise noted in this chapter. 2. You use the default file types which are: .FOR FORTRAN source files .OBJ object files and object library files .SAV image (executable) background files ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-2 3. The FORTRAN IV compiler, FORTRA.SAV, has already been built and resides on the system device, SY:. 4. The FORTRAN Object Time System, OTS.SAV, has been built and added to the system library, SYSLIB.OBJ, which resides on the system device, SY:. 5. All necessary system programs and files are installed and reside on the system device, SY:. __________ ___ 4.3 INSTALLING FDT Installing FDT consists of copying the FDT distribution volume and making any necessary corrections to the FDT software. _______ ___ ____________ ______ 4.3.1 Copying the Distribution Volume Because all storage media can be adversely affected by environmental conditions, vandalism, and human error, you should keep several copies of any software that cannot be easily re-created. Copy the FDT distribution volume and store it in a safe place. Use the distribution volume only when copying the FDT software. Use only copies for all other procedures described in this chapter. The distribution volume containing FDT has a file structure that RT-11 can read. Procedures for copying the distribution volume vary depending on how many mass storage devices you have. If you have three or more mass storage devices, follow the procedures in Section 4.3.1.1. If you have only two mass storage devices, follow the procedures in Section 4.3.1.2. NOTE Instructions for copying one volume to another use the SQUEEZE command. Instructions for copying individual files use the COPY command. However, when you copy individual files from one volume to another, the COPY command does not copy the protection code of the files. See Section 4.3.2 for information about how to remove and restore the protection code of files. _______ ____ _____ __ ____ ____ _______ _______ 4.3.1.1 Copying with Three or More Mass Storage Devices - To copy the ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-3 FDT distribution volume with three or more mass storage devices, do the following: 1. Load the distribution volume. 2. Load a blank storage volume. 3. Format the blank storage volume if necessary. If you use RK05 disks, format each disk. If you use RX02 drives, format each diskette to be either single density or double density. Other storage media cannot be formatted. Use the FORMAT command to format your disks and diskettes. The following example formats an RK05 disk: .FORMAT RK1: RK1:/FORMAT-Are you sure?Y ?FORMAT-I-Formatting complete ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-4 When you use the FORMAT command, diskettes on RX02 drives are formatted to be double density by default. If you want them to be single density, use the /SINGLEDENSITY switch with the FORMAT command. The following example formats a diskette to be single density: .FORMAT/SINGLEDENSITY DY1: DY1:/FORMAT-Are you sure?Y ?FORMAT-I-Formatting complete See the RT-11 System User's Guide for more information about the FORMAT command. 4. Initialize the blank storage volume using the /BADBLOCKS switch to search for and isolate bad blocks. Type: .INITIALIZE/BADBLOCKS dvn: dvn:/Initialize; Are you sure? Y ?DUP-I-No bad blocks detected dvn: See the RT-11 System User's Guide for more information about the INITIALIZE command and what the system does if it finds bad blocks. 5. Use the SQUEEZE command with the /OUTPUT switch to copy files from the distribution volume to the blank storage volume. Using the SQUEEZE command with the /OUTPUT switch copies all files from the input (distribution) volume to the beginning of the output (storage) volume and consolidates all empty space on the output volume at the end of that volume. The following example copies files from dv1 to dv2: .SQUEEZE/OUTPUT:dv2: dv1: See the RT-11 System User's Guide for more information about the SQUEEZE command and copying files. 6. Copy FDT.OBJ from the storage volume to your system volume or to the volume where you will store your FORTRAN programs. The following example copies FDT.OBJ to the system volume from a storage volume: .COPY dvn:FDT.OBJ SY:FDT.OBJ See the RT-11 System User's Guide for more information about the COPY command. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-5 _______ ____ ____ ___ ____ _______ _______ 4.3.1.2 Copying with Only Two Mass Storage Devices - If you have only two mass storage devices, you cannot copy the FDT distribution volume directly since the RT-11 system volume occupies one of your mass storage devices. To copy the distribution volume under these circumstances, do the following: 1. Load a blank storage volume. 2. Format the blank storage volume if necessary. If you use RK05 disks, format each disk. If you use RX02 drives, format each diskette to be either single density or double density. Other storage media cannot be formatted. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-6 Use the FORMAT command to format your disks and diskettes. The following example formats an RK05 disk: .FORMAT RK1: RK1:/FORMAT-Are you sure?Y ?FORMAT-I-Formatting complete When you use the FORMAT command, diskettes on RX02 drives are formatted to be double density by default. If you want them to be single density, use the /SINGLEDENSITY switch with the FORMAT command. The following example formats a diskette to be single density: .FORMAT/SINGLEDENSITY DY1: DY1:/FORMAT-Are you sure?Y ?FORMAT-I-Formatting complete See the RT-11 System User's Guide for more information about the FORMAT command. 3. Initialize the blank storage volume using the /BADBLOCKS switch to search for and isolate bad blocks. Type: .INITIALIZE /BADBLOCKS dvn: dvn:/Initialize; Are you sure? Y ?DUP-I-No bad blocks detected dvn: See the RT-11 System User's Guide for more information about the INITIALIZE command and what the sytem does if it finds bad blocks. 4. Use the SQUEEZE command with both the /WAIT and the /OUTPUT switches to copy files from the distribution volume to the blank storage volume. Using the /WAIT switch causes RT-11 to pause before copying files, allowing you to load a blank storage volume, if necessary, and to remove the RT-11 system volume from the system device. Then you can load the FDT distribution volume in the system device. RT-11 prompts you with messages telling you when to do each of these things. Answer Y to each message when you are ready to continue. The /OUTPUT switch causes RT-11 to copy files from the input (distribution) volume to the beginning of the output (storage) volume and consolidates all empty space on the output volume at the end of that volume. After RT-11 finishes copying the files, it prompts you with a message telling you to replace the system volume in the system device. The following example copies files from dv0: to dv1: ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-7 .SQUEEZE/WAIT/OUTPUT:dv1: dv0: Mount output volume in dv1:; Continue? Y Mount input volume in dv0:; Continue? Y At this point RT-11 copies the files and then types the following message on your terminal: Mount system volume in dv0:; Continue? Y See the RT-11 System User's Guide for more information about the SQUEEZE command and copying files. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-8 5. Copy FDT.OBJ from the storage volume to your system volume or to the volume where you will store your FORTRAN programs. The following example copies FDT.OBJ to the system volume from a storage volume. .COPY dvn:FDT.OBJ SY:FDT.OBJ To copy FDT.OBJ from the storage volume to the volume where you keep your programs (if you do not keep your programs on the system volume), use the /WAIT switch with the COPY command. Type: .COPY/WAIT dv0:FDT.OBJ dv1:FDT.OBJ Mount output volume in DY1:; CONTINUE? Mount the volume that contains your programs. Type Y when you have mounted the volume. Mount input volume in dv0:; CONTINUE? Now remove the system volume from dv0: and mount the storage volume that contains FDT.OBJ. Type Y when you have mounted the storage volume. RT-11 copies FDT.OBJ and prints the following message on your terminal: Mount system volume in dv0:; CONTINUE? Remove the storage volume from dv0: and mount the RT-11 system volume. Type Y after you mount the system volume. See the RT-11 System User's Guide for more information about the COPY command. ____ __________ 4.3.2 File Protection Remember that all files in your FDT distribution volume have been protected. Never remove this protection. However, after copying the distribution volume, you may remove the protection of files from your copies, if you wish, by using the RENAME command with the /NOPROTECTION switch. To protect unprotected files, use the /PROTECTION switch with the RENAME command. See the RT-11 System User's Guide for more information about the RENAME command. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-9 ______ ___________ 4.3.3 Making Corrections From time to time, the RT-11 Software Dispatch publishes corrections that you must make to your FDT software. The dispatch also publishes instructions on how to make the corrections. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-10 You only need to make corrections published in the dispatch for version 2.1 of the FDT software. Corrections that were published in the dispatch for previous versions of FDT have already been included in version 2.1. Never make corrections to your distribution volume. Make corrections to your copies. After making any corrections, copy your software again. _________ ___ ___ ________ 4.4 VERIFYING THE FDT SOFTWARE After installing the FDT software, run the test program FDTVER.FOR to verify that you performed the installation procedure correctly and that your FDT software was delivered in good working order. To run FDTVER.FOR, do the following: 1. Make sure that the requirements listed in Section 4.2 are true for your system. 2. Make sure that the following are also true: o FDT.OBJ and FDTVER.FOR are on the default device o The default device has at least 40 free blocks on it for the files FDTVER.OBJ and FDTVER.SAV that FDTVER.FOR creates when it runs. 3. Run FDTVER.FOR by typing the commands in red in the following example. Type each command exactly as it appears and wait for the computer's response before you type the next command. The computer's response is in black. When you finish, check the results the computer printed with the results in this example. Except for the information in the storage map, the results should match. If they do not match, and if you have not made any typing errors, you probably have not received a reliable copy of your software. Contact DIGITAL for further information. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-11 .FORTRAN/CODE:THREADED/LIST:TT: FDTVER PAGE 001 FORTRAN IV V02.5-1 0001 DATA B,C,J,M/1.,0.,1,1000/ 0002 1 A=C 0003 N=M 0004 2 A=A+B 0005 N=N-1 0006 IF(N.GT.0) GO TO 2 0008 TYPE 1000,A,B,M 0009 1000 FORMAT(//' FINAL VALUE = ',1PE15.5,' INCREMENT = 'E15.5, 1' STEPS = ' I5,//) 0010 IF(J.NE.0) GO TO 1 0012 STOP 'FINISHED PROGRAM' 0013 END .MAIN. FORTRAN IV Storage Map for Program Unit .MAIN. Local Variables, .PSECT $DATA, Size = 000024 ( 10. words) Name Type Offset Name Type Offset Name Type Offset A R*4 000016 B R*4 000002 C R*4 000006 J I*2 000012 M I*2 000014 N I*2 000022 .LINK FDTVER,FDT .RUN FDTVER FDT V02-03 FDT PAUSE AT ISN 2 IN .MAIN. !NAME J,12 !NAME M,14 !PAUSE ,10 !START FINAL VALUE = 1.00000E+03 INCREMENT = 1.00000E+00 STEPS = 1000 FDT PAUSE AT ISN 10 IN .MAIN. ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-12 !ACCEPT M=5000 !CONTINUE FINAL VALUE = 5.00000E+03 INCREMENT = 1.00000E+00 STEPS = 5000 FDT PAUSE AT ISN 10 IN .MAIN. !ACCEPT J=0 !CONTINUE STOP -- FINISHED PROGRAM . ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-13 ________ _ _______ ____ ____ ___ 4.5 CREATING A PROGRAM THAT USES FDT To create a FORTRAN IV program that uses FDT, do the following: 1. Write and check your program. 2. Use one of the RT-11 editors, such as EDIT, to enter your program into a source file. The EDIT command with the /CREATE switch invokes EDIT and tells it to create a new file. Type: .EDIT/CREATE prog.FOR where: prog is the name of your FORTRAN source program. For information about entering the text of your file, making changes, and displaying the file, see the Introduction to RT-11 and the RT-11 System User's Guide. NOTE Always specify a file type when you use an RT-11 editor. RT-11 editors do not use default file types. In this case, give your source file the type .FOR since that is the default file type the FORTRAN IV compiler uses when it compiles your program. 3. Use the FORTRAN IV compiler to create an object file of your program. Use the /CODE:THREADED option to produce threaded code. Also use /LIST:TT: option to direct a source program and storage map listing to your terminal. Do not use the compiler option that suppresses internal statement numbers because FDT needs them. Type: .FORTRAN/CODE:THREADED/LIST:TT: prog where: prog is the name of your FORTRAN source program. 4. Use the RT-11 linker to link the object file of your program with FDT.OBJ, the FORTRAN Debugging Technique software. Type: .LINK prog,FDT where: prog is the name of your FORTRAN program. 5. Run the program. Type: ___________ __________ ___ _____ ___ INSTALLING, VERIFYING, AND USING FDT Page 4-14 .RUN prog where: prog is the name of your executable program. For more information about compiling, linking, and running FORTRAN IV programs, see the RT-11 System User's Guide and the RT-11/RSTS/E FORTRAN IV User's Guide. APPENDIX A ___ _______ _______ FDT COMMAND SUMMARY Command Arguments Description ACCEPT loc=value Assign value as the new contents of loc. 'text' Print text on terminal. loc Accept a value from the terminal and assign it to loc. CONTINUE [ntimes] Resume FORTRAN execution. DIMENSION name(i,j,...)[,loc] Name and list the dimensions of a FORTRAN array ERASE name[,name2,...] Cancel the assignment of a name to a location. GOTO label Unconditional branch command changes execution sequence within an FDT macro. IF locvalue;FDT command Execute the FDT command only if the condition is true. MACRO m(FDT commands) Define FDT macro m. m Execute FDT macro m. m() Delete FDT macro m. NAME name[,loc] Associate a location specifi- cation with a name. PAUSE proc,isn [AFTER ntimes] [MACRO m] Create an FDT pause at internal statement number isn of procedure ___ _______ _______ FDT COMMAND SUMMARY Page A-2 proc. RESET proc,isn Remove an FDT pause. START Begin execution of main program. STEP [n] Resume execution and execute n statements. ___ _______ _______ FDT COMMAND SUMMARY Page A-3 Command Arguments Description STOP Return to operating system. TYPE loc Print value or text on the 'text' terminal. WATCH loc Cause an FDT pause when the contents of the specified location change. WHAT Print FDT status. APPENDIX B ___ ________ _____________ _______ FDT LOCATION SPECIFICATION FORMATS Format Meaning xxx Location offset in octal bytes name Named location name+xxx Relative addressing name(i,j,k,...) Subscripted name .MAIN. Base address of the FORTRAN main program (if the main program was not named in a PROGRAM statement) .BCOM. Base address of FORTRAN blank common .ABS. The zero address of memory APPENDIX C ___ _____ FDT MODES Mode FORTRAN Type Description I INTEGER*2 16-bit value displayed in decimal J INTEGER*4 32 bits, first 16 displayed in decimal L LOGICAL*4 32 bits, displayed as T or F M LOGICAL*1 8 bits, displayed as T or F E REAL*4 32 bits, scientific notation D REAL*8 64 bits, scientific notation C COMPLEX 64 bits, real and imaginary parts B BYTE 8 bits, displayed in decimal R ---- 16 bits, displayed as three RAD50 characters O ---- 16 bits, displayed in octal An ---- A string of n ASCII characters (1 <= n <= 255) Z ---- ASCIZ string (as used in the FORTRAN string handling package) Any mode in the above table can be preceded by the letter "P" to indicate that the associated location represents a FORTRAN argument or parameter variable. APPENDIX D ___ _____ ________ FDT ERROR MESSAGES Message Description of Error ?BAD DIM An invalid dimension limit was specified. ?BAD LOC The location specification is not aligned correctly according to its mode or it references a location outside the program bounds. ?BAD MACRO An attempt was made to redefine a macro while it was executing. ?BAD SUBS Subscripts are in an invalid format or cause overflow. FDT START FAIL Invalid main program, bad start address, or internal statement numbers not enabled in main program. ?FORMAT The input constant is not in the expected mode. ?LABEL The label specified does not exist. ?MACRO # The macro number is not in the range 0-7. ?NO CONVERSION Floating-point formats are not available with the current FORTRAN program (see Section 3.3). ?NO ROOM Not enough memory space to define a new PAUSE, MACRO, or NAME. ?ONLY IN MACRO The operation attempted is valid only within an FDT macro. ___ _____ ________ FDT ERROR MESSAGES Page D-2 ?PAUSE NOT FOUND An attempt was made to remove a PAUSE that is not active. %SUBSCR OUT OF BOUNDS The specified subscripts exceed the declared dimensions. (Warning message only.) ?UNDEFINED Syntax error or undefined name. INDEX /A, 2-3, 2-6, 2-21 Abbreviations, 1-4 .ABS., 3-1, 3-2, 3-3 Absolute address, 3-1 ACCEPT, 1-3, 2-2, 2-3, 2-10, 3-4, A-1 Address, Absolute, 3-1 Base, 1-5, 2-6, 3-2, 3-3, 3-4 Indirect, 3-4 Relative, 3-1, 3-3 Addressing, FDT, 1-4, 1-5, 1-6, 3-2, 3-3, 3-4 Array, Virtual, 2-6 Array element, 1-6, 1-9, 3-4 ASCII mode, 2-6 ASCIZ mode, 1-8, 2-21 Automatic FDT pause, 1-2, 1-10 ?BAD DIMENSION, D-1 ?BAD LOC, D-1 ?BAD MACRO, D-1 ?BAD SUBS, D-1 /BADBLOCKS switch, 4-3, 4-4 Base address, 1-5, 2-6, 3-2, 3-3, 3-4 .BCOM., 1-5, 3-3 Binary, Two's complement, 3-3 Blank common, 1-5, 3-3 _____ INDEX Code, Inline, 1-1 Mode, 1-8 Threaded, 1-1 /CODE switch, 4-6, 4-8 Codes, FDT mode, 1-7, 1-8, C-1 Command, COPY, 4-2, 4-3, 4-5 EDIT, 4-8 FORMAT, 4-2, 4-3, 4-4 FORTRAN, 4-8 INITIALIZE, 4-3, 4-4 LINK, 4-8 RUN, 4-8 SQUEEZE, 4-2, 4-3, 4-4 Command qualifiers (see switches) Command summary, FDT, A-1, A-2 Command types, FDT, 1-2 Commands, FDT control, 1-3 Information transfer, 1-3, 1-4, 2-21 Program control, 1-2, 1-3 Commas, 2-3, 2-20 Common, Blank, 1-5, 3-3 Named, 1-5, 3-1, 3-3 Conditional transfer of control, 2-9 Constant, String, 2-3 CONTINUE, 1-2, 1-11, 2-5, 2-14, 2-15, A-1 Control, Conditional transfer of, 2-9 Unconditional transfer of, 2-8 Control commands, FDT, 1-3 Program, 1-2, 1-3 Convention, Mode, 2-3 Conventions, 2-2 Syntax, 1-3, 1-4 _____ INDEX Conversion, Format, 3-4 Mode, 2-4, 2-9 Conversion routines, Format, 3-4 COPY command, 4-2, 4-3, 4-5 Copying with only two mass storage devices, 4-3 Copying with three or more mass storage devices, 4-2 Corrections, 4-5 Making, 4-5 Count, Execution, 2-5, 2-14, 2-15, 2-22 /CREATE switch, 4-8 Creating a program that uses FDT, 4-6 CTRL/C, 2-8 Current procedure, 1-4, 1-7, 1-10 Data type, 1-4, 1-7, 1-9 Debugging procedure, 1-1, 1-2 Default files, 4-1 Defining a label, 2-8 Defining a macro, 2-10 Deleting a macro, 2-11 DIMENSION, 1-3, 1-7, 1-9, 2-6, A-1 Dimensions, Number of, 1-6 Disk or diskette, Initializing a, 4-3, 4-4 Squeezing a, 4-3, 4-4 Disks and diskettes, Formatting, 4-2, 4-3, 4-4 Displacement, 1-6, 3-3, 3-4 Distribution kit, 4-2 Dummy variable, 1-8 EDIT command, 4-8 Element, Array, 1-6, 1-9, 3-4 Entry pause, 1-10, 2-15, 2-22, 3-5 _____ INDEX Entry point, 1-10, 2-13 ERASE, 1-3, 1-7, 2-7, A-1 Error message, 1-4, 1-11, 2-14, 2-15, 2-17 Error messages, FDT, D-1 Executable statement, 1-2, 1-3, 2-17, 2-18 Executing a macro, 2-11 Execution count, 2-5, 2-14, 2-15, 2-22 Execution speed, 3-5 FB, RT-11, 3-1 FDT, 1-1 Creating a program that uses, 4-6 Installing, 4-1, 4-2 FDT addressing, 1-4, 1-5, 1-6, 3-2, 3-3, 3-4 FDT command summary, A-1, A-2 FDT command types, 1-2 FDT control commands, 1-3 FDT error messages, D-1 FDT location specification, B-1 FDT macro, 1-3, 2-2, 2-3, 2-10, 2-11, 2-14 FDT mode codes, 1-7, 1-8, C-1 FDT modes, 1-7, 1-8, 2-21, C-1 FDT pause, 1-1, 1-2, 1-4, 1-10, 2-13, 2-21, 2-22 FDT pause, Automatic, 1-2, 1-10 FDT START FAIL, 1-2, D-1 FDT.OBJ, 4-1 FDTVER.FOR, 4-1, 4-6 FDTVER.FOR verification program, 4-1, 4-6 File protection, 4-5 Files, Default, 4-1 Source, 4-1 Foreground/background, RT-11, 3-1 _____ INDEX ?FORMAT, D-1 FORMAT command, 4-2, 4-3, 4-4 Format conversion, 3-4 Format conversion routines, 3-4 Formatting disks and diskettes, 4-2, 4-3, 4-4 FORTRA.SAV, 4-1 FORTRAN command, 4-8 FORTRAN pause, 1-10 FRUN, 3-1 GOTO, 1-3, 2-8, 2-10, A-1 IF, 1-3, 2-9, 2-10, 3-4, A-1 IF, Logical, 1-12, 2-9, 2-18 Implicit macro, 2-11 Indirect address, 3-4 Indirect addressing, 3-4 Information transfer commands, 1-3, 1-4, 2-21 INITIALIZE command, 4-3, 4-4 Initializing a disk or diskette, 4-3, 4-4 Inline code, 1-1 Installation procedure, 4-1 Installation requirements, 4-1 Installing FDT, 4-1, 4-2 Internal statement number, 1-1, 1-2, 1-10, 2-5, 2-15, 2-22, 3-5 Kit, Distribution, 4-2 ?LABEL, 2-8, D-1 Label, Defining a, 2-8 Numeric, 2-8 _____ INDEX Library, 2-13, 3-4 Link, 3-4 LINK command, 4-8 Link map, 1-1, 3-1 /LIST switch, 4-8 Literal, Text, 2-2 Literal text, 2-20 Location, Named, 1-5, 1-6 Offset, 1-5 Relative, 1-5, 1-6 Subscripted name, 1-5, 1-6 Location specification, 1-5, 2-12, 3-2 Location specification, FDT, B-1 Logical IF, 1-12, 2-9, 2-18 Logical relation, 2-9 Loops, 2-8 MACRO, 1-3, 2-10, A-1 ?MACRO, D-1 Macro, Defining a, 2-10 Deleting a, 2-11 Executing a, 2-11 FDT, 1-3, 2-2, 2-3, 2-10, 2-11, 2-14 Implicit, 2-11 Main program name, 1-2 .MAIN., 3-3 Making corrections, 4-5 Map, Link, 1-1, 3-1 Storage, 1-1, 1-5, 1-8, 2-6, 3-2 Mass storage devices, Copying with only two, 4-3 Copying with three or more, 4-2 Message, Error, 1-4, 1-11, 2-14, 2-15, 2-17 Messages, FDT error, D-1 Mode, 1-7, 2-3, 2-9, 2-12, _____ INDEX 2-20 Mode, ASCII, 2-6 ASCIZ, 1-8, 2-21 Step, 2-18 Mode code, 1-8 Mode codes, FDT, 1-7, 1-8, C-1 Mode convention, 2-3 Mode conversion, 2-4, 2-9 Modes, FDT, 1-7, 1-8, 2-21, C-1 NAME, 1-3, 1-6, 1-7, 1-10, 2-12, 3-1, 3-3, A-1 Name, Main program, 1-2 Name location, Subscripted, 1-5, 1-6 Named common, 1-5, 3-1, 3-3 Named location, 1-5, 1-6 ?NO CONVERSION, 2-4, D-1 ?NO ROOM, 2-15, D-1 /NOPROTECTION switch, 4-5 Number, Internal statement, 1-1, 1-2, 1-10, 2-5, 2-15, 2-22, 3-5 Number of dimensions, 1-6 Numeric label, 2-8 ODT, 3-4 Offset, 1-5, 2-6 Offset location, 1-5 ?ONLY IN MACRO, D-1 Option, /P, 3-1 /OUTPUT switch, 4-3, 4-4 Overhead, 3-5 /P option, 3-1 Parameter, 1-4, 1-8, 3-4 Patches (see making corrections) Pause, 1-10 PAUSE, 1-3, 2-5, 2-11, 2-13, 2-15, 2-22, 3-5, A-1 _____ INDEX Pause, Automatic FDT, 1-2, 1-10 Entry, 1-10, 2-15, 2-22, 3-5 FDT, 1-1, 1-2, 1-4, 1-10, 2-13, 2-21, 2-22 FORTRAN, 1-10 Statement, 1-10, 2-15 Step, 1-10 Watch, 1-10, 2-21 ?PAUSE NOT FOUND, D-1 Point, Entry, 1-10, 2-13 Procedure, Current, 1-4, 1-7, 1-10 Debugging, 1-1, 1-2 Installation, 4-1 Verification, 4-6 Program control commands, 1-2, 1-3 Program name, Main, 1-2 Program that uses FDT, Creating a, 4-6 Prompt, 1-2, 1-3, 2-2, 2-10 Protection, File, 4-5 /PROTECTION switch, 4-5 Qualifiers (see switches), Command RAD50, 1-8, 2-3 RCI$, 3-4 REENTER, 1-10, 2-8 Relation, Logical, 2-9 Relative address, 3-1, 3-3 Relative location, 1-5, 1-6 Requirements, Installation, 4-1 RESET, 1-3, 2-16, A-1 RESUME, 3-1 ROOM, ?NO, 2-15, D-1 Routines, Format conversion, 3-4 RT-11, 1-1 _____ INDEX RT-11 FB, 3-1 RT-11 foreground/background, 3-1 RT-11 SJ, 1-11 RUN, 2-8 RUN command, 4-8 /SINGLEDENSITY switch, 4-3, 4-4 SJ, RT-11, 1-11 Source files, 4-1 Specification, FDT location, B-1 Location, 1-5, 2-12, 3-2 Speed, Execution, 3-5 SQUEEZE command, 4-2, 4-3, 4-4 Squeezing a disk or diskette, 4-3, 4-4 START, 1-3, 1-9, 1-10, 2-8, 2-11, 2-17, 2-21, A-1 Statement, Executable, 1-2, 1-3, 2-17, 2-18 Statement number, Internal, 1-1, 1-2, 1-10, 2-5, 2-15, 2-22, 3-5 Statement pause, 1-10, 2-15 STEP, 1-3, 1-10, 1-11, 2-11, 2-18, 2-21, 3-5, A-1 Step mode, 2-18 Step pause, 1-10 STOP, 1-3, 2-19, A-2 Storage map, 1-1, 1-5, 1-8, 2-6, 3-2 String constant, 2-3 %SUBSCR OUT OF BOUNDS, 1-7, D-1 Subscript, 1-6, 2-9, 3-3 Subscripted name location, 1-5, 1-6 Summary, FDT command, A-1, A-2 Switch, /BADBLOCKS, 4-3, 4-4 /CODE, 4-6, 4-8 /CREATE, 4-8 _____ INDEX /LIST, 4-8 /NOPROTECTION, 4-5 /OUTPUT, 4-3, 4-4 /PROTECTION, 4-5 /SINGLEDENSITY, 4-3, 4-4 /WAIT, 4-4 Syntax conventions, 1-3, 1-4 Text, Literal, 2-20 Text literal, 2-2 Threaded code, 1-1 Three or more mass storage devices, Copying with, 4-2 Transfer commands, Information, 1-3, 1-4, 2-21 Transfer of control, Conditional, 2-9 Unconditional, 2-8 Two mass storage devices, Copying with only, 4-3 Two's complement binary, 3-3 TYPE, 1-3, 2-2, 2-20, 3-4, A-2 Type, Data, 1-4, 1-7, 1-9 Types, FDT command, 1-2 Unconditional transfer of control, 2-8 ?UNDEFINED, 1-4, 1-11, 2-6, D-1 Variable, Dummy, 1-8 Verification procedure, 4-6 Verification program, FDTVER.FOR, 4-1, 4-6 Virtual array, 2-6 /WAIT switch, 4-4 _____ INDEX WATCH, 1-3, 1-10, 2-21, A-2 Watch pause, 1-10, 2-21 WHAT, 1-3, 2-15, 2-22, A-2 /Z, 1-11, 2-3, 2-21