# Changeset 2092

Ignore:
Timestamp:
Jun 15, 2012, 1:38:07 PM (6 years ago)
Message:

Jaap noticed it's Randall Hyde not Holmes.

Location:
src/ASM/CPP2012-asm
Files:
2 edited

### Legend:

Unmodified
 r2090 In order to do this, we must solve the `branch displacement' problem---deciding how best to expand pseudojumps to labels in assembly language to machine code jumps. Clearly a correct but efficient strategy would be to expand all unconditional pseudojumps to the MCS-51's \texttt{LJMP} instruction, and all conditional pseudojumps to a set configuration of jumps using \texttt{LJMP} instructions; this is inefficient and a waste of valuable code memory space. Finding an efficient solution with this expansion process is not trivial, and is a well-known problem for those writing assemblers targetting CISC architectures (for instance, see~\cite{holmes:branch:2006}). Finding an efficient solution with this expansion process is not trivial, and is a well-known problem for those writing assemblers targetting CISC architectures (for instance, see~\cite{hyde:branch:2006}). To free the CerCo C compiler from having to consider complications relating to branch displacement, we have chosen to implement an optimising assembler, whose input language the compiler will target. [\mathtt{P_1}, \ldots \mathtt{P_n}] \xrightarrow{\left(\mathtt{P_i} \xrightarrow{\mbox{\fontsize{7}{9}\selectfont$\mathtt{expand\_pseudo\_instruction}$}} \mathtt{[I^1_i, \ldots I^q_i]} \xrightarrow{\mbox{\fontsize{7}{9}\selectfont$\mathtt{~~~~~~~~assembly1^{*}~~~~~~~~}$}} \mathtt{[0110]}\right)^{*}} \mathtt{[010101]} \end{displaymath} The most complex of the two passes is the first, which expands pseudoinstructions and must perform the task of branch displacement~\cite{holmes:branch:2006}. The most complex of the two passes is the first, which expands pseudoinstructions and must perform the task of branch displacement~\cite{hyde:branch:2006}. The function \texttt{assembly\_1\_pseudo\_instruction} used in the body of the paper is essentially the composition of the two passes.