[Gloucs] Fw:[Taclug-General] Linux Inline Assembly in C and C++

gloucs@mailman.lug.org.uk gloucs at mailman.lug.org.uk
Sat Nov 2 17:09:01 2002


---------- Forwarded Message ----------

From: james.smith31@juno.com
To: taclug-general@taclug.org
Subject: [Taclug-General] Inline Assembly in C and C++
Date: Fri, 1 Nov 2002 19:48:48 GMT

Hello,

I'm trying to use inline assembly to speed up a routine in a program it looks something like this:

This inline assembly is inside a C loop:
asm (
     "cmpb %1, %0 \n\t"
     "jl LOOPEND  \n\t" /* defined somewhere else */
     "cmpb %2, %0 \n\t"
     "je LOOPEND  \n\t"
    : :"g"(sbuff[dex]),
       "r"(buff[dex2]-range),
       "r"(buff[dex2]+range)
    );
 
This does not give me the same results as the C code even when I change aroud the conditions. Can someone tell whats is wrong? I think it is something with the constraints.


Thanks,
James E. Smith 
E-mail: james.smith31@juno.com
E-mail: code11smith007@aol.com




________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
_______________________________________________
Taclug-General mailing list
Taclug-General@taclug.org
http://www.taclug.org/mailman/listinfo/taclug-general





________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com