A method for code compression of a program, the method comprising
separating code from data. Software transformations necessary to make
address mappings between compressed and uncompressed space are introduced
into the code. Statistics are obtained about frequency of occurrence
instructions, wherein said statistics include frequency of occurrence of
two consecutive instructions. The program is parsed to identify
occurrence of instructions or instruction pairs. The identified
instructions are replaced with an address to a compressed bus-word table.
An address mapping is generated from uncompressed address to compressed
addresses.