News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Masm and ML help files

Started by Klod, February 04, 2007, 11:27:02 PM

Previous topic - Next topic

Klod

I  have googled for some time, but don't seem to have any luck.
I would like to experiment with different compiler and linker settings. The only documentation I have come across is for Masm 6.1 at the webster site.
Is there a newer help file available?
thaks

Tedd

There is a help file included with the masm32 package - "masm32.hlp" - open the index and find topics 'ML Options' and 'LINK Options'

Also the same as executing "ml /?" and "link /?" (with those two programs on the current path, or in the current directory.)
No snowflake in an avalanche feels responsible.

Klod

Thanks Tedd for the repley

For the last few days, I tryed several different settings, but did not get the results I hoped for.
I would like to include code symbols into my code, which then would be displayed in the debugger.
I use Radasm and Ollydbg.
Any suggestions?

Tedd

add "/Zi" for ml
and "/DEBUG /DEBUGTYPE:CV" for link

that will give you symbols and line number information (in ollydbg at least.)
No snowflake in an avalanche feels responsible.

Klod

Thanks Tedd for the repley
I havetried these options and it works.
Why would the assembler put in all thes INT3 ops ::)

If I run without debug info, these ops are not in the PE?

Tedd

Mostly it will be down to alignment of functions and/or data - it's just padding. The extra symbol info, will cause things to be aligned differently, so they will be inserted to re-align it.
"INT 3" is a software breakpoint, so that's why it's used (instead of simply "nop"), so if it gets executed that passes control to the debugger (this is what's used when you set a breakpoint in the debugger.)
No snowflake in an avalanche feels responsible.

Klod

Thanks for your reply, Tedd
In my quest to learn to program in asm, I concentrated more on using masm constructs and macros etc. This is probably OK for a beginner, but my programs have increased in both size and complexity. To my shame Ihave to confess, that I do not recognize my code in the debugger, or only with a great deal of guessing. :dazzled:
I tried multiple switches and combinations thereof on the command line, but the generated files are so large that I loose my way.

is it possible to this with ml?
Wndproc.c-- 16: switch(LOWORD(wParam))
00402533 8B4510                   mov     eax,[ebp+10h]
00402536 25FFFF0000               and     eax,0FFFFh
0040253B 2D12270000               sub     eax,2712h
00402540 83F804                   cmp     eax,4
00402543 0F879B000000             ja      4025E4h
00402549 FF2485B82B4000           jmp     dword ptr [402BB8h+eax*4]

This would be very helpful.
00402543 0F879B000000             ja      4025E4h      ;CustomMessages my symbol
Is it possible to create symbols that would change  obove code to ja CustomMessages instead of 4025E ?
Or how about a reference to the source lin?

One last question on ollyDbg, is it possible to step over dll calls?

realcr

Hey klod.

You can place something like this in your code:
nop
nop
nop
nop
and then search in ollydbg for these nops. it might be a good way to find your code.

realcr.

Klod

Thanks for your reply realcr,
You mean like inserting 4 nopes in source and then look for 4 nopes in debugger?
This sounds simple enough, will try

farrier

Klod,

I do the following when debugging with Ollydbg:

On the line prior to the code I want to debug, I place an
int 3
instruction.  Open your program in Ollydbg, then press Run.  This will generate a software/debug interrupt, and Ollydbg will stop at that instruction and allow you to single step through the following code.

Remember to remove or comment out the int 3 instruction when you finish using Ollydbg, or you will still be generating a software interrupt when you don't want one!

To jump over API calls, use the Step Over button (F8).

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

Klod

Thanks to all of you who contributed.
Your help and suggestions are appriciated
klod