Skip to main content
Engineering LibreTexts

6.5: Problems

  • Page ID
    83031
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    1. Specify the bit mask that would be used to convert all 8 of the instruction formats for this chapter. In Chapter 6.3 it said the bit mask to select the register operation format is 0x00800000 and to select the immediate shift operation format is 0x01a00010. What are the bit masks for the 6 operation formats in this chapter?
    2. Translate the following MOV instructions into LSL instructions or LSL instructions to MOV instructions.
    2.1     LSL r1, r2, #0
    2.2     MOV r1, r2, LSL r0
    

    3. The following shift instruction LSL r1, #8, 4 is invalid, but it assembles to the machine code instruction MOV r1, #8. Why is the original instruction invalid? Try to see if you can figure why the programmer got this wrong? What does this tell you about the operand2 value?

    4. For the following assembly instructions translate them into machine code, with the answers given in hexadecimal format.

    5. For the following machine code instructions, translate them into their assembly code.

    6. Give the 12-bit values for the following Operand2 immediate values.

    7. Explain why the Multiply Code (bits 4-7 as 1001) can be used to specify a multiply instruction and will never be used in any other register instruction. (Note: you only need to consider the two 1’s in the value).

    8. Modify the decoder circuit for…

    In this chapter you will learn (Chapter 7):

    1. how a CPU uses the PC register to control the execution flow of statements in a program.
    2. the convention used as a mechanism to control the execution of a function, and the return from a function.
    3. the purpose of the Link Register (lr)
    4. the purpose of a program stack to store information that otherwise might be lost during the execution of the function,
    5. how to use the linkage editor (or linker) to create an executable program file.

    6.5: Problems is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

    • Was this article helpful?