#include /* common defines and macros */ #include /* derivative information */ #pragma LINK_INFO DERIVATIVE "mc9s12c128" void setBit(unsigned char *data, unsigned char location); void clearBit(unsigned char *data, unsigned char location); unsigned int countBits(unsigned char *data); #define DATA_LEN 5 void main(void) { //TODO: Modify the value using the appropriate //value for your lab group from the list below. //Section: M T W R F //grp1: AntS IntO QuiP BeaR KelP //grp2: BeaR JolT RacK ChaT LopE //grp3: ChaT KelP SifT DraG MakE //grp4: DraG LopE TilE EchO NovA //grp5: EchO MakE UndO FliP OpaL //grp6: FliP NovA VinE GriM PacT //grp7: GriM OpaL WorE HolD QuiD //grp8: HolD PacT YacK ItcH RacK //grp9: ItcH QuiD ZarF JolT SifT unsigned char data[DATA_LEN] = "DemO"; //use volatile to ensure that the compiler creates memory for count volatile unsigned int count; EnableInterrupts; count = countBits(data); //TODO: //use the setBit and clearBit functions to //INVERT the case of the string //e.g. uppercase to lowercase and lowercase to uppercase for(;;) {} /* wait forever */ /* please make sure that you never leave this function */ } /* setBit sets the bit at the specified location in data. Bits are numbered byte-by-byte, starting with 0 at the LSB of the first byte of the data range. */ void setBit(unsigned char *data, unsigned char location) { //TODO: //Impement setBit } /* clearBit clears the bit at the specified location in data. Bits are numbered byte-by-byte, starting with 0 at the LSB of the first byte of the data range. */ void clearBit(unsigned char *data, unsigned char location) { //TODO: //Impement clearBit } /* countBits counts the number of bits which are set (i.e. 1) in the data. It stops counting when a null-byte is encountered. */ unsigned int countBits(unsigned char *data) { //TODO: //Implement countBits }