I've been using the VC6 IDE and debugger with MASM, but... I cant use VC6 breakpoints. I have to put int 3. Breakpoints good. The register window is okay, 'cept I'd like maybe a 8 dword stack history display so I can be sure the right values are getting passed. Stack history good. I cant use the variable window or watch window to do something like: MyVariable dd 0 And get updates if anything changes. Variable/memory location watch good. Other bells and whistles are also good.
Posted on 2001-04-02 21:54:00 by asm_happy
asm_happy, I use VC++ and I can set breakpoints, have you assembled the code in debug? You can use the watch window, the variable window is for C/C++ case your variables to the same 'C' type :- (char*)edi or use the ,mb watch qualifier. and the memory window is very handy, you can type things like 'esi' into it and it will convert to an address (but it will no update the position of the window in memory when esi changes, you have to re-type esi in ) If you want the command settings I use for debug post here :) Umbongo
Posted on 2001-04-03 07:53:00 by umbongo
Hi umbongo, I tried to email you about the breakpoint problem, but I have not beeen able to send email for a few months now(can recive email) Please tell me how to set up a proper debug mode. VC has alot of options, most of which I don't know. I dont really understand this part: case your variables to the same 'C' type :- (char*)edi or use the ,mb watch qualifier. Is it in my code or watch window where you put (char*)edi? Would (char*) MyVariable work? Ill look in the VC help, if you can please explain what the ,mb watch qualifier does. The memory window is kinda handy, but I can really look at two memory locations at once unless they are close. addl: If anyone is wondering why I can't send email and don't get it fixed: Our company mail-sever is in South Korea. I am in Arizona. Our parent company doesnt seem to care that no one here can send email.
Posted on 2001-04-03 15:02:00 by asm_happy
asm_happy, It's dead easy, I'm using VC++ Version 6, but the other versions are pretty similar. I'll go through how to create a new windows application from the start. Create a new workspace selecting Win32 Application for a windows program or win32 Console application for a console program. Click OK and choose 'An Empty Project' The select Finish. You'' land up with a project with nothing in it, goto Project->Add To Project->Files... and select your .asm file to insert. Now got to the FileView tab on the project workspace and right click the .asm file and choose Settings... Select the custom Build tab and put :-

\masm32\bin\ml.exe /nologo /coff /Zi /Zd /Zf /c /Sa $(InputName).asm
in the Commands edit box, (make sure the path to ml.exe is right) then put

$(InputName).obj
in the Outputs. Thats it! now select ok and press F7, your program wil assemble and link :) The options I have given you there for MASM are for debug, you can select your own for the Release Build, but it's basically the same, just different options. For the debugger Watch Window:- Say you have a string like this:-

szWelcome db 'Welcome to WIN32ASM',13,10,0
and you want to see it as a string in the debugger, if you type the name into the watch window you get:-

szWelcome     0X57  'W'
as it is interpreting it as a byte, if you want a string do this:- (char*)&szWelcome Now you will get:-

+(char*)&szWelcome   0X004040400 "Welcome to WIN32ASM"
This is casting the byte to a character string so the debugger can see it. You can also dump a little of the memory in the watch window like this:- say EDI has a memory address in it, if you type

edi,mb
into the watch window you'll get a dump of 16 hex digits followed by 16 ascii chars, so if it was a string you'd see it and the hex digits of the ascii. The only thing you can't do is dereference the registers like this:-

(char*)&edi
Because you can't get the address of a register! This will work for registers, variables, including LOCAL types if they are in scope, and structures. There is a load of others you can use have a search in the documentation for "Symbols for Watch Variables" or on the 'net. If you want an example project I can email you one :) Hope this helps. Umbongo
Posted on 2001-04-04 05:35:00 by umbongo
Thanks for you help umbongo. It seems I'm missing the /Zi and /Zd flags. Thanks also for examples to use the watch window. If you could send me a small project by email, it could help if I have any more problems. I might have VC6 but found C++ to abstract to learn(and like it). Unlike assembly(which is fun). So I have not really figured out how to get the most out of the VC6 IDE.
Posted on 2001-04-04 18:15:00 by asm_happy