Make your own free website on Tripod.com

Running AMBLIST on HFS programs

Here is JCL that can be used to run AMBLIST on an executable program in the HFS: //S1 EXEC PGM=AMBLIST,REGION=80M,TIME=5 //SYSPRINT DD SYSOUT=* //HFS DD PATH='path',PATHOPTS=(ORDONLY) //SYSIN DD * LISTLOAD DDN=HFS,OUTPUT=XREF LISTIDR DDN=HFS where path is the HFS filename of the executable program.

LISTIDR produces a list of IDR data which includes translator history and date & time of last link-edit. The LISTLOAD command above produces a cross-reference listing for the program.

There is also an example of a REXX exec PGMHIST that reports history information on the Unix System Services and REXX page here. The nm shell command can also be used to report information about an executable program.

Using dbx to examine HFS executables

dbx can be used to load an executable into memory and examine it. Enter the command dbx pgm-name. You can enter the help subcommand to get more information. Enter q to quit. Because AMBLIST & the nm shell command use the binder to retrieve information from an executable, they do not work when the module has been linked as non-editable or built at a level not compatible with the current binder level.

Here are some examples of commands that can provide more information about an executable's structure:

map
returns load address, module size and end address.
listfuncs
returns information about module external symbols (unless the module is non-editable). For example,
xxxxx.c:         <== original source file
   Routine1      <== routine names
   Routine2
   Routine3
    ....
   Routine10
&symbol/ length
displays storage starting from a specified symbol. For example,
&Routine8/ 10   <== display storage
102d7b40:  47f0f028 01c3c5c5 00000198 00008140
102d7b50:  47f0f001 58f0c31c 184e05ef 00000000
102d7b60:  05404140 401e07f4
listi &symbol
displays storage and instructions starting from a specified symbol. For example,
listi &Routine8  <== list instructions
0x102d7b40 (Routine8)      47f0f028     b      X'28'(,$r15)
0x102d7b44 (Routine8+0x4)  01c3         ???
0x102d7b46 (Routine8+0x6)  c5c500000198 ???
0x102d7b4c (Routine8+0xc)  0000         ???
0x102d7b4e (Routine8+0xe)  814047f0     ???
Since you can display the starting locations associated with symbols, it is possible to derive module mapping information by computing the offsets of symbols from the load address.

Big Iron