News:

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

Checking sign flag

Started by unktehi, February 25, 2009, 06:04:08 AM

Previous topic - Next topic

unktehi

brethren - I downloaded OllyDbg, but it looks like it will only open .exe files.  I'm not sure how to save my .asm file into an .exe file.  Could you point me in the right direction? I'm using Visual C++ 2008 Express Edition for my project assignments.

brethren

Quotebrethren - I downloaded OllyDbg, but it looks like it will only open .exe files.  I'm not sure how to save my .asm file into an .exe file.  Could you point me in the right direction? I'm using Visual C++ 2008 Express Edition for my project assignments.

when you use an assembler on an asm file it produces an object file (obj),  next you use the linker to create an executable file (exe). This is the file you load into ollydbg. The great thing about an interactive debugger like olly is that you have complete control of how your program runs ie. you can watch it run one instruction at a time and observe how the flags and registers change and all sorts of other things  (like interactively changing the values of registers and flags while the program is running, setting breakpoints and even altering instructions)

Every assembly programmer needs to be able to use a debugger :wink

BATSoftware

Note: For the Intel series of processors, data transfer instructions like MOV, LODSB doe not set the flags registers only arithmetic instructions or specific flags register instructions do TEST, OR, ADD and the like.

For other processors this is not always the case. For the VAX series of processors, data transfer operations do set the Z and S-flags! This caused quite an issue when I moved from VAX/PDP-11 MACRO programming to Intell 80XX programming.

As a general note, you should return a value from a procedure in EAX that when TEST EAX,EAX or CMP EAX,???? is executed, the flags register is set appropriately.