CIS 351

Intro to Assembly

Fall 2021

  1. Write the machine code that will perform this operation: add $10, $5, $3
  2. What operation does this line of machine code perform: 0x012c1010 = 0000 0001 0010 1100 0001 0000 0001 0000?
  3. Write an assembly function makes10 that takes two ints as input and returns true if one if them is 10 or if their sum is 10. (This is makes10 from CodingBat.)
  4. What is the result of the following operations:
  5. Assume a register contains either 0 or 1. Using not alone won't "flip" 1 to 0 and 0 to 1. What operation can you add that will have the desired effect?
  6. We'll say that a number is "teen" if it is in the range 13..19 inclusive. Write a function that takes two int values as input and returns true if one or the other is teen, but not both. (This is loneTeen from CodingBat.)

Updated Monday, 11 October 2021, 3:38 PM

W3c Validation