[HECnet] Disassembling DEC C routines

hvlems at zonnet.nl hvlems at zonnet.nl
Sun Mar 13 14:35:41 PDT 2011


Mark, IIRC VAX compilers have an option that lists the assemblycode. It's either an option for /LIST or /OUTPUT. 
For C the included libraries may be omitted, again a switch for the CC command
Hans
------Origineel bericht------
Van:Mark Wickens
Afzender:owner-hecnet at Update.UU.SE
Aan: hecnet at Update.UU.SE
Aan: msw at hecnet.eu
Beantwoorden:hecnet at Update.UU.SE
Onderwerp: [HECnet] Disassembling DEC C routines
Verzonden: 13 maart 2011 21:58

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.


Verzonden vanaf mijn draadloze BlackBerry  -toestel



More information about the Hecnet-list mailing list