What will be the value in accumulator a after the following


Question 1. What is the value in Accumulator B after the execution of the code below?

                    ORG               $2000

XYZ              DC.B               0, 1, 2, 4

                    ORG               $8000

                    LDY               #XYZ

                    LDAA             #04

                    LDAB             #02

BACK            ADDB            0, Y

                    INY

                    DECA

                    BNE               BACK

HERE            BRA               HERE

 

A. $04

B. $09

C. $07

D. $1009

E. None of the above

 

Question 2. The instruction “subb $100” will

A. subtract the content of Accumulator B from $100.

B. subtract $100 from Accumulator B.

C. subtract the content of memory at Address $100 from Accumulator B.

D. subtract the content of Accumulator B from the content of memory at Address $100.

 

Question 3.What will be the value in Accumulator A after the following program is executed?

                ORG               $2000

                DATA1 DC.B               $F8

                ORG               $8000

                LDAA             DATA1

                LDAB             #4

               BACK LSLA

                DECB 

                BNE               BACK

                HERE BRA               HERE

A. $80

B. $08

C. 0

D. None of the above

 

Question 4.The MC9S12 instruction set has

A. only one multiply instruction: eight-bit signed.

B. both an eight-bit signed and eight-bit unsigned multiply instruction.

C. only one multiply instruction: eight-bit unsigned.

D. All of the above

E. None of the above

 

 

Question 5. In the following program, what is the largest number that Register B can take?

L1                 CLRA

                   NOP

                   NOP

                   DECB

                    BNE               L1

 

A. 255

B. 100

C. 0x200

D. 0x99

 

Question 6.For a 16-bit signed number, we can use a maximum of _____ bits for the magnitude of the signed number.

A. D7-D0

B. D14-D0

C. D16-D0

D. D15-D9

 

Question 7.Assume that PORTB has a value of 0x37. Which of the following gives us Unpacked BCD for 7?

A. PORTB= PORTB & 0x37;

B. PORTB= PORTB | 0x30;

C. PORTB= PORTB | 0x0F;

D. PORTB= PORTB & 0x0F;

 

Question 8. Fill in the blank to get 0x36 on PORTB. 

           unsigned char BCD_Byte = 0x67;

            unsigned char x;

            x= BCD_Byte & 0xF0;

             _____;

            PORTB = x | 0x30;

A. x=x>>4;

B. x=x>>2;

C. x=x<<4;

D. x=x<<2;

 

Question 9.The following program creates square wave pulses on PB0. What is the duty cycle?

  ORG $8000  

  LDS #$4000    

  LDAA #$FF  

  STAA DDRB  

BACK BSET PORTB,%00000001  

  JSR DELAY  

  JSR DELAY  

  JSR DELAY  

  BCLR PORTB,%00000001  

  JSR DELAY  

  BRA BACK  

 

A. 33%

B. 66%

C. 75%

D. 25%

 

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

            PORTB = 0xAA ^ 0x55;

A. PORTB = 0x05

B. PORTB = 0x0A

C. PORTB = 0x0F

D. PORTB = 0xFF

Solution Preview :

Prepared by a verified Expert
Operating System: What will be the value in accumulator a after the following
Reference No:- TGS01565212

Now Priced at $15 (50% Discount)

Recommended (90%)

Rated (4.3/5)