The ZAP utility allows you to directly examine and modify files on a Files-11 volume. Using ZAP, you can patch task images and data files in an interactive environment without reassembling and rebuilding the task. ZAP's command syntax is generally that of ODT, except that commands must be terminated by a carriage return. ZAP is invoked by: ZAP>filespec[/switches] _commandline where: filespec = a standard RSX-11 file specification that identifies ZAP's input file. switches = one or more of the optional switches For further information type: HELP ZAP ADDRESSES HELP ZAP ARITHMETIC OPERATORS HELP ZAP GENERAL-PURPOSE COMMANDS HELP ZAP OPEN/CLOSE COMMANDS HELP ZAP REGISTERS HELP ZAP SEPARATORS HELP ZAP SWITCHES 2 ADDRESSES The general form of a ZAP address is: blocknumber:address op offset or relocation,address op offset where:blocknumber is an octal block number address is an octal number op is a ZAP arithmetic operator given below offset is an octal number relocation is the number of a relocation register (0-7) that was previously initialized For example: _53:120212;0R !set a relocation register to a module _0,254/ !open location 254 of the module is the equivalent of: _53:120212+254/ 2 ARITHMETIC ZAP Arithmetic Operators + Add a value to another value. Used in an expression that evaluates to form a ZAP command line element. - Subtract a value from another value. Used in an expression that evaluates to form a ZAP command line element. * Multiply a value by 50 octal and add it to another value. Used to form a RADIX-50 string. 2 GENERAL-PURPOSE-COMMANDS ZAP General-Purpose Commands X Exit from ZAP K Compute the offset between the value of the nearest (less than or equal to) Relocation Register and the currently-open location, display the offset value, and store it into the Q Register. O Display the jump and branch displacements from the current location to a target location. = Display in octal the value of the expression to the left of the equal sign. V Verify the contents of the current location. R Set the value of a Relocation Register. 2 OPEN/CLOSE-COMMANDS ZAP Open/Close Commands "/" Open a location, display its contents in octal, and store the contents of the location in the Q Register. If the address of the location is odd, the location is opened as a byte. """ Open a location, display the contents of the location as two ASCII characters, and store the contents of the location in the Q Register. "%" Open a location, display the contents of the location in RADIX-50 format, and store the contents of the location in the Q Register. "\" Open a location as a byte, display the contents of the location in octal, and store the contents of the location in the Q Register. "'" Open a location, display the contents as one ASCII character, and store the contents of the location in the Q Register. "^" Close the currently open location as modified and open the preceding location. "_" Close the currently open location as modified, use the contents of the location as an offset from the current location value, and open that location. "@" Close the currently open location as modified, use the contents of the location as an absolute address, and open that location. ">" Close the currently open location as modified, interpret the low-order byte of the location as the relative branch offset and open the target location of the branch. "<" Close the currently open location as modified, return to the location from which the last series of "_", "@", and/or ">" commands began, and open the next sequential location. 2 REGISTERS ZAP Internal Registers 0R-7R Relocation Registers 0 through 7. You load these registers with the base address of modules relocated by the Task Builder. These registers provide a convenient means of indexing into a module to change the contents of locations in the module. C Constant Register. You set this register to contain a 16-bit value, which can be specified as "C" in an expression. F Format Register. This register controls the format of the displayed address. If its value is 0, ZAP displays addresses relative to the largest value of any Relocation Register whose value is less than or equal to the address to be displayed. If the value of the Format Register is nonzero, ZAP displays addresses in absolute format. Zero is the initial value ofthe Format Register. Q Quantity Register. The value in the register is set by ZAP to contain the last value displayed at your terminal. "Q" can be used in expressions. To access the contents of the registers, specify a dollar sign ($) preceding the register. For example: $C/ directs ZAP to display the contents of the Constant Register. 2 SEPARATORS ZAP Command Line Element Separators , Separate a Relocation Register specification from another command line element. ; Separate an address from an internal register specification. Used in expressions that set values for Relocation Registers. : Separate a block number base value from an offset into the block. Used in most references to locations in a file. 2 SWITCHES /AB Process addresses entered in ZAP command lines as absolute byte addresses within the file. You should specify /AB for files that are not in task image format; you can also specify /AB for task image files. If /AB is not specified, addresses in ZAP command lines refer to addresses in the task image file as shown in the Task Builder task image map for the file. /LI Display the starting disk block and address boundaries for each overlay segment in the file in the form: ssssss: aaaaaa-bbbbbb where: ssssss: specifies the starting block in octal aaaaaa specifies the lower address boundary in octal bbbbbb specifies the upper address boundary in octal /RO Open the file in read-only mode. When /RO is specified, you can execute ZAP functions that change the contents of locations, but the changes are not made in the file.