Browse Prior Art Database

Flexible Support of Built In Instructions for a High Level Language

IP.com Disclosure Number: IPCOM000122550D
Original Publication Date: 1991-Dec-01
Included in the Prior Art Database: 2005-Apr-04
Document File: 4 page(s) / 134K

Publishing Venue

IBM

Related People

Muehe, TC: AUTHOR [+3]

Abstract

A compiler technique to allow user-specified assembler instruction streams to be generated from a high-level language is disclosed. This technique has minimal impact on the high-level language (HLL) and the existing HLL compiler. The technique uses a language for creating built-in instruction (BII) or built-in procedures which will be compiled by a separate compiler. Templates are generated by the built-in compiler for each built-in procedure defined. The built-in procedures can then be called from within the HLL using that language's calling syntax. The compiler back-end expands the BII templates in-line, generating proper assembler instructions as output.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Flexible Support of Built In Instructions for a High Level Language

      A compiler technique to allow user-specified assembler
instruction streams to be generated from a high-level language is
disclosed.  This technique has minimal impact on the high-level
language (HLL) and the existing HLL compiler. The technique uses a
language for creating built-in instruction (BII) or built-in
procedures which will be compiled by a separate compiler.  Templates
are generated by the built-in compiler for each built-in procedure
defined. The built-in procedures can then be called from within the
HLL using that language's calling syntax.  The compiler back-end
expands the BII templates in-line, generating proper assembler
instructions as output.

      A language was created to allow the definition of BIIs. The
language defines an interface list which corresponds with the HLL
definition.  Following that is a sequence of assembly mnemonic
statements and other operations defined by the BII language.  The
built-in language statements are coded within comments of the
high-level language source in the modules which define the interface
to the BII routines. A BII compiler was developed to handle the
built-in language and became part of the compilation process.  When
an interface module is compiled, the BII compiler is invoked and
looks for any built-in language statements.  It verifies the
correctness of the built-in language statements and generates
templates for the BIIs in a separate file.

      A user makes use of a BII by placing a call to it using
the normal high-level language syntax for a procedure call. When this
procedure call is compiled, the HLL front-end generates a normal
calling sequence.  The back-end checks if there is a corresponding
built-in template for a procedure when it sees the call.  If there is
one, the BII template is read from the template file.  Symbolic
register references, symbolic references to the arguments passed to
the BII, and user-defined addresses are resolved and mapped to the
physical characteristics of the machine.  The assembler mnemonics
coded in the BII implementation are used verbatim to keep
independence from the assembly language.  The resulting assembler
instructions are then written into the output stream.

      The BII may generate a single instruction as well as a full
parameterized in-line assembly routine directly into the code stream.

      Fig. 1 shows a flow diagram of the compilation process
including the built-in instruction compiler.

      Some of the specific features of this invention include:
1.  The user can...