Disclosed is a compiler apparatus for generating an instruction code
composed of instruction sets each including an instruction that
designates an m-bit immediate value indicating a location of a data item
in a memory area. The compiler apparatus sequentially selects, based on
one data attribute, a data item from a group X composed of a plurality of
data items; and judges, each time a data item is selected, whether the
selected data item is allocatable to an n-byte memory area
(n.ltoreq.2.sup.m). When the judgment is negative, the compiler apparatus
specifies, based on a different data attribute, a data item out of all
the selected data items and excludes the specified data item from the
group X, and repeats the selection until all the data items remaining in
the group X after excluding specified data items are judged to be
allocatable to the memory area.