The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: silk.odyssey on March 21, 2006, 11:32:04 PM

Title: signed comparisons and high level directives
Post by: silk.odyssey on March 21, 2006, 11:32:04 PM
Is it possibe to perform a signed comparison with masm's high level control structures?
Title: Re: signed comparisons and high level directives
Post by: ChrisLeslie on March 22, 2006, 12:36:19 AM
Hi silk.odyssey

Welcome to the forum. :8)
Can you provide an example of code snippet for what and how you are trying to compare,
e.g.
X=?
Y=?
cmp X,Y, or .IF X < Y. ::)

Chris
Title: Re: signed comparisons and high level directives
Post by: silk.odyssey on March 22, 2006, 12:43:05 AM
for example:


.if eax < 0
...
.endif



in hla I can cast eax to an int32 type which is signed

if((type int32 eax) < 0 )

endif

maybe masm has something similar.
Title: Re: signed comparisons and high level directives
Post by: hutch-- on March 22, 2006, 12:51:45 AM
Try using the MASM data type SDWORD PTR. Normally they are not used in mnemonic coding but are useful in the pseudo high level syntax.
Title: Re: signed comparisons and high level directives
Post by: silk.odyssey on March 22, 2006, 12:59:09 AM
Thanks i think that does the trick.