CIS 351

Assembly Branches

Winter 2021

  1. Write an assembly function sumPositive that takes three integers as input and returns the sum of the positive integers. (If none of the integers are positive, return 0.) Use the actual hardware beq instruction. Don't use any of the branch pseudo-instructions.
  2. Write an assembly function conditionalSum that takes three integers and a boolean and returns (For purposes of practicing the if-else construct, limit yourself to only one jr statement.)

Updated Monday, 22 March 2021, 8:38 AM

W3c Validation