An optimal code generator for generating structured assembly language expressions
is disclosed. Because of the equivalence between unit structured assembly language
expressions and the code implementing them, it is possible to represent complex
structured assembly language expressions as a vector of unit structured assembly
language expressions. A set of rules for systematic manipulation is utilized to
allow logical operations on the vector representation of structured assembly language
expressions to result in optimal code. Using the equivalence between the code and
unit structured assembly language expressions allows the vector representation
of a structured assembly language expression to be translated directly into code.