Question: 8 . ( 5 0 pts ) . Build an assembly language subroutine named IsEightTendie that will determine if the value in R 8 is
pts Build an assembly language subroutine named IsEightTendie that will determine if the
value in R is evenly divisible by If the value in R is evenly divisible by your subroutine should
place the value xFF on the stack, and if the value in R is not evenly divisible by your subroutine
should place the value x on the stack. Your subroutine must be placed at address x in program
memory and must use only instructions that are contained in the CS AVR instruction subset. You
can use any registers that you want, but the value of all registers must be preserved for the caller. The
following code shows how your subroutine will be used:
call IsEightTendie ; check to see if R has what were after
pop R ; put result into R
Note: Only these 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
