Question: 6 . ( 5 0 pts ) Build an assembly language subroutine named SuperfyR 0 that will find the largest of the values in the

6.(50 pts) Build an assembly language subroutine named SuperfyR0 that will find the largest of the
values in the registers R0, R1, R2, and R3 and copy that value into R0. For example, if R0 contains 28,
R1 contains 15, R2 contains 3, and R4 contains 77 when your subroutine is called, when your
subroutine is finished R0 will contain 77, R1 will contain 15, R2 will contain 3, and R4 will contain 77.
Your subroutine must be placed at address 0x30 in program memory and must use only instructions
that are contained in the CS150 AVR instruction subset. Your subroutine cannot use any data memory
locations or any registers other than R0, R1, R2, and R3 to solve this problem. (Note: Only these 30 instructions should be used ADD, ADC, CP, CPI, NEG, COM, AND, ANDI, EOR, OR, ORI, LSR, ASR, BRBC, BRBS, JMP, RJMP, CALL, RCALL, RET, RETI, MOV, IN, OUT, LDI, LDS, PUSH, POP, NOP, STS)

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!