Question: 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

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!