(* Global variable and type declarations *) (*************************** Constant Declarations ****************************) (* *) (* Error_Signalled - Used as a return code from LIB$TPARSE action *) (* routines. This value could actually be any positive even *) (* even number. When an action routine returns an even value *) (* to LIB$TPARSE that transition is considered a failure. This *) (* allows you to enter an action routine on some input, such as *) (* a hexidecimal number, and yet still reject the transition if *) (* if the input is out of range. *) (* *) (* File_Compare - Indicates that the file being read is to be compared *) (* with the data already in virtual memory. *) (* *) (* File_Read - Indicates that the file being read is to be put into *) (* virtual memory. *) (* *) (* Left - Represents the direction left for shifts and rotations. *) (* *) (* Minus - Indicates that the Plus_Minus_Value is to be subtracted from *) (* all addresses during reads and writes. *) (* *) (* Plus - Indicates that the Plus_Minus_Value is to be added to all *) (* addresses during reads and writes. *) (* *) (* Rev_Date - A string indicating the date of the last major revision of *) (* HEX. *) (* *) (* Right - Represents the direction right for shifts and rotations. *) (* *) (* VM_Size - Refers to the available size of the virtual memory. All *) (* references to this limit within the program (except one) are *) (* made by referring to this constant. Thus, if you wish to *) (* increase or decrease the size of virtual memory, you only *) (* have to change this constant in this file and HEX$DIRECTORY: *) (* HEX.PAS and then recompile all modules. The exception to *) (* this is in the module DECLAREVM. As the virtual memory is *) (* initialized to FF at compile time, this file must be editted *) (* so that the proper number of initialization assignments are *) (* included. *) (* *) (* CLIDEF.INC - Return codes to CLI$ library functions which are not *) (* included in STARLET.PEN. *) (* *) (* LIBDEF.INC - Return codes to LIB$ library functions which are not *) (* included in STARLET.PEN. *) (* *) (******************************************************************************) CONST VM_Size = 65535; Error_Signalled = 1000; Left = 0; Right = 1; Plus = TRUE; Minus = FALSE; File_Read = TRUE; File_Compare = FALSE; Rev_Date = '11-APR-1986'; %INCLUDE 'HEX$DIRECTORY:CLIDEF.INC/NOLIST' %INCLUDE 'HEX$DIRECTORY:LIBDEF.INC/NOLIST' (****************************** Type Declarations *****************************) (* *) (* Adress_Mode - The address modes (16, 24, and 32 bit) supported by *) (* HEX. *) (* *) (* Format - The object file formats supported by HEX. *) (* *) (* String_80 - An 80 character string. This is used as the basic string *) (* variable throughout HEX. *) (* *) (* Unsigned_Byte - The basic unit of virtual memory and the pseudo- *) (* registers. *) (* *) (* Unsigned_Word - An unsigned 16-bit integer. This data type is *) (* required for several system service calls. *) (* *) (******************************************************************************) TYPE Address_Mode = (Mode_16, Mode_24, Mode_32); Format = (INTEL, MOTOROLA, ROCKWELL, RCA, TEKHEX, EXTENDED_TEKHEX, TEXAS, MOSTEK, TCI, FAIRCHILD); String_80 = VARYING [80] OF CHAR; Unsigned_Byte = [BYTE] 0..255; Unsigned_Word = [WORD] 0..65535; (**************************** Variable Declarations ***************************) (* *) (* Addressing_Mode - The current addressing mode. *) (* *) (* Byte_Count - The number of bytes read in during a READ or COMPARE *) (* operation. *) (* *) (* Channel - The I/O channel required for $QIOW system service calls. *) (* *) (* Command_File_Flag - A boolean variable which is set to TRUE if HEX *) (* is currently processing commands from a command file. This *) (* variable is necessary because the EDIT command is not legal *) (* when entered from a command file. *) (* *) (* Current_Format - The object file format which the user has currently *) (* selected. The default is INTEL. *) (* *) (* Default_File_Type - The default file type associated with the current *) (* object file format. It defaults to .HEX, the default file *) (* type for INTEL format files. *) (* *) (* Default_Width - The default record width for the current format. *) (* This is used when writing a file from virtual memory. *) (* *) (* Differences - The total number of differences found by the COMPARE *) (* command between the specified file and the current contents *) (* of virtual memory. *) (* *) (* Direction - The direction (set to one of the constants LEFT or RIGHT) *) (* to be used for the current SHIFT or ROTATE command. *) (* *) (* Display_ASCII - A boolean variable which is set to TRUE when the user *) (* wishes to display the data in ASCII, rather than hexidecimal, *) (* format. The default is FALSE. *) (* *) (* Echo - A boolean variable which is set to TRUE if commands from *) (* command files are to echoed to the screen. The default is *) (* TRUE. *) (* *) (* Edit_Flag - A boolean variable which is set to TRUE if an edit value *) (* is entered at the prompt within the EDIT command. This flag *) (* indicates that the value of the current cell of VM is to be *) (* set to the specified value. *) (* *) (* Edit_Tparse_Block - The data structure required by LIB$TPARSE used *) (* for parsing input which is prompted during an EDIT command *) (* session. *) (* *) (* Exit - A boolean variable which is set to TRUE if the command EXIT *) (* or a control-Z is entered at a command prompt. When Exit is *) (* TRUE, HEX stops processing commands and exits to DCL. *) (* *) (* Expecting - An unsigned integer containing the value the user expects *) (* to get for a SUM or CRC calculation. *) (* *) (* Expecting_Flag - A boolean variable which is set to TRUE if a CRC or *) (* SUM command includes an EXPECTING value and FALSE otherwise. *) (* *) (* From - The address from which to start processing the virtual memory. *) (* This variable is set by all commands which require a range *) (* specification. *) (* *) (* High - The highest address read in from the file in a READ operation. *) (* It is initially set to 0. *) (* *) (* Looking_for_Byte - The unsigned byte which is being searched for by *) (* the SEARCH command. *) (* *) (* Looking_for_Word - The unsigned word which is being searched for by *) (* the SEARCH command. *) (* *) (* Low - The lowest address read in from the file in a READ operation. *) (* It is initially set to 32 bits of ones. *) (* *) (* Maximum_Width - The maximum record width allowed for the current *) (* object file format. *) (* *) (* Not_Param - A boolean variable which is set to TRUE when the SEARCH *) (* command is looking for all bytes or words which do not match *) (* Looking_for_Byte or Looking_for_Word. *) (* *) (* Offset - The value of the current offset. This parameter can be set *) (* to any 32-bit unsigned value so that HEX's limited virtual *) (* memory buffer can handle the entire 2**32 address space. It *) (* is inititialized to 0 upon entering HEX. See Section 2.9 of *) (* the HEX Manual for further details. *) (* *) (* Old_From - The From parameter used for the last command which used *) (* one. *) (* *) (* Old_Step - The Step parameter used for the last command which used *) (* one. *) (* *) (* Old_Thru - The Thru parameter used for the last command which used *) (* one. *) (* *) (* Output_File - The file spec of the output file used in commands such *) (* as DISPLAY and READ. It is initialize to the null string. *) (* *) (* Partial - A boolean variable which is set to TRUE if the file being *) (* read or written is a partial file, i.e., does not contain a *) (* a trailer record, and FALSE if it is a complete file. *) (* *) (* Plus_Minus_Flag - A boolean variable which is set to TRUE if the *) (* Plus_Minus_Value is to be added to all addresses during read *) (* read and write operations and FALSE if it is to be subtracted.*) (* *) (* Plus_Minus_Value - An unsigned integer which contains the quantity *) (* which is to be added or subtracted to all addresses during *) (* read and write operations. *) (* *) (* Previous -A boolean variable which is set to TRUE if the EDIT command *) (* is to process the previous step'th value of virtual memory. *) (* *) (* Program_Name - An eight character string which contains the program *) (* name of the corresponding object file. This parameter is *) (* only used by some of the object file formats supported by *) (* HEX. *) (* *) (* Pseudo_From - A boolean variable which is set to TRUE if the address *) (* stored in the variable From refers to a pseudo-register. *) (* *) (* Pseudo_To - A boolean variable which is set to TRUE if the address *) (* stored in the variable To_Param refers to a pseudo-register. *) (* *) (* Range_Even - A boolean variable which is set to TRUE if the command *) (* specifies that only the even addresses within the given range *) (* are to be acted upon. *) (* *) (* Range_Odd - A boolean variable which is set to TRUE if the command *) (* specifies that only the odd addresses within the given range *) (* are to be acted upon. *) (* *) (* Range_Specified - A boolean variable which is set to TRUE if the *) (* current command has specified a range. *) (* *) (* Read_Flag - A boolean variable which is set to File_Read (TRUE) if *) (* the file being read is to be put into virtual memory or set *) (* to File_Compare (FALSE) if it is to be compared with the *) (* current contents of virtual memory. *) (* *) (* Signed - A boolean variable which is set to TRUE if the bytes in *) (* virtual memory are to be treated as signed bytes for the *) (* current command. This variable is only used by the DIVIDE, *) (* REMAINDER, and SHIFT RIGHT commands. *) (* *) (* Step_Param - The step parameter used in processing commands which *) (* require an address range. *) (* *) (* Thru - The address thru which to process the virtual memory. This *) (* variable is set by all commands which require a range spec- *) (* ification. *) (* *) (* To_Param - The address to which data objects are to be moved. This *) (* parameter is used by various commands such as MOVE and COPY *) (* which write or move data within the virtual memory. *) (* *) (* To_Specified - A boolean variable which is set to TRUE if TO followed *) (* by an address parameter is entered in a CRC or SUM command. *) (* This indicates that the CRC or SUM command is to write the *) (* result it calculated to the specified address. *) (* *) (* Tparse_Block - The data structure required by LIB$TPARSE which con- *) (* information about the parsing of the command line entered at *) (* HEX> prompt. *) (* *) (* Transfer - The current Transfer address. *) (* *) (* Use_1 - An unsigned integer variable which specifes which of the bit *) (* groups defined by Use_2 is to be input during a READ command. *) (* A value of zero indicates that no USE parameters have been *) (* specified. *) (* *) (* Use_2 - An unsigned integer variable which represents the number of *) (* 8-bit groups which make up each addressable unit for READ *) (* operations. A value of zero indicates that no USE parameters *) (* have been specified. *) (* *) (* Width - The record width for the current write operation. *) (* *) (* With_Param - The unsigned byte which contains the operand of the *) (* several of the HEX commands such as FILL, MULTIPLY, XOR, etc. *) (* *) (* *) (* CRC_Table - The data structure returned by a call to LIB$CRC_TABLE *) (* which is required by all calls to LIB$CRC. *) (* *) (* Pseudo_Register - The bank of 256 pseudo-register which can be *) (* accessed by several HEX commands. *) (* *) (* VM - The virtual memory which contains the data which is acted upon *) (* by almost all of the commands in HEX. *) (* *) (******************************************************************************) VAR (* Global Variables *) Addressing_Mode : [EXTERNAL] Address_Mode; Byte_Count : [EXTERNAL] INTEGER; Channel : [EXTERNAL] Unsigned_Word; Command_File_Flag : [EXTERNAL] BOOLEAN; Current_Format : [EXTERNAL] Format; Default_File_Type : [EXTERNAL] String_80; Default_Width : [EXTERNAL] INTEGER; Differences : [EXTERNAL] INTEGER; Direction : [EXTERNAL] INTEGER; Display_ASCII : [EXTERNAL] BOOLEAN; Echo : [EXTERNAL] BOOLEAN; Edit_Flag : [EXTERNAL] BOOLEAN; Edit_Tparse_Block : [EXTERNAL,VOLATILE] TPA$TYPE; Expecting : [EXTERNAL] UNSIGNED; Expecting_Flag : [EXTERNAL] BOOLEAN; Exit : [EXTERNAL] BOOLEAN; From : [EXTERNAL] UNSIGNED; High : [EXTERNAL] UNSIGNED; Looking_for_Byte : [EXTERNAL] Unsigned_Byte; Looking_for_Word : [EXTERNAL] Unsigned_Word; Low : [EXTERNAL] UNSIGNED; Maximum_Width : [EXTERNAL] INTEGER; Module_Type : [EXTERNAL] BOOLEAN; Not_Param : [EXTERNAL] BOOLEAN; Offset : [EXTERNAL] UNSIGNED; Old_From : [EXTERNAL] UNSIGNED; Old_Step : [EXTERNAL] INTEGER; Old_Thru : [EXTERNAL] UNSIGNED; Output_File : [EXTERNAL] String_80; Partial : [EXTERNAL] BOOLEAN; Plus_Minus_Flag : [EXTERNAL] BOOLEAN; Plus_Minus_Value : [EXTERNAL] UNSIGNED; Previous : [EXTERNAL] BOOLEAN; Program_Name : [EXTERNAL] PACKED ARRAY [1..8] OF CHAR; Pseudo_From : [EXTERNAL] BOOLEAN; Pseudo_To : [EXTERNAL] BOOLEAN; Range_Even : [EXTERNAL] BOOLEAN; Range_Odd : [EXTERNAL] BOOLEAN; Range_Specified : [EXTERNAL] BOOLEAN; Read_Flag : [EXTERNAL] BOOLEAN; Repeat_Param : [EXTERNAL] INTEGER; Signed : [EXTERNAL] BOOLEAN; Step_Param : [EXTERNAL] INTEGER; Thru : [EXTERNAL] UNSIGNED; To_Param : [EXTERNAL] UNSIGNED; To_Specified : [EXTERNAL] BOOLEAN; Tparse_Block : [EXTERNAL,VOLATILE] TPA$TYPE; Transfer : [EXTERNAL] UNSIGNED; Use_1 : [EXTERNAL] INTEGER; Use_2 : [EXTERNAL] INTEGER; Width : [EXTERNAL] INTEGER; With_Param : [EXTERNAL] Unsigned_Byte; CRC_Table : [EXTERNAL] ARRAY [1..16] OF INTEGER; Pseudo_Register : [EXTERNAL] PACKED ARRAY [0..255] OF Unsigned_Byte; VM : [EXTERNAL] PACKED ARRAY [0..VM_Size] OF Unsigned_Byte; %INCLUDE 'DISK$TOOLS:[MOORE.HEX]HEXERR.INC/NOLIST'