Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

8 . ( 5 0 pts ) . Build an assembly language subroutine named IsEightTendie that will determine if the value in R 8 is

8.(50 pts). Build an assembly language subroutine named IsEightTendie that will determine if the
value in R8 is evenly divisible by 8. If the value in R8 is evenly divisible by 8, your subroutine should
place the value 0xFF on the stack, and if the value in R8 is not evenly divisible by 8, your subroutine
should place the value 0x00 on the stack. Your subroutine must be placed at address 0x26 in program
memory and must use only instructions that are contained in the CS150 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 R8 has what were after
pop R1 ; put result into R1
..(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

Students also viewed these Databases questions