0% found this document useful (0 votes)
24 views4 pages

Quiz For 8051

The document contains a quiz with 22 multiple choice questions about microcontrollers and embedded systems. The questions cover topics like ports, registers, instructions, memory addressing and delays. The questions have a, b, c or d as possible answers.

Uploaded by

jumanawanass17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views4 pages

Quiz For 8051

The document contains a quiz with 22 multiple choice questions about microcontrollers and embedded systems. The questions cover topics like ports, registers, instructions, memory addressing and delays. The questions have a, b, c or d as possible answers.

Uploaded by

jumanawanass17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Quiz 1

1) Which port is used as input/output ONLY?


a) P0
b) P1
c) P2
d) P3

2) Which device is not an embedded system?


a) Mobile
b) Laptop
c) Video games
d) Wireless mouse

3) The specifications of the 8051 include


a) 4KB RAM
b) 128 B ROM
c) 2 timers
d) 2 serial ports

4) Upon reset, the default values of microcontroller registers are:


a) PC = 0000H
b) SP = 0007H
c) RS1 = 0; RS0 = 0
d) The ports are configured as output.

5) If SP = 30H, the instruction "PUSH 10H" means…


a) The content of memory location whose address is 10H is pushed into
memory location whose address is 30H.
b) The content of memory location whose address is 10H is pushed into in
memory location whose address in 31H.
c) The content of memory location whose address is 10H is pushed in
memory location whose address in 0FH.
d) Invalid instruction.

6) Which instruction is equivalent to the code


SETB PSW.3
CLR PSW.4
MOV A, R0
a) MOV A, #8
b) MOV A, 8
c) MOV A, 10H
d) MOV A, #10H
7) Which code is used to monitor P0.5 until it becomes low? Note that once
this pin becomes low, the code sends a pulse to P2.5.
a) HERE: JB P0.5, HERE
b) HERE: JNB P0.5, HERE
c) HERE: JBC P0.5, HERE
d) None of the above.

8) Which port should be connected to pull-up resistor?


a) P0
b) P1
c) P2
d) P3

9) Which instruction is illegal?


a) MOV P1, P2
b) MOV P2.6, C
c) ADD P1, A
d) MOV P1.0, P2.3

10) What are the contents of the flags after executing MOV A, #78H
ADD A, #6AH
a) CY = 0; AC = 1; P = 1; OV = 1
b) CY = 1; AC = 0; P = 1; OV = 1
c) CY = 0; AC = 1; P = 0; OV = 0
d) None of the above (CY = 0; AC = 1; P = 0; OV = 1)

11) The list file can be used to…


a) Compute the number of memory locations used to store the program.
b) Compute the power consumption when the program is running.
c) Debug the program and finding errors.
d) All the above.

12) The linker program takes one or more … files and produces an ……. file.
a) List; Object.
b) Object; List
c) List; Absolute object
d) Object; Absolute object

13) The program burned to ROM should be ….


a) .asm
b) .lst
c) .obj
d) .hex
14) Each program should be started by …….. and ended by……
a) org 0000H; end
b) org 0100H; end
c) DB 100; end
d) MOV P1, A; end

15) After executing the following code, the data is stored in…. org 50H
DATA1: DB 10H
a) RAM at address 50H
b) RAM at address 10H
c) ROM at address 50H
d) ROM at address 10H

16) How many bytes are used to store the following data
DATA2: DB "IT IS NO#3."
a) 9
b) 10
c) 11
d) None of the above.

17) If "COUNT EQU 25", which instruction is illegal?


a) MOV A, COUNT
b) MOV A, #COUNT
c) MOV COUNT, #COUNT
d) None of the above.

18) Consider a TTL wave with a duty cycle 80%, its average volt is…..
a) 1V
b) 2.5V
c) 4V
d) None of the above.

19) Consider the subroutines QDELAY_250ms and QDELAY_750ms


make a delay of 250ms and 750ms, respectively. What is the duty cycle of
the following code? HERE: SETB P2.0
ACALL QDELAY_250ms
CLR P2.0
ACALL QDELAY_750ms
SJMP HERE
a) 25%
b) 50%
c) 75%
d) None of the above.
20) Which instruction is used to configure P2.6 as input?
a) SETB P2.6
b) CLR P2.6
c) CPL P2.6
d) None of the above.

21) Which code is used to configure P2 as input?


a) CLR P2
b) SETB P2
c) MOV P2, FFH
d) MOV P2, #0FFH

22) Assume that the subroutines QDELAY_250ms make a delay of 250ms,


and P1.2 is configured as input and connected to a switch (SW). What is the
output of the following code?
AGAIN: JB P1.2, OVER
MOV P2, # 'N'
ACALL QDELAY_250ms
MOV P2, # 'Y'
SJMP AGAIN
OVER: MOV P2, # '0'
SJMP AGAIN
a) If SW=0, send letter ‘N’ to P2
If SW=1, send letter ‘Y’ to P2
b) If SW=1, send letter ‘N’ to P2
If SW=0, send letter ‘Y’ to P2
c) If SW=0, send letter ‘N’ for 250ms, then display 'Y' for 250ms to P2
If SW=1, send letter '0' to P2
d) If SW=0, send letter ‘N’ for 250ms, then display 'Y' to P2
If SW=1, send letter '0' to P2

You might also like