Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please fill out the rest of the code. This is an assembly class from Electrical Engineering. Computer Science could help this problem as well. Thank

image text in transcribed

Please fill out the rest of the code. This is an assembly class from Electrical Engineering. Computer Science could help this problem as well.

Thank you

I have written much of the code, including calls to subroutines InitShield, WriteDisplay and BCD to 7SEG. You should be familiar with the first two from your Lab work. The BCD_to 7SEG subroutine takes as input a number between 0 and 9 in register r0 The subroutine then converts the decimal number into its corresponding 7 segments and displays answer As you write your program remember that . The least significant 4 switches are wired to PINC - The error LED is wired to PORTB bit O BCD to 7SEG'S calling argument is in register r0 . Do not modify r16 when you check to see if it is less than 10 INCLUDE RST VECT: jp reset 16410 ORG 0x0100 INCLUDE "spi_shield.inc Turn OFF LED wined o PORTBO reset: ldi out SPL,16 ldi r16,high (RAMEND) out r16, low (RAMEND) SPH, r16 Initialize Proto-shield call InitShield oop: r16, r16, 0x r16, 0x // Read Switches from GPIO Registers // clear most significant nibble // Is r16 less than 10? (see notes) /1 unsigned conditional branch // error-turn on the LED /I see the flowchart rjmp no error: /I not an error-turn off the LED display // send argument to subroutine // see notes) call BCD to 7SEG call WriteDisplay rjmp

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

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions

Question

4. Ignore small differences between scores.

Answered: 1 week ago