Seek help for the mixed compilation of c and assembly

Source: Internet
Author: User
For the mixed compilation of c and assembly-Linux general technology-Linux programming and kernel information, see the following for details. Another problem encountered during graduation project
First look at the code

# Include

Void _ delay (int loops)
{
Long dummy;
_ Asm _ volatile _ ("gettr" _ t0 ", % 1 \ n \ t"
"_ Pta 4," _ t0 "\ n \ t"
"Addi % 0,-1, % 0 \ n \ t"
"Bne % 0, r63," _ t0 "\ n \ t"

"Ptabs % 1," _ t0 "\ n \ t": "= r" (loops ),
"= R" (dummy)
: "0" (loops ));
}

Void _ udelay (unsigned long usecs, unsigned long lpj)
{
Usecs * = (unsigned long) HZ <32)/1000000) * lpj;
_ Delay (long) usecs> 32 );
}

# Ifdef notdef
# Define mdelay (n )(\
{Unsigned long msec = (n); while (msec --) udelay (1000 );})
# Else
# Define mdelay (n )(\
(_ Builtin_constant_p (n) & (n) <= MAX_UDELAY_MS )? Udelay (n) * 1000 ):\
({Unsigned long msec = (n); while (msec --) udelay (1000 );}))
# Endif


This is a mix of C and assembler functions.
Understand that it uses at&t's Assembly format. I have also read the introduction of this format,
For example, _ pta 4 and bne r63 still do not understand what it means.

Can you use related materials.
Thank you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.