Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions