Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

intro to Microprocessor MSP 430 I have to convert my code from C to the assembly code, having trouble Below is my code in C.

intro to Microprocessor MSP 430

I have to convert my code from C to the assembly code, having trouble

Below is my code in C.

#include

/* * main.c */

#define Red_Led BIT0 #define Green_Led BIT6

int ones; int zeroes; int i; int a[10]= {1,1,1,1,0,1,1,0,0,1};

void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

P1DIR = Red_Led|Green_Led; P1OUT=0;

for(i =0;i<=10;i++) { if( a[i]== 0) zeroes = zeroes+1; else if(a[i]==1) ones = ones +1;

} if(zeroes >ones) P1OUT= Red_Led; else P1OUT = Green_Led;

}

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

More Books

Students also viewed these Databases questions

Question

The number of Estonian web sites exceeds 1 million.

Answered: 1 week ago