An emulator uses code translation and recompilation to execute target
computer system applications on a host computer system. Target
application code is partitioned into target application code blocks, and
related target application code blocks are combined into block groups and
translated. Translated application code block groups are sized to comply
with restrictions on branch instruction size. Upon selecting an
application code block group for execution, a cache tag is used to
determine if a corresponding translated code block group is available and
valid. If not, the block group is translated and executed. Sequentially
executed translated code blocks are located in adjacent portions of
memory to improve performance when switching between translated code
blocks. The emulator may use a link register of the host computer system
to prefetch instructions and data from translated code blocks. The
emulator also takes into account structural hazards in translating
instructions.