Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


13.8 Machine Code Insertions

(1)
A machine code insertion can be achieved by a call to a subprogram whose sequence_of_statements contains code_statements.
Syntax
(2)
       code_statement ::= qualified_expression;
(3)
Name Resolution Rules
(4)
The qualified_expression is expected to be of any type.
Legality Rules
(5)
The qualified_expression shall be of a type declared in package System.Machine_Code.
(6)
A code_statement shall appear only within the scope of a with_clause that mentions package System.Machine_Code.
Static Semantics
(7)
The contents of the library package System.Machine_Code (if provided) are implementation defined. The meaning of code_statements is implementation defined. Typically, each qualified_expression represents a machine instruction or assembly directive.
Implementation Permissions
(8)
An implementation may place restrictions on code_statements. An implementation is not required to provide package System.Machine_Code.

(9)
(10)
(11)
Examples
(12)
Example of a code statement:
(13)
       M : Mask;
       procedure Set_Mask; pragma Inline(Set_Mask);
(14)
       procedure Set_Mask is
         use System.Machine_Code; -- assume ``with System.Machine_Code;'' appears somewhere above
       begin
         SI_Format'(Code => SSM, B => M'Base_Reg, D => M'Disp);
         --  Base_Reg and Disp are implementation-defined attributes
       end Set_Mask;


Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12