Question: Problem 4 [10 points] Assume you have a subroutine Max defined as shown belovw Assume you have 4 unsigned bytes b1, b2, b3 and b4
![Problem 4 [10 points] Assume you have a subroutine Max defined](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66dffe2f5dc50_63066dffe2ea1ec4.jpg)
Problem 4 [10 points] Assume you have a subroutine Max defined as shown belovw Assume you have 4 unsigned bytes b1, b2, b3 and b4 defined in RAM. Write the needed instructions that would use the Max subroutine to find the maximum number among b1, b2, & b3, and then store that maximum number in b4 (do not write the subroutine. Just use it) b1: b2: b3: b4: ORG $1000 ds.b 1 ds.b 1 ds.h 1 ds.b1 ORG $4000 Entry: ; your instructions go here ; Finds the maximum between 2 unsigned bytes ; Input: 2 unsigned bytes passed in registers A & B ; Output: result returned in B ; Affected Registers: D Max: some instructions RTS Problem 4 [10 points] Assume you have a subroutine Max defined as shown belovw Assume you have 4 unsigned bytes b1, b2, b3 and b4 defined in RAM. Write the needed instructions that would use the Max subroutine to find the maximum number among b1, b2, & b3, and then store that maximum number in b4 (do not write the subroutine. Just use it) b1: b2: b3: b4: ORG $1000 ds.b 1 ds.b 1 ds.h 1 ds.b1 ORG $4000 Entry: ; your instructions go here ; Finds the maximum between 2 unsigned bytes ; Input: 2 unsigned bytes passed in registers A & B ; Output: result returned in B ; Affected Registers: D Max: some instructions RTS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
