It's my first try on C like syntax.:confused:
following lines can't be compiled.
error msg -->invalid instruction operands
;---
.if (_MousePosX>=_ULCornerX && _MousePosY>=_ULCornerY) && (_MousePosX<=_DRCornerX && _MousePosY<=_DRCornerY)
;//some code here
.else
;//some code here
.endif
;--
if I change the variables into registers all compiles fine.
Here my question:
C-like-syntax code like above only works with registers?
thanks for replies:(
following lines can't be compiled.
error msg -->invalid instruction operands
;---
.if (_MousePosX>=_ULCornerX && _MousePosY>=_ULCornerY) && (_MousePosX<=_DRCornerX && _MousePosY<=_DRCornerY)
;//some code here
.else
;//some code here
.endif
;--
if I change the variables into registers all compiles fine.
Here my question:
C-like-syntax code like above only works with registers?
thanks for replies:(
Don't use C-like syntax :)
Don't forget you can't compare two memory operands. If _MousePosX and _ULCornerX are in memory, you can't compare them directly. You have to move at least one in a register.
Don't forget you can't compare two memory operands. If _MousePosX and _ULCornerX are in memory, you can't compare them directly. You have to move at least one in a register.
thanks Dr.Manhatten
really fast reply:alright:
I give it a try
An advantage of this style is the good readability in the source, i think.
really fast reply:alright:
I give it a try
An advantage of this style is the good readability in the source, i think.
As far as I know, MASM doesn't like too many brackets.
It might be that you need spaces around the >= and <= operators.
Are you sure its <= and not =<?