Discussion:
question
(too old to reply)
ahmad faizal arif
2005-10-30 18:08:41 UTC
Permalink
i have a question, can you compare the value in register directly in
assembly language?
e.g. cmp [%r2 - 1], [%r2]
thanks.
B A Bair
2005-10-31 00:33:20 UTC
Permalink
Not exactly the way that you have written it, no.

You can't use brackets with the 'cmp' instruction. The brackets mean use
the register contents as a pointer to an address in memory. Only the 'ld'
and 'st' group of instructions can do that.

You also can't do arithmatic like that in the same instruction. The
assembler allows it for some types of addressing modes, but again, that only
works in the 'ld' and 'st' instrucitons.

I hope that helps.

:-)
Bettina
Post by ahmad faizal arif
i have a question, can you compare the value in register directly in
assembly language?
e.g. cmp [%r2 - 1], [%r2]
thanks.
Continue reading on narkive:
Loading...