lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2375c9f90911192248h368fa79di1761e7b4c479b25b@mail.gmail.com>
Date:	Fri, 20 Nov 2009 14:48:28 +0800
From:	Américo Wang <xiyou.wangcong@...il.com>
To:	Johnny Hung <johnny.hacking@...il.com>
Cc:	kernelnewbies@...linux.org, linux-kernel@...r.kernel.org,
	linux-embedded@...r.kernel.org
Subject: Re: How to move two valuables to x86 CPU register ebx, ecx by using 
	AT&A inline asm.

On Thu, Nov 19, 2009 at 5:50 PM, Johnny Hung <johnny.hacking@...il.com> wrote:
> Hi All:
>    I want to move two local valuables to x86 arch CPU ebx, ecx
> register and do outb cpu instruction by using AT&A inline asm in
> kernel driver.  The following code was I wrote but gcc report syntax
> error:

You must mean AT&T.

> ==
>    unsigned int val = 10;
>    unsigned int tmp = 5;
>    ....
>    __asm__ volatile ("movl %0, %%ebx"

You need to put "\n\t" in the end of each asm statement.

>          "movl %1, %%ecx"
>          "outb $0x27, $0xb2"


This is wrong, 'outb' instruction cann't accept both of
its operands as constants, IIRC.

>          :
>          :"r"(val), "r"(tmp)
>          :"%ebx", "%ecx"
>   );
>
> Does anyone can point me out. Any reply is appreciated.

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ