[Solved]Convert Code Assembly Include Void Delayms Unsigned Int Delay Define Timestart 7 Main Func Q37175911
[Convert code below to assembly]
#include <msp430.h>void delay_ms(unsigned int delay);#define TIME_START 7/*** The main function.* Notice that we don’t need a return value.* The function is thus of void type.*/void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR &= 0x00; // resetting the P1DIR registers P2DIR &= 0x00; // resetting the P2DIR registers P1DIR = 0xFF; // setting all the P1DIR registers to 1 (high) P2DIR = 0xFF; // setting all the P2DIR registers to 1 (high) P1OUT &= 0x00; // resetting the P1OUT registers P2OUT &= 0x00; // resetting the P2OUT registers P1OUT = BIT0; // setting the P1OUT registers to 0x0001 while (1337) { // infinite loop if (P1OUT == BIT7) { P1OUT = 0x00; P2OUT = BIT0; // setting the P2OUT registers to 0x0001 while (P2OUT != BIT5) { delay_ms(TIME_START); // delay P2OUT = P2OUT << 1; } delay_ms(TIME_START); // delay P2OUT = 0x00; P1OUT = BIT0; } P1OUT = P1OUT << 1; delay_ms(TIME_START); // delay }}/*** Takes a value in parameter in order to have a delay.* 16,000 is equal to 16,000,000 / 1,000.* -> 16,000,0000 = 16MHz (the CPU clock speed).*/void delay_ms(unsigned int delay){ while (delay–) { __delay_cycles(16000); }}
Expert Answer
Answer to [Convert code below to assembly] #include void delay_ms(unsigned int delay); #define TIME_START 7 /** * The main functio… . . .
OR

