News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Sandbox dump registers

Started by greco558, August 23, 2016, 04:03:42 AM

Previous topic - Next topic

greco558

Hi All,

I wrote a short program to show the contents of registers.

I placed it in a program called sandbox.asm to test out pieces of code and show register contents
at different points by calling ShowReg procedure.

I have found it helpful for a quick check to see if a piece of code is doing what I want.

Thought I would post it in case anyone is interested.

Best Regards
John

hutch--

Works fine here John on Win 10 Professional.  :t

hutch--

Here is an alternative.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

regs proc

    LOCAL rEAX :DWORD
    LOCAL rEBX :DWORD
    LOCAL rECX :DWORD
    LOCAL rEDX :DWORD
    LOCAL rESI :DWORD
    LOCAL rEDI :DWORD
    LOCAL rEBP :DWORD
    LOCAL rESP :DWORD

  ; ---------------------------------------------
  ; copy 8 registers without altering any of them
  ; ---------------------------------------------
    mov rEAX, eax
    mov rEBX, ebx
    mov rECX, ecx
    mov rEDX, edx
    mov rESI, esi
    mov rEDI, edi
    mov rEBP, ebp
    mov rESP, esp

  ; --------------------
  ; display the 8 copies
  ; --------------------
    print hex$(rEAX)," = eax",13,10
    print hex$(rEBX)," = ebx",13,10
    print hex$(rECX)," = ecx",13,10
    print hex$(rEDX)," = edx",13,10
    print hex$(rESI)," = esi",13,10
    print hex$(rEDI)," = edi",13,10
    print hex$(rEBP)," = ebp",13,10
    print hex$(rESP)," = esp",13,10

    ret

regs endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

greco558

Hutch,
Thanks for the procedure, it will come in handy.
I am still working on learning all I  can about masm32 assembly language.
I have learned a lot working on my editbyte program.


hutch--

Hi John,

That is the best way to get up to pace, nothing beats writing enough code to get the swing of how it works. By the time you get up to pace we should have enough 64 bit stuff working to be useful.

greco558

#5
Hi All,

Here is a new Version of sandbox program.
I use it when I want to see how a piece of code effects the registers.
Shows contents of registers in Hex, Decimal, Binary, and ASCII printable characters.

Updated version to show EBP & ESP registers and removed break down of EDI & ESI


Best Regards
John