Question: 1 0 . ( 5 0 pts ) . Build an assembly language subroutine named ExportR 1 Bits that copy bits from R 1 into

10.(50 pts). Build an assembly language subroutine named ExportR1Bits that copy bits from R1
into other registers. Your subroutine will copy bits 7,5, and 0 of R1 into R31, and will copy bits 6,3,
and 1 of R1 into R30, and will copy bits 4 and 2 of R1 into R29. The bits found in R1 must occupy the
same places in the destination register as they did in R1. A diagram of where each bit in R1 must go is
shown below:
R1[ R31 R30 R31 R29 R30 R29 R30 R31]
For example, suppose that R1 contains the value 11111111 and that R29, R30, and R31 all contain 0
when your function is called. When your function finishes, R31 will contain 10100001, R30 will
contain 01001010, and R29 will contain 00010100. As another example, suppose that R1 contains the
value 10011101 and that R29, R30, and R31 all contain 0 when your function is called. When your
function finishes R31 will contain the value 10000001, R30 will contain the value 00001000, and R29
will contain the value 00010100. Your subroutine must use only instructions that are contained in the
CS150 AVR instruction subset. The next page is blank if you need more space to work. (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!