News:

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

test compiling feature

Started by bCode, February 19, 2006, 07:25:40 PM

Previous topic - Next topic

bCode

         Hi All, I compile construction

          test reg,mem

but got

      test mem,reg

Why so?

example:
-----------------------------------------
.386
.model flat

.code
num1 dd 0
_start:
         test edi,num1
         ret
end _start
_________________________


Got test dword [num1],edi



bCode

 I want correctly compile

test edi,value
jc anyway

But got

test value,edi
jc anyway

arafel

Not sure, but I think memory location in test instruction only allowed to be in first operand. However masm allows a programmer to specify it as second operand for coding convenience. (it gets converted to correct order when assembled) .

so in short it's not matter whenever you use "test edi,value" or "test value, edi" the result is the same.