Code statements appear in a special kind of procedure that supports machine code insertions. Such procedures are useful for inserting very short sequences of machine-language instructions. The executable part of such a procedure contains only machine code insertions, and no exception handlers are allowed. The declarative part (if any) can contain only use clauses. The procedure must with in the predefined package, Ada.System.Machine_Code. We do not include an example of such a procedure here. (A "hypothetical example" may be found in Section 19.7.3 of [Cohen96].)
Another way of incorporating machine code is to write an assembly-language routine and to "import" it using the facilities of the predefined package Ada.Interfaces -- just as you would if you were importing some legacy code written in another language such as C, COBOL or Fortran.
[ Back to top of page ]