Review of the assembler instructions

  • Previously, we have learned:

         mov  rN, #smallConstant  // Store a small constant 
                                  // ([-100,100]) in register rN 
      
         movw rN, #:lower16:x     // Store the address of the
         movt rN, #:upper16:x     // variable x in register rN
      
         ldrsb rN, [rM]           // Load rN with byte  at mem[rM]
         ldrsh rN, [rM]           // Load rN with short at mem[rM]
         ldr   rN, [rM]           // Load rN with int   at mem[rM]
      
         strb rN, [rM]            // Store byte  from rN in mem[rM]
         strh rN, [rM]	    // Store short from rN in mem[rM]
         str  rN, [rM]	    // Store int   from rN in mem[rM] 
      

  • We will now combine the different instructions to perform the assignment statements b = 4; and b = a;