From: chnorik on
Sorry to disturb you all, just wonder whether I can do something like
this
cmp (1, eax); in HLA assembly.
I use HLA in mixed style, for example I do not use 'if else endif'
like statements, but I use procedure declarations to make life
easier :)

Comparison above gives me an error
syntax error, unexpected intconst

However, in gas I can do
cmpl $1, %eax

I suppose, that it is possible to compare register to the integer
constant with hla.
And I just cannot find the right syntax.
And I will be thankful for any hints.

Thanks

Norayr Chili
From: santosh on
chnorik(a)gmail.com wrote:

> Sorry to disturb you all, just wonder whether I can do something like
> this
> cmp (1, eax); in HLA assembly.
> I use HLA in mixed style, for example I do not use 'if else endif'
> like statements, but I use procedure declarations to make life
> easier :)
>
> Comparison above gives me an error
> syntax error, unexpected intconst
>
> However, in gas I can do
> cmpl $1, %eax
>
> I suppose, that it is possible to compare register to the integer
> constant with hla.
> And I just cannot find the right syntax.
> And I will be thankful for any hints.

IIRC the HLA CMP instruction has the operands reversed (in comparison to
other HLA instructions, which themselves have reversed operands
compared to Intel syntax). So it should be (I think):

cmp(eax, 1);

Do check AoA anyway. The CMP instruction is explained in the first
couple of chapters.

From: chnorik on
On Mar 30, 4:36 am, santosh <santosh....(a)gmail.com> wrote:
> chno...(a)gmail.com wrote:
> > Sorry to disturb you all, just wonder whether I can do something like
> > this
> > cmp (1, eax); in HLA assembly.
> > I use HLA in mixed style, for example I do not use 'if else endif'
> > like statements, but I use procedure declarations to make life
> > easier :)
>
> > Comparison above gives me an error
> > syntax error, unexpected intconst
>
> > However, in gas I can do
> > cmpl $1, %eax
>
> > I suppose, that it is possible to compare register to the integer
> > constant with hla.
> > And I just cannot find the right syntax.
> > And I will be thankful for any hints.
>
> IIRC the HLA CMP instruction has the operands reversed (in comparison to
> other HLA instructions, which themselves have reversed operands
> compared to Intel syntax). So it should be (I think):
>
> cmp(eax, 1);
>
> Do check AoA anyway. The CMP instruction is explained in the first
> couple of chapters.

No, I think not.
I did a grep in aoa html files and found CMP examples only with
variables, no constant :)
From: chnorik on
On Mar 30, 4:36 am, santosh <santosh....(a)gmail.com> wrote:
> chno...(a)gmail.com wrote:
> > Sorry to disturb you all, just wonder whether I can do something like
> > this
> > cmp (1, eax); in HLA assembly.
> > I use HLA in mixed style, for example I do not use 'if else endif'
> > like statements, but I use procedure declarations to make life
> > easier :)
>
> > Comparison above gives me an error
> > syntax error, unexpected intconst
>
> > However, in gas I can do
> > cmpl $1, %eax
>
> > I suppose, that it is possible to compare register to the integer
> > constant with hla.
> > And I just cannot find the right syntax.
> > And I will be thankful for any hints.
>
> IIRC the HLA CMP instruction has the operands reversed (in comparison to
> other HLA instructions, which themselves have reversed operands
> compared to Intel syntax). So it should be (I think):
>
> cmp(eax, 1);
>
> Do check AoA anyway. The CMP instruction is explained in the first
> couple of chapters.

Yes, you were right, it accepts constant as a second operand
Thank you
From: Frank Kotler on
chnorik(a)gmail.com wrote:
> Sorry to disturb you all,

We were disturbed anyway... :)

> just wonder whether I can do something like
> this
> cmp (1, eax); in HLA assembly.

You found the answer to this one, I see. I'll point out that there's a
!YAHOO! group dedicated to HLA:

http://tech.groups.yahoo.com/group/aoaprogramming/

Randy's out of town right now, but there are a bunch of guys there who
help each other with questions like this. (not to suggest that the folks
*here* don't know the answer...)

Best,
Frank