GCC inline assembly



Hi all,
I know that this may be a really stupid question, but I need some help
with inline assembly on GCC.
I'm trying to make an OS, and i'm having trouble copying register
values to integers with inline assembler
Here is some code:

//begin

int blah;

__asm__ __volatile__ ("mov %%eax,%0": "=g" (blah)::);


// end

I think that theoretically, this should move the eax register into
blah, but it doesn't. IO'm really stuck ,and help would be greatly
appreciated.
Thanks,
Mr Linux Guy

.



Relevant Pages

  • Re: GCC inline assembly
    ... with inline assembly on GCC. ... I'm trying to make an OS, and i'm having trouble copying register ... values to integers with inline assembler ...
    (comp.lang.asm.x86)
  • Re: asm volatile
    ... Only for gcc. ... intrinsics are often better - although they are normally restricted to single assembly instructions while your asm function/macro may cover more. ... Even better, of course, is when the compiler can recognise patterns in the C source and generate code directly. ... correct way of dealing with inline assembler. ...
    (comp.arch.embedded)
  • Re: asm volatile
    ... Only for gcc. ... So any compiler that is able to handle inlined assembly at least as well as gcc must have some way to distinguish ... of dealing with inline assembler. ... optimization are mutually exclusive things - unless the compiler understands ...
    (comp.arch.embedded)
  • Re: CodeWarrior 10 on Macintel
    ... But CW was definitely showing its age. ... >> be a front-end to gcc eventually. ... > they refused Apple's offer to provide a serious inline assembler, ... I wasn't commenting on the 'quality' of CW's compiler. ...
    (comp.sys.mac.programmer.codewarrior)
  • Re: [PATCH] Use -fno-unit-at-a-time if gcc supports it
    ... > look into inline assembler, ... > solution would be to add the compiler flag, ... in question so gcc knows that is somehow calls the function. ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)