[HECnet] Disassembling DEC C routines

Mark Wickens mark at wickensonline.co.uk
Sun Mar 13 13:58:40 PDT 2011


Guys,

Purely out of interest, how would I diassemble a DEC C routine on VAX/VMS? Can I use DEBUG to do this?

For example, I have the following code:

#include <stdio.h>
#include <string.h>

void main(int argc, char **argv) {
              char to[32];
              strcpy(to, "Hello World!\n");
              printf(to);
}

If I use

BUBBLE$ cc/list/machine_code strcpy.c

I get the following:

          1       1267                 strcpy(to, "Hello World!\n");
                                                          D6 AF 9F       0027                   pushab   $CODE
                                                          D8 AD 9F       002A                   pushab   -40(fp)
                                      00000000* EF 02 FB       002D                   calls     #2,DECC$STRCPY


Note that the call to DECC$STRCPY is listed, but not the code in the routine.
I'm interested in how some of the C library routines are implemented at a machine code level from an academic point of view.

Regards, Mark.



More information about the Hecnet-list mailing list