The MASM Forum Archive 2004 to 2012

Specialised Projects => Assembler/Compiler Technology => Topic started by: Kolli on December 08, 2008, 08:36:28 PM

Title: PLI statements to Assembler instructions
Post by: Kolli on December 08, 2008, 08:36:28 PM
Hi,

    I got  a requirement where I need to find how many assembler instructions are generated for each PLI statements in a program. When I compile with LIST option, I get pseudo assembly listing. This listing has line number info from which I can map, but still some line numbers are 000000 which I can't map. can anyone help me how to map this 000000 line number in assembly listing  to  corresponding statement in the program. Thanks in advance

regards,
Vijai
Title: Re: PLI statements to Assembler instructions
Post by: MichaelW on December 08, 2008, 09:16:10 PM
Are the 000000 lines perhaps calls to a run-time library?
Title: Re: PLI statements to Assembler instructions
Post by: Kolli on December 12, 2008, 03:55:36 PM
Im sure,  it is not a call to a runtime library. when we compile with opt(2) option, assembler instruction are compressed & optimized. Optimization are done by reducing the machine instruction or moving some instruction to other place where its going to take less time in runtime.
Title: Re: PLI statements to Assembler instructions
Post by: ToutEnMasm on January 12, 2009, 04:09:44 PM
Hello,
The 000 start code will be at 400 000h +offset + correction at compiled time.
Corection at compiled time can change at each new compile.
Answer can be obtain:
-adding a label at start of code (starting_adress LABEL DWORD),more simple method
             the label start: could not be used,it is the starting adress of the code block and some code
             can be added at compiled time (it's the correction at compiled time)
-using the dbghelp.dll and the a pdb file (debug compile)
-reading the pe file (PE file format,take care with the correction at compiled time)