From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,461d464a39a7a30a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.180.38.73 with SMTP id e9mr2930671wik.2.1367665926297; Sat, 04 May 2013 04:12:06 -0700 (PDT) Path: p18ni66820wiv.0!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!backlog1.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news.etla.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Erroneous code generation from GNAT or GCC? Date: Tue, 30 Apr 2013 23:22:28 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx05.eternal-september.org; posting-host="32bbea2852c3ac5f339194c0aa5925ed"; logging-data="24678"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uRiaVQqs7g2332KhItKxtgP44cs9hfYE=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:eMcMm2h5OwUy3V3ia08FXoda6W8= sha1:1tWPDAyTkKADTDem2KRL4vild44= X-Original-Bytes: 2714 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2013-04-30T23:22:28+01:00 List-Id: "Yannick DuchĂȘne (Hibou57)" writes: > Le Tue, 30 Apr 2013 21:06:09 +0200, Simon Wright > 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.