%μ VAX-11 Librarian V04-00 ύΝέΜߎ gζέΜߎ)f*5 HEX­ gζέΜߎ1 HEX5HEX (the Hex File Editor) can be invoked in two ways:Interactive mode:; >HEX Type HEX in response to the CLI prompt.1 HEX>command Command lines may be entered. HEX>command- HEX>^Z Control-Z terminates HEX.Indirect command mode:K >HEX @filespec where filespec is the file specification of an indirectC command file containing a list of HEX commands.2 SYNTAX>The following general notes apply to H EX command descriptions:L 1. aaaa, bbbb, and sequential uses of early letters of the alphabetL indicate a 4, 6, or 8-digit hex number, depending on the current mode) (16, 24, or 32-bit, respectively).L 2. vvvv, wwww, xxxx, or similar indicate a hex number of exactly the sameL number of digits as there are characters (e.g. vv is a 2-digit byte,) xxxxxx is a 6-digit 24-bit address).L 3. pp indicates a byte value which may be entered either as a 2-digit h exL number, or a character specification in one of the following forms/ (where c indicates a printing character):-A ^c control codes, 00-1F, shown as ^@, ^A, ^B, ... ^_H 'c printing characters, codes 20-7E, with parity bit set --J 'space to '~. (Some control codes are also accepted.): ^# the parity-clear delete character, code 7FE ~c control codes with parity bit set -- 80-9F, ~@ ... ~_; -c printi ng characters with parity bit set, --0 codes A0-FE, - , -!, ... -~8 ~# the parity-set delete character, code FFL 4. qqqq indicates a 16-bit value which may be entered either as a 4-digitL hex number, or a double-quote followed by two ASCII characters. ThusL "ab and 4142 have the same effect, since the hex codes for characters aL and b are 41 and 42 respectively. Only parity-clear, printing,. characters may be entered in this forma t.A 5. nnnnnnnn or mmmmmmmm indicates a 1-8 character program name.L 6. **** represents an entity which may either be a four-digit address or a% pseudo-register, written as %xx.+ 7. Uppercase words are required keywords.L 8. Structures in braces ({...}) show an optional parameter. The braces are not part of the syntax.L 9. All numbers (unless stated otherwise) and all input/output of the! HEX utility are hexadecimal.2 RANGE9Range specifications use d by many commands take the form:6 { ODD/EVEN } FROM aaaa/LOW THRU bbbb/HIGH { STEP ss } { PLUS/MINUS cccc }Gwhere aaaa and bbbb are the (inclusive) addresses for the operation. IfHss is omitted, every byte in that range is included (i.e. the default ssIis 01), otherwise only every ss'th address, starting at aaaa and <= bbbb,is used.HODD or EVEN force aaaa to the appropriate boundary and default ss to 02.JPLUS and MINUS add or subtract the given value from addresses read from orJwritten to the file. Only available with READ, COMPARE, WRITE, and APPEND.Haaaa may be replaced by LOW, which takes the value of the lowest addressGmet in the last READ or COMPARE, and similarly, bbbb may be replaced byHIGH.2 COMMANDS_LIST)The following hex commands are available:"ADDRESSING AND APPEND COMPARECOMPLEMENT COPY CRC CSUM!DECREMENT DISPLAY DIVIDE ECHOEDIT EXIT FILL FORMATHELP IDENT INCREMENT INITMOVE MULTIPLY NAME NEGATENOEC HO OFFSET OR READ#REMAINDER REVERSE ROTATE SEARCHSHIFT SUM TRANSFER USEWRITE XOR .(CLI command)?(Help) ctrl/Z(Exit)2 . . { CLI command }Fsends the rest of the line after the . keyword to the DCL command lineFinterpreter. Control returns to HEX after the command is executed. IfIno parameter is specified, the user's terminal is attached to the createdHsubprocess until you log out, at which point control is returned to HEX.FThis enables a system commands (e.g. an assembly) to be issued without7losing the contents of HEX's buffer and any edits made. 2 ADDRESSING ADDRESSING MODE {addr_mode}Owhere addr_mode is either 16, 24, or 32. If no parameter is included, displaysGthe current addressing mode. Otherwise sets the addressing mode to thespecified value.2 AND9 AND { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } WITH pp0logically AND's pp with every byte in the range.2 APPEND5 APPEND { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }L  { PLUS/MINUS cccc } { PARTIAL } { WIDTH vv/vvvv } FILE filespec7extends an object file defining locations aaaa to bbbb.HIf given, vv determines the maximum number of bytes output per line, by Lcausing a new record to be started at addresses which are exact multiples ofKvv, e.g. if vv=10, records start at addresses aa00, aa10, aa20 ..., and the!maximum length is thus 16. bytes.KThe current program name will be included in the object file if the currentIobject format provides for  this. A trailer record containing the transfer>address (if any) will be written unless suppressed by PARTIAL. 2 COMPARE7 COMPARE {{ ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }}7 { PLUS/MINUS cccc } { PARTIAL } { 274 } FILE filespecIwhere filespec is a file specification of an object file. (See FORMAT fordefault filetype).HThe code defined by the file will be compared with memory (which is not changed).LOptionally, limits may be placed on the portion of the input file to be used Lto define virtual memory. If so specified, only code defining addresses fromKaaaa to bbbb will be placed in virtual memory. ss, if given, specifies thatKconsecutive input bytes go into every ss'th location in memory -- used whenfile so output by WRITE.AThe transfer address and name (if given) update the current ones.GPARTIAL says that a trailer record should not be expected (or allowed). 2 COMPLEMENT8 COMPLEMENT { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }6Sets every ss'th location from aaaa to bbbb to its 1's'complement, i.e. every bit is inverted.2 COPY: COPY { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } TO cccc { REPEAT vvvv }Hcopies the values contained in every ss'th location from aaaa to bbbb toJsequential locations starting at cccc. The copy does not affect the source0area unless it is overlapped by the target area.GIf the REPEAT option is given, vvvv contiguous copies of the source aremade.2 CRC/ CRC FROM aaaa THRU bbbb { STEP ss }{ TO **** }ICalculates and displays the standard bisync CRC of every ss'th byte from Jaaaa to bbbb, using a preset of 0000. If a TO address (or pseudo-register);is specified, the result is stored there in high-low order.2 CSUM2 CSUM { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }Lcalculates and displays a 16-bit byte-wise summation of ss'th locations fromKaaaa to bbbb, and writes a a SAL assembler-type CSUM block is at bbbb+1, inform:" bbbb+1 = aaaa lo bbbb+2 = aaaa hi" bbbb+3 = sum lo bbbb+4 = sum hi 2 DECREMENTA DECREMENT { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } { BY pp }?Subtracts pp (default 1) to every ss'th byte from aaaa to bbbb. 2 DISPLAYC DISPLAY { ASCII } FROM aaaa THRU bbbb { STEP ss }{ FILE filespec }Ddisplays every ss'th byte from aaaa to bbbb, on the terminal (or, ifDspecified, in a file). If ss is (default) 01, aaaa to bbbb arerounded to aaa0 to bbbF.KFormat is 2-digit hex bytes, unless the ASCII keyword is included. In ASCIIKdisplays, non-printing characters are shown as equivalent letters prefixed by:@ ^ control codes, 00-37, thus ^C is ctrl/C, hex 03,; ~ control codes with parity bit set -- 80-9F,? - printing characters with parity bit set, A0-FE,@plus: ^# shows the parity-clear delete character, code 7F> ## shows the parity-set delete character, code FF DISPLAY PSEUDO6displays the current contents of the pseudo-registers. DISPLAY HIGH or DISPLAY LOW,displays the current values of HIGH and LOW.2 DIVIDE4 DIVIDE { SIGNED } { ODD/EVEN } FROM aaaa THRU bbbb  { STEP ss } BY pp>divides every ss'th byte from aaaa to bbbb by pp, and replacesit with the quotient,HSource and pp are considered unsigned unless the SIGNED option is given.2 ECHO ECHO0re-enables echoing of commands read from a file.2 EDIT EDIT aaaa { STEP ss }Kinitiates an interactive session which allows you to examine and optionallyEreplace the contents of virtual memory starting at location aaaa. Thefollowing display appears: aaaa vv=cc-Jwhere aaaa is the current address being edited, vv is its contents in hex,?and c is the ASCII character, shown as in DISPLAY. Reply with:-G vv to replace the contents of the location being edited and< bring up the next ss'th location for editing.E to leave the location as it is and open the next ss'th location.L vv^ to replace th e contents of the location being edited and open+ the previous ss'th location.I ^ to leave the location as it is and open the previous ss'th location.K vv to replace the contents of the open location and then return# to HEX command mode.J to leave the location as is and return to hex command mode.Kvv's may be 2-digit hex values, or ' followed by character whose ASCII codeGis to be inserted (parity clear). EDIT commands may not be issued fromindirect command files.2 EXIT EXITLcauses an exit from HEX, and return to the operating system or calling task.HIntended for use in a command file -- control/Z has the same effect at a terminal.2 FILL: FILL { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } WITH ppHEvery { ss'th } location from aaaa to bbbb is filled with byte value pp.2 FORMAT FORMAT { type {char}}JDisplays or specifies the object file format and sets READ/WRITE defaults: default max type WIDTH WIDTH filetype' ----------- ------- ------ -------- INTEL 32 250 .HEX MOTOROLA 32 252 .HEX ROCKWELL 32 252 .HEX RCA 32 169 .HEX+ TEKHEX 32 250 .HEX Tektronix emulator& EXTENDED {TEKHEX} 32 250 .HEX ditto% TEXAS 32 200 .OBJ TI99xx family MOSTEK 32 250 .HEX TCI 32 263 .HEX3 FAIRCHILD 32 254 .HEX "Fairbug" format2 IDENT IDENT;Displays HEX's current version number (last revision date). 2 INCREMENTA INCREMENT { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } { BY pp };Adds pp ( default 1) to every ss'th byte from aaaa to bbbb.2 INIT INIT WITH { pp }KThis command resets HEX to its initial conditions. Virtual memory is set toJvalue pp (default FF), the transfer address values is set to 0000, program name to null.2 MOVE# MOVE BYTE FROM **** TO ****#or MOVE WORD FROM **** TO ****Ewhere ****'s represent either a four-digit hex number valid under the3current offset, or a pseudo-register specification.KMOVE is a variation of the COPY command. It is limited to a one byte or oneJword transfer, but can access the pseudo-register set. Like COPY, MOVE hasHno affect on the source area. A word moves copies the entire word at one&time, rather than bytewise as in copy. 2 MULTIPLY6 MULTIPLY { SIGNED } { ODD/EVEN } FROM aaaa THRU bbbb  { STEP ss } BY pp)Multiplies every byte in the range by pp,HSource and pp are considered unsigned unless the SIGNED option is given.2 NAME NAME { nnnnnnnn }FIf nnnnnnnn is given, this becomes the new 1-8 character program name.?If nnnnnnnn is omitted, the current name (if any) is displayed.2 NEGATE4 NEGATE { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }2sets evey byte to its two's complement (negative).2 NOECHO NOECHOMsuppresses echoing of commands and READ/WRITE statistics reports when runningIfrom a command file. Has no effect when commands are being taken from theN terminal, or on error messages or SEARCH etc. reports. The default is to echo-all commands except comments starting with ;.2 OFFSET OFFSET { aaaa }JIf aaaa is specified, that value becomes the new offset. The offset shouldJbe chosen so that the addresses to be handled will be offset internally towithin 0000 to FFFF.LAfter the offset is given, the offsetting of addresses internally is totallyLtransparent to the user, i.e. the user specifies (and sees) actual addressesKThe offset may ! be 1 to 8 digits with the addressing mode set to 16-bit whenEfour or less digits are specified, 24-bit when five or six digits are?specified, and 32-bit when seven or eight digits are specified.4If aaaa is omitted, the current offset is displayed.2 OR8 OR { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } WITH pp9logically inclusive OR's pp with every byte in the range.2 READ< COMPARE/READ {{ ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }}7 { PLUS/MINUS cccc } { PARTIAL } { 274 } FILE files "pecIwhere filespec is a file specification of an object file. (See FORMAT fordefault filetype).LFor READ, the code defined by the file will be placed in its proper location:in virtual memory. Unspecified locations are not affected.LOptionally, limits may be placed on the portion of the input file to be usedLto define virtual memory. If so specified, only code defining addresses fromKaaaa to bbbb will be placed in virtual memory. ss, if given, specifies thatKconsecutive input bytes go # into every ss'th location in memory -- used whenfile so output by WRITE.AThe transfer address and name (if given) update the current ones.GPARTIAL says that a trailer record should not be expected (or allowed). 2 REVERSE5 REVERSE { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }Kreverses in place the values contained in every ss'th location from aaaa toAbbbb i.e. aaaa is exchanged with bbbb, aaaa+ss with bbbb+ss etc.. 2 REMAINDER7 REMAINDER { SIGNED } { ODD/EVEN } FROM aaaa THRU bb$bb  On { STEP ss } BY pp:Sets every byte in the range to the remainder (modulus) ondividing it by pp.HSource and pp are considered unsigned unless the SIGNED option is given.2 ROTATE4 ROTATE LEFT/RIGHT { ODD/EVEN } FROM aaaa THRU bbbb  { STEP ss } { BY pp }HInternally rotates each ss'th byte from aaaa to bbbb left or right by pp$bits. The default value of pp is 1.KFor LEFT rotates, bit 7 goes into bit 0; for RIGHT rotates, bit 0 goes intobit 7.2 SEARCH; SEARCH FR %OM aaaa THRU bbbb { STEP ss } FOR { NOT } pp/qqqqGsearches the specified range of virtual memory for bytes or words whichKmatch (or do not match) the value given. The addresses containing the valueKare displayed. In the case of a word value, the search is for that value in lo-hi order.?pp is a 2-digit hex byte, or 'char, ^char, -char, ~char, or ##.)eqqqq is a 4-digit hex word or "charchar.2 SHIFT SHIFT LEFT/RIGHT { SIGNED }8 { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } { BY pp } & BShifts each ss'th byte from aaaa to bbbb left or right by pp bits.The default value of pp is 1.4For a LEFT shift, zeroes are moved into the lo bits.HFor a RIGHT shift, zeroes are moved into the high bits unless the SIGNED1option is given, when the sign bit is replicated.2 SUM= SUM { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } { TO **** }Hcalculates and displays on the terminal a 16-bit byte-wise summation of Kss'th locations from aaaa to bbbb, optionally storing the result at 'addressor pseudo-register ****. 2 TRANSFER TRANSFER { aaaa }8If aaaa is given, this becomes the new transfer address.@If aaaa is omitted, the current one (or 0 if none) is displayed.2 USE USE aa OF bb FOR READLThis command sets up HEX to handle files in which the basic addressable unitLis wider than eight bits. The command instructs READ to input only one 8-bitGsection of the addressable unit at each location. Thus the USE command Callows these files to be split into partitions s(uitable for loadinginto 8-bit proms.Kbb represents the number of 8-bit groups that make up each addressable unitH(the width of the addressable unit must be a multiple of eight bits). aaCspecifies which of the bb bit groups is to be input as the value of a location.2 WRITE9 WRITE { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss }J { PLUS/MINUS cccc } { PARTIAL } { WIDTH vv/vvvv } FILE filespec7creates an object file defining locations aaaa to bbbb.GIf given, vv deter )mines the maximum number of bytes output per line, byLcausing a new record to be started at addresses which are exact multiples ofKvv, e.g. if vv=10, records start at addresses aa00, aa10, aa20 ..., and the!maximum length is thus 16. bytes.KThe current program name will be included in the object file if the currentIobject format provides for this. A trailer record containing the transfer>address (if any) will be written unless suppressed by PARTIAL.2 XOR9 XOR { ODD/EVEN } FROM aaaa THRU bbbb { STEP ss } WITH pp9Logically exclusive OR's pp with every byte in the range.ww