News:

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

dumping registers, memory, etc. in masm

Started by allynm, July 18, 2009, 01:21:12 AM

Previous topic - Next topic

allynm

Hello everyone-

I am new to MASM, but not to 386 assembly.  I am trying to locate/identify available macros that can dump registers, including the floating point unit, and memory.  I've scanned thru the MASM library but can't see anything that looks like what I'm seeking.

Thanks,

Mark Allyn



disintx

Quote from: dedndave on July 18, 2009, 01:42:18 AM
maybe you want olly debugger or windbg
http://www.ollydbg.de/
http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#ERB

I would second Ollydbg. I wouldn't recommend using any type of register dumping in-code, while it is useful, I think that single-stepping through it live would be much better to find out where things are going wrong.

If it must be in code, you will probably have to write a proc yourself. Just remember to save the contents before you use them in a call to a function.

dedndave

i guess we could write such a function - lol
this isn't the first time it has been requested
dumping the FPU registers would take some work
you first have to figure out what precision is used, which registers are empty, and so on
but dumping the CPU registers is fairly simple if you use the masm32 library "print" and "uhex$"
you could even fancy it up by using "left$" and "right$"

farrier

allynm,


Look at the VKDebug package which comes with Masm32.  You can examine register, FPU, Memory with inline debugging code.  Examples included with the package.  It works great while running your code from within RadASM.

It's hard to beat single-stepping with OllyDbg.

hth,

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

allynm

Hello everyone -

My thanks for your suggestions and help on the register dumping question.  I will follow up on the vkdebug idea, because I am already familiar with ollydbg--and use it.  What I had in mind was inline macros. 

Paul Carter wrote 4 of them for his tutorial on NASM and they are very helpful in that environment.  Partly this comes from the fact that you can place their outputs on the console in such a manner that it is easy to compare them.  He wrote four of them:  register dump, memory dump, coprocessor dump, and a stack dump.  This last one is excellent way to understand how stacks really work.

I wouldn't begin to suggest that anyone write counterparts to these for MASM32 without further investigation.  I happen to like olllydbg a lot.  Agree that code stepping is excellent pedagogical device and for that alone ollydbg is great. 

Regards to all, and thanks for your direction.

Mark Allyn