News:

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

How to display CPU registers?

Started by Danish, April 13, 2008, 06:14:02 AM

Previous topic - Next topic

Danish

Hello friends   I need a short programme which would show me CPU registers so I can use their data to make sure my add,sub or div  programs are working.Please if you can gimme one little program which could help.

BogdanOntanu

The simple way is to use the functions already provided in MASM32 in order to print numbers "on screen". Check the MASM32 samples and also check countless small simple examples provided on this board.

I guess it is easier  to start with a console application than a GUI application for printing numbers on screen. This way you could print anything on screen ranging from register values to variables and memory region dumps. Later on you can write your own functions but you have to start somewhere.

If you are no capable of doing this then a fast solution would also be to use OllyDbg debugger. Start your program in Ollydbg and you can see the CPU registers values as you execute each instruction step by step.
Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

hutch--

Danish,

Here is a hint.


YourProc proc args etc ....

    LOCAL _eax  :DWORD

    mov _eax, eax

    print str$(_eax),13,10

    ret

YourProc endp


The trick is to write them to memory first so you don't change any registers. Once you have them in memory you just display them at the console.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php