This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug inline-asm/39440] New: User Manual: describe asm ("%a0,%c0"::)


The user manual at:
http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Extended-Asm.html#Extended-Asm
decribes a lot of the asm syntax, but do not describe the modifier in between
the percent sign and the digit (or [name]) inside the string of the asm.

One use case is to access global structure fields inside asm(""):
union {
    struct {
        int a;
        char b, c, d;
        } part1;
    unsigned long long part2;
    } global_var;

void fct(void) {
    asm volatile (" global_var_a = %c0 " : : "p" (global_var.part1.a) );
    asm volatile (" global_var_c = %c0 " : : "p" (global_var.part1.c) );
    }

asm (
"    movl $0,global_var_a    \n"
"    movb $0,global_var_c    \n"
);


-- 
           Summary: User Manual: describe asm ("%a0,%c0"::)
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: etienne_lorrain at yahoo dot fr
 GCC build triplet: all-all-all
  GCC host triplet: all-all-all
GCC target triplet: all-all-all


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39440


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]