Question 1:
The rectangle in the circuit diagram below is a memory device with eight-bit data I/O. What is the memory size?
1K bytes
2K bytes
4K bytes
16K bytes

Question 2: Main memory in virtually all computers contains how many data bits at each address? (Points : 8) 16 (two bytes, or one word, per address) Eight (one byte per address) One bit per address Any of the above, it depends on the CPU None of the above

Question 3. (TCO 1) With a 16-bit address bus, we get _ bytes of memory space. (Points : 8)
16K
32K
64K
64M

Question 4: The circuit that performs the instruction “ADDA” in the HCS12 CPU is (Points : 8)

Question 5: Operations performed by the ALU include
coordinating data transfer to and from the ALU.
addition and subtraction.
decoding instructions.
All of the above
None of the above

Question 6: Which one is unidirectional?
Data bus
Address bus
Control bus
Both B and C

Question 7:
For the CodeWarrior assembler,
a) label must start on first column; instruction and directive must not start on first column.
b) label must not start on first column; instruction and directive must start on first column.
c) label must start on first column; instruction and directive must start on first column.
d) label must not start on first column; instruction and directive must not start on first column.

Question 8:
The “LDAB #$AA” is ________ byte instructions
One
Two
Three
four

Question 9:
which statement about code warrior assembly language is true?
It is case sensitive
Instructions must start in column 1
Labels must start in column 1 unless followed by a colon
All of the above
None of the above

Question 10: Which of the following is wrong?
LDAA #55
LDAA #256
LDAA #20
LDAA # 00

Question 11:
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 (Points : 8)
$04
$09
$07
$1009
None of the above

Question 12:
After executing the instruction “suba #33”, which of the following registers will not change?

PC

D

CCR

SP

Question 13:
What will be the value in Accumulator A after the following program is executed?

            ORG               $2000

DATA1 DC.B $11
ORG $8000
LDAA DATA1
LDAB #4
BACK LSLA
DECB
BNE BACK
HERE BRA HERE

$0E
$10
0
1

Question 14:
In HCS12, when two eight-bit numbers are multiplied, the result is
32 bits
eight bits
16 bits
all of the above
None of the above

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

L1 CLRA
NOP
NOP
DECB
BNE L1 (Points : 8)

255

100

0x200

0x99

Question 16:
(TCO 7) Which statement makes the upper two bits of Port B outputs and the lower six inputs?
a) DDRB = 0x3F;
b) DDRB = 0xC0;
c) PORTB = 0x20;
d) All of the above
e) None of the above

Question 17:
Assume that PORTB has a value of 0x05. Which of the following gives us ASCII digit for 5?

Student Answer: PORTB= PORTB & 0x35;

           PORTB= PORTB | 0x30;

           PORTB= PORTB | 0x03;

           PORTB= PORTB & 0x30;

Question 18:
The highest single digit in BCD is __
0x09
0x0F
0x0A
10

Question 19:
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

Question 20:
Find the value for PORTB after the execution of the following code:
PORTB = 0xFF ^ 0x00;
Student Answer: PORTB = 0x0F

           PORTB = 0XF0

           PORTB = 0xFF

           PORTB = 0x00

Question 21:
Write a program sequence that places the value in Address $1500 into Accumulator A. Then, AND this value with the value in Address $1501. Save the result in $1502.

Question 22:
What is the last instruction in a subroutine? What is the purpose of this instruction?

Question 23:
Write a C statement to clear Bit 5 of variable bar without changing other bits.

Question 24:
Write a HCS12 assembly-language program that counts all even numbers from a 10-variable, byte-sized array and moves the odd numbers to a new array.

Question 25:
Write a C program for a HCS12 microcontroller that writes the value, 0x78, to Memory Location VAR1 and then calls a delay function. The delay function should generate a delay of 0.25 milliseconds. Then, send the pattern 0x99 to Memory Location VAR2 and call the delay function one more time. Repeat this operation eight times using a for loop. Assume that the bus clock frequency is 24MHz. Write the delay using inline assembly language.

To get the answer for the above tutorial, please click on the link below:

Leave a Comment