370 EMBEDDED SYSTEMS
ii) ere are two numbers, X and Y, whose squares are to be found. Calling the pro-
cedure amounts to just writing the instruction BL SQUARE. is instruction will
cause a branching to the procedure named SQUARE. It also copies the current PC
value to the link register (LR).
iii) e procedure has only two instructions: one to perform squaring, and the other to
copy the LR content back to PC. e second instruction causes a return to the main
program.
iv) We need two multiplications, in addition to the squaring operation. ese two, that
is, 3X
2
and 5Y
2
are achieved by shifting and adding. e MUL instruction is used as
little as possible because it takes more time, and causes higher power dissipation.
v)