Re: How to move two valuables to x86 CPU register ebx, ecx by using AT&A inline asm.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After testing:

# gcc inlineasm.c
inlineasm.c: Assembler messages:
inlineasm.c:7: Error: suffix or operands invalid for `out'
[root@debian-johnny] ~/workspace/test

# cat inlineasm.c
#include <stdio.h>

int main ()
{
    unsigned int val = 5, tmp = 10;
    asm volatile ("outb $0x27, %%al"
     :
     : "a" (0xb2), "b"(val), "c" (tmp)
    );
}

    It seems the source of outb instruction cannot be a constant. Is
there a AT&T instructions document for x86?

BRs, H. Johnny
> Why not just:
> ("outb $0x27, %%al" : : "a" (0xb2), "b"(val), "c" (tmp));
> --
> js
> Faculty of Informatics, Masaryk University
> Suse Labs, Novell
>

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux