Re: prime numbers

Frank Kotler <[email protected]>
Newsgroups org.kernel.vger.linux-assembly
Message-ID <[email protected]>
Paul Irofti wrote:

...
> ok, so than what's the diffrence between:
> a) movb $test, %al
> b) movb test, %al
> c) movb (test), %al
> c) movb ($test), %al      #if this exists!

Hmmm, I'm actually Nasmist, not an as user, but...

> and how come when i access kernel ops i use $<oper>
> 
> i.e. movl $__NR_write, %eax    #i actually append the address 1?! not 
> put the value 1?!

I perhaps shouldn't have said "address"... As I understand it, the '$' 
indicates an "immediate" value. "movl $4, %eax" (or $__NR_write) moves 
the value 4 into %eax. "movl 4, %eax" would move the contents of address 
0x00000004 into %eax - except that it segfaults because 0x00000004 isn't 
in "your" address space.

Maybe an actual (G)as user can clarify it better. It *is* confusing - if 
it were easy, everybody'd be doing it! :)

Best,
Frank
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.