comp.lang.ada
 help / color / mirror / Atom feed
* Code Statement
@ 2010-05-18 13:12 johnjohn
  2010-05-18 13:22 ` Ludovic Brenta
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: johnjohn @ 2010-05-18 13:12 UTC (permalink / raw)


Trying to use the "Code Statement" for a special project, by passing the 
ASM proc/func. So, can Gnat process a true "Code Statement" statement?

When I compile the following example using 
>gnat make temp.adb -gnatpg 
gcc -c -gnatpg temp.adb
temp.adb:10:07: incorrect type for code statement
gnatmake: "temp.adb" compilation error


Source code:

   package Machine_Code is

       type Asm_Insn is new Integer;  --  type required by gant

       x86_NOP    : constant Asm_Insn := 16#90#;

       type M_Code_0  is record
                         Opcode : Asm_Insn;
       end record;
       pragma Pack (M_Code_0);
   end Machine_Code;

Source code:

   with Machine_Code;

   procedure temp is

       procedure Test;

       procedure Test is
          use Machine_Code;
       begin
          M_Code_0'(Opcode => x86_NOP);  -- line 10
       end Test;

   begin
      null;
   end temp;




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

end of thread, other threads:[~2010-05-19 10:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 13:12 Code Statement johnjohn
2010-05-18 13:22 ` Ludovic Brenta
2010-05-18 13:29 ` AdaMagica
2010-05-18 15:05 ` sjw
2010-05-19  4:37   ` anon
2010-05-19  6:07     ` Simon Wright
2010-05-19  9:56       ` sjw
2010-05-19 10:20         ` AdaMagica

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