Jump to content

Need help displayiong contents of various registers

- - - - -

  • Please log in to reply
3 replies to this topic

#1
devjeetroy

devjeetroy

    Newbie

  • Members
  • Pip
  • 5 posts
Hello Guys,
This would be my first post@codecall.net.
I have just started learning assembly(masm32 syntax) for ia-32 architecture. I have been studying the theory of it for a while and after getting a hang of the fundamentals of the ia-32 architecture, I just wrote a couple of programs, very simple ones that do nothing but perform simple arithmetic operations. Example:
.386

.model flat,stdcall

include \masm32\include\kernel32.inc

includelib \masm32\lib\kernel32.lib



.data

number1 byte 32

number2 byte 67


.data?

sum byte ?


.code

start:

      mov al,number1

      add al,number2

      mov sum,al

      invoke ExitProcess,0

END main

I would like to be able to check the value of the registers after these addition of the two numbers is carried out. I have this book, Introduction to 80x86 Assembly by Kip Irvine. In this book, the author uses his own file, irvine32.inc, that has a function/procedure called DumpRegs, that displays the contents of all the registers. Could someone point me to a tutorial or tell me how to do this stuff manually? I know that it might be lengthy and difficult, but I'll take time and try to understand how it works, since I prefer using my own code than the code in irvine32.inc.

Thank You,
Devjeet

#2
Gunner

Gunner

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
You say you are using MASM32 and not MASM? Technically they are different, MASM32 is a complete package by Hutch with samples and libraries... MASM is just ML (and link I think) from MS. If it is MASM32, open your MASM32 directory, and take a look inside masm32\vkdebug\dbproc

you can include the inc file there and includelib the lib file there... read the help file to know how to use it... that is the easy way.... contents of registers are numbers (or string pointers) so you will have to convert the numbers to a string to display them... or you can create a edit window and use, the API SetDlgItemInt to convert the number in the register to a string and show in the edit box... MASM32 also has plenty of conversion functions in its lib that can and will help you... If not MASM32, then you will have to convert the contents of the register to a string to display.

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Are you compiling to the COM format? If so, I can show you how to use interrupts to do so. EXE programs have to do it differently.
sudo rm -rf /

#4
devjeetroy

devjeetroy

    Newbie

  • Members
  • Pip
  • 5 posts
Thanks guys, but i found out how to use the atodw and dwtoa procedures from the masm32 library!:)




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users