comp.lang.ada
 help / color / mirror / Atom feed
* Accessing a register with a larger size from generic
@ 2001-09-27 18:31 Lutz Donnerhacke
  2001-09-27 19:16 ` David C. Hoos
  2001-09-28  8:53 ` Lutz Donnerhacke
  0 siblings, 2 replies; 4+ messages in thread
From: Lutz Donnerhacke @ 2001-09-27 18:31 UTC (permalink / raw)


  ------------------------------
[...with, use, package (body), ...]
subtype long is Interfaces.C.long;

type call_code is (KILL, FORK, EXIT, ...);
for call_code use (KILL => 1, FORK => 2, ...);

generic
   call : call_code;
   type type1 is private;
function syscall1 (arg1 : type1) return long;

function syscall1 (arg1 : type1) return long is
   res : long;
begin
   Asm ("int $0x80",
        Outputs => long'Asm_Output ("=a", res),
        Inputs  => (call_code'Asm_Input ("0", call),
                    type1'Asm_Input ("b", arg1)),
        Volatile => True);
   return res;
end syscall1;
  ------------------------------

generates code (using GNAT 3.13p) like:
  movb $2, %al
  xorw %bx, %bx
  int  0x80
instead of
  movl $2, %eax
  xorl %ebx, %ebx
  int  0x80


How can I change the type of the generated RTL expression to SI independed
of the generic type?



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2001-10-02  8:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-27 18:31 Accessing a register with a larger size from generic Lutz Donnerhacke
2001-09-27 19:16 ` David C. Hoos
2001-10-02  8:01   ` Lutz Donnerhacke
2001-09-28  8:53 ` Lutz Donnerhacke

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