#include <msp430.h>
void main(void);
{
WDTCTL = WDTPW|WDTHOLD;
unsigned char a=0x14;
unsigned char b=0xDC;
unsigned char c,d,e,f;
c = a^b;
d = a|b;
e = ~d;
f = ~e;
while(1);
}
Step Into CCS IDE and provide screenshots!!!
I mainly just need help with #3
Answer:- 1) The declared data types are global here as they have been defined outside of the main scope.
Answer :- 2) The value in WDTCTL after bitwise
OR operation is-
WDTCTL = 0x5A | 0x80
=> WDTCTL = 0xDA
Answer :- 3) c = a+b = 0x6524. Here only 16-bit value is kept as variable size is of 16-bit due to int.
d = 0x89A8. Only 16-bit value.
e = 0x6524 - 0x89A8 = 0xDB7C.
Let's take starting memory is 0x1000. Then-
variable 'a' is at 0x100.
variable 'b' is at 0x1002.
variable 'c' is at 0x1004.
variable 'd' is at 0x1006.
variable 'e' is at 01008.
variable 'f' is at 0x100A to 0x100D. As float takes 4-bytes.
Get Answers For Free
Most questions answered within 1 hours.