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

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!