0% found this document useful (0 votes)
24 views

Embedded Systems VTU Module 4 quiz questions

Embedded Systems VTU Module 4 quiz questions for IA

Uploaded by

Han Jisung
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Embedded Systems VTU Module 4 quiz questions

Embedded Systems VTU Module 4 quiz questions for IA

Uploaded by

Han Jisung
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

EmbeddedSystems

Introductionto

378
ObjectiveQuestions

understandable language? (c) High level


processor (b) Machine language
1. Which ofthe following is a language
(a) Assembly language
human readablenotation of? language (c) None of these
Assembly language is the (b) High level
Z. Machinelanguage
( piece ofassembly
code
the following
3. Consider
ORG 0000H
LJMP MAIN

Here 'ORG is a cor Opcode (d) Operand


(b) Label the
(a) Pseudo-op
assembly code to machine code is performed by (d) Locator
4. Translation of (c) Linker
fa) Assembler (b) Compiler
to
an embedded 'C' program development
5. A cross-compiler converts
corresponding to the processor of the PCused for application
(a) The machine code corresponding to a processor which is different from the processor of the PC. usede
The machine code
application development
the address of an integer variable say x which holds the value 10 Assime
6. ptr is an integer pointer holding as Ox 12ff7c. What willbe the output of the below piece of code? Assime
the address of the integer variable x 2*SI3e
the storage size of integer is 4 Add 2 to pt
ptrt=2;
1/Print the address holding by the pointer
printf (" 0x%x\n", ptr):
(a) Ox12ff7c (b) Ox12ff7e (0x1284 (d) None
say x which holds the value 10. Assume he
7. 'ptr is a char pointer holding the address of a char variable
address of the char variable x as 0x12ff7c. What will be the output of the below piece of code'?
1/Print the address holding by the pointer Ptettspost
printf (" 0x$x\n", ptrtt) ;
3 Ox12f7c (b) Ox12ff7d (c) Oxl2ff80 (d) None
Assumethe
8. ptr is a char pointer holding the address of a char variable say x which holds the value 10.
address of the char variable xas 0x 12f7c. What willbe the output of the below piece of code?
1/Print the address holding by the pointer p
printf ("0x%x\n", tptr);
(a) Ox12ff7c b Ox12ff7d (c) Ox12ff80 (d) None
9. ptrl' is a char pointer holding the address of the char 10. pr2'isa
variable sayx which holds the value addressof
char pointer holding the address of the char variable say y Assume the
which holds the value 20. piece
char variable x as Ox12ff7c and char variable y as Ox 12ff78. What will be the output ofthe following pie
of code?

1/Print the address holding by the


printf ("%%\n", (ptrl+ptr2) ) # pointer

Oxla|ic + Ox18f 78
Embedded Firmware Design and Development
379

(b) 4 (c) Compile error (cannot add two


a)30 pointers)
WOr25fef4
Ar/'isachar pointer holding the address of the char variable say x which holds the value 10. Assume the
prfchar variable x as Ox 12t7c. What will be the output of the following piece of code? Val ue
44*ptrl; Valus/0 e Ox0a Present
printf(x\n", *ptrl) :
(a)Oxla b Oxob
Pse bncs aOxba) +1=(OxO6) in
(c) Ox12ff7c (d) Ox12ff7d
Tis achar pointer holding the address of the char variable say x which holds the value 10. Assume the
address of char variable : x as Ox12ff7c. What will be the output of the following piece of code?

++*ptrl;
printf(x\n", ptrl);
(a) Ox0a (b) Ox0b (c) Ox12ff7c d Oxl12ff7d
orl isachar pointer holding the address of the char variable say x which holds the value 10. Assume the
adäress of char variable x as Ox12ff7c. What will be the output of the following piece of code?
*ptrl++;
printf ("%x\n", *ptrl) ;
(a) Ox0b (b) The contents of memory location Ox12ff7d (c) Ox12ff7c
(d) Ox12ff7d
I3 porl' is achar pointer holding the address of the char variable say xwhich holds the value 10. Assume the
address of char variable x as 0x12ff7c. What will be the output of the following piece of code?
*ptrl++;
printf("8x\n", ptrl) ;
(a) Ox0b (b) The contents of memory location Ox12ff7d .(c) Ox12ff7c
aOx12ff7d
k Which of the following is the string termination character?
(a) n' (b) it' (c) 10 (d) la'
5. What is the output of the following piece of code?
strlenl)= calculate s
char name [6] = {'H,E', 'L','L','0,\0}:
printf(W%d",strlen (name) )
chavactcKS u pe
la) 6 (b) 5
16, What is the output of the following piece of code?
(c) 7 mullcha/o
(d) None of theabove Not Mu llch

Char strl/] "Hello "


Char str2 (] = "World!";
Fox Goncat enatien yc se
str1+= str2; Sbestl )
printf("%s\n",str1) ;
(a) Hello (b) Hello World! (cY Compile eror (d) World!
17. Whattis the of the following piece of code?
output
char strl ]= "Hello world!"i
char str2 [ ] = "Hello World!"
int n
Systems
Introduction to Embedded
382
26. The C' pre-processor directive instruction always ends with a semicolon (:). State True' or 'False'

(a) True by False


the file inclusion pre-processor directive?
27. Which of the following is (c) #ifdef (d) None of these
28. (a)Which b #include
of the following pre-processor directive is used for indicating the end of ablock folllowing #ifdef ox
#define

#else? LC) #endif (d) #ifndef


(a) #define (b) #undef
following preprocessor directive is used for coding macros?
29. Which of the (c) #undef (d) #endif
(a) #ifdef \b) #define
following piece of code?
30. What willbe the output of the
#define A 2+8 2+8/2 +3
#define B 2+3
void main (void)
2+4t3 =613
unsigned char result ;
result = A/B
printf ("%d", result)

(d) 8
(a) 0 (b) 2
31. The instruction
const unsigned char* x;

represents:
(a) Pointer to constant data fb) Constant pointer to data
(c) Constant pointer to constant data (d) None of these
32. The instruction
unsigned char* const x;

represents:
(a Pointer to constant data (b) Constant pointer to data
(c) Constant pointer to constant data (d) None of these
33. The instruction

const unsigned char* const x;


represents:
(a) Pointer to constant data (b) Constant pointer to data
(or Constant pointer to constant data (d) None of these
34. The instruction

volatile unsigned char* x;


represents:
Yay Volatile pointer to data (b) Pointer to volatile data
(c) Volatile pointer to constant data (d) None of these
Embedded Firmware Design and Development 383

35. The instruction


volatile const unsigned chart x;
represents:
(a) Volatile pointer to data b) Pointer to volatile dat
(c) Pointer to constant volatile data (d) None of these
K The constant volatile variable in Embedded application represents a
(a) Write only memory location/register (b) Read only memory location/register
(c) Read/Write memory location/register
37. What will be the output of the following piece of code? Assume the data bus width of the controller on which
the program is executed as 8 bits.
void main (void)

unsigned char flag = 0x00;


flag |= (1<<7)
printf ("%d", flag) ;

(a) Ox00 (b) Ox70 c) OxX 80 (d) OxFF


38. The variable 'x' declared with the following code statement
const int x = 5;

will bestored in which section of the memory allocated to the program?


Nar Constant Data Memory (b) Heap Memory (c) Alterable Data Memory
(d) Stack Memory (e) Register
39, What willbe the memory allocated on successful execution of the following memory allocation request?
Assume the size of int as 2 bytes
X=(int *) malloc (100) Size=
(a) 2 Bytes bY 100 Bytes (c) 200 Bytes (d) 4 Bytes
40. Which of the following memory management routine is used for changing the size of allocated hvtes in o
dynamically allocated memory block (c) calloc() (d) free()
(a) malloc() (bY realloc()

You might also like