comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Erroneous code generation from GNAT or GCC?
Date: Tue, 30 Apr 2013 23:22:28 +0100
Date: 2013-04-30T23:22:28+01:00	[thread overview]
Message-ID: <lymwsfr74r.fsf@pushface.org> (raw)
In-Reply-To: op.wwdhx005ule2fv@cardamome

"Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr> writes:

> Le Tue, 30 Apr 2013 21:06:09 +0200, Simon Wright <simon@pushface.org>
> a écrit:
>> I was wondering what you meant by using constraints "a", "b", "c", "d"
>> .. I now see [3] that these are i386 constraints for the a..d registers
>> respectively, no wonder they gave wierd results on x86_64 where they
>> mean something quite different!
>
> They do exists with 64 bits instructions too. a is eax; b is ebx, etc,
> for 32 bits mode, and a is rax, b is rbx, etc, for 64 bits mode. There
> is also ax/ah/al, ax/bh/bl, etc, as sub-parts of the above, except ax,
> bx, etc, is for 16 bits only, but ah, al, bh, bl are still a
> accessible in 32 bits mode - I don't know if it's still the case in 64
> bits mode.

Your

      System.Machine_Code.Asm
        (Template => "int $0x80",
         Outputs => Integer'Asm_Output ("=a", Result),
         Inputs =>
           (Positive'Asm_Input       ("a", Number),
            Natural'Asm_Input        ("b", Handle),
            System.Address'Asm_Input ("c", Address),
            Natural'Asm_Input        ("d", Size)),
         Volatile => True);

translated to

	movl	%ecx, %edx
	movl	%edi, %eax
	movl	%esi, %ebx
	movq	%r8, %rcx
# 14 "library.adb" 1
	int $0x80

but I think I really don't want to learn Intel assembler, lots of other
good things to do.



  reply	other threads:[~2013-04-30 22:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 21:08 GNAT not generating any code for sub‑program: known bug? Yannick Duchêne (Hibou57)
2013-04-27 22:22 ` Yannick Duchêne (Hibou57)
2013-04-27 23:48   ` Yannick Duchêne (Hibou57)
2013-04-28  7:14   ` Simon Wright
2013-04-28 17:52     ` Yannick Duchêne (Hibou57)
2013-04-28 19:27       ` Yannick Duchêne (Hibou57)
2013-04-28 20:46         ` Simon Wright
2013-04-28 20:43       ` Simon Wright
2013-04-28 22:35 ` Erroneous code generation from GNAT or GCC? Yannick Duchêne (Hibou57)
2013-04-28 22:49   ` Yannick Duchêne (Hibou57)
2013-04-28 23:52   ` Yannick Duchêne (Hibou57)
2013-04-29  1:35     ` Yannick Duchêne (Hibou57)
2013-04-30  0:48       ` Yannick Duchêne (Hibou57)
2013-04-30  6:40         ` Simon Wright
2013-04-30 17:04           ` Yannick Duchêne (Hibou57)
2013-04-30 19:06             ` Simon Wright
2013-04-30 21:28               ` Yannick Duchêne (Hibou57)
2013-04-30 22:22                 ` Simon Wright [this message]
2013-05-01 18:19               ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox