Find the value for portb after the execution of the


Question 1. Which of the following data types should be used for an address of port in HCS12?

  • int
  • unsigned int
  • char
  • unsigned char

Question 2. Find the value for PORTB after the execution of the following code:

  • PORTB = 0x55 & 0xAA;
  • PORTB = 0x05
  • PORTB = 0xA0
  • PORTB = 0xFF
  • PORTB = 0x00

Question 3. Find the value for PORTB after the execution of the following code:

  • PORTB = 0x27 | 0xF0;
  • PORTB = 0x02
  • PORTB = 0x07
  • PORTB = 0xF7
  • PORTB = 0x00

Question 4. Find the value for PORTB after the execution of the following code:

  • PORTB = 0xFF ^ 0x00;
  • PORTB = 0x0F
  • PORTB = 0xF0
  • PORTB = 0xFF
  • PORTB = 0x00

Question 5. Assume PORTB has a value of 0xAA. Find the value for PORTB after execution of the following code:

  • PORTB = ~PORTB;
  • PORTB = 0x55
  • PORTB = 0x0A
  • PORTB = 0xAA
  • PORTB = 0x0

Solution Preview :

Prepared by a verified Expert
Civil Engineering: Find the value for portb after the execution of the
Reference No:- TGS01154328

Now Priced at $10 (50% Discount)

Recommended (96%)

Rated (4.8/5)