Microprocessor Oral question bank:
1. What is Assembly Language?
      Ans:- An assembly language is a type of programming language that translates high-
      level languages into machine language. It is a necessary bridge between software
      programs and their underlying hardware platforms
  2. What is Assembler?
      Ans:- An assembler is a type of computer program that takes in basic instructions and
      converts them into a pattern of bits that the computer's processor can use to perform
      basic operations. The assembler's job is to convert assembler or assembly language code
      into machine code that the computer can then read and execute
  3. What is Linker?
      Ans:- takes the object code generated by the compiler/assembler and combines it with
      other necessary libraries and modules to create an executable file.
  4. What are the different commands for 32 bit and 64-bit execution?
  Ans:- for 32-bit
  nasm -f elf32 <filename>.asm
  ld -m elf_i386 -o <filename> <filename>.o
  ./filename
  for 64 bit
    nasm -f elf64 <filename>.asm
   ld -o <filename> <filename>.o
./filename
  5. What are different addressing modes? Explain in detail?
  6. What are the different assemblers? Explain its uses?
      Ans:- TASM, MASM, and NASM are x86 assemblers. Borland Turbo Assembler
      (TASM) and Microsoft Macro Assembler (MASM) are DOS/Windows-based, Netwide
      Assembler (NASM) is available for other platforms as well. TASM produces 16-bit/32-
      bit output, MASM and NASM also produce 64-bit output.
      7. What is the use of .data section?
  Ans: The data section is used for declaring initialized data or constants. This data doesnot
      change at runtime. You can declare various constant values, file names, or buffersize,
      etc., in this section.
  The syntax for declaring data section is −
      section.data
     msg1 db ‘hello world’
8. What is the use of .bss section?
The bss section is used for declaring variables. The syntax for declaring bss sectionis −
section.bss
     num1 resb 2
   9. What is the use of .textsection?
   The text section is used for keeping the actual code. This section must begin withthe
   declaration global _start, which tells the kernel where the program executionbegins.
   The syntax for declaring text section is −
   section.text
   global _start
   _start:
   10. How we give comment in assembly language
   Assembly language comment begins with a semicolon (;). It may contain anyprintable
   character including blank. It can appear on a line by itself, like –
   ; This program displays a message on screen
   11. What are the different types of assembly language statements
  Ans:-
1. Executable instructions or instructions
The executable instructions or simply instructions tell the processor what to do. Each
instruction consists of an operation code (opcode). Each executable instruction generates one
machine language instruction.
2. Assembler directives or pseudo-ops
The assembler directives or pseudo-ops tell the assembler about the various aspects of the
assembly process. These are non-executable and do not generate machine language
instructions
 e.g. DB,DW,DQ,EQU,END,ENDP,ENDS,EQU
3. Macros
When we need to use group of instructions several times throughout programs macro is used.
A macro is a sequence of instructions, assigned by a name and could be used anywhere in the
program.
In NASM, macros are defined with %macro and %endmacro directives.
Syntax:-
%macro macro_name number_of_params
<macro body>
%endmacro
e.g
%macro write 2
      mov   rax, 1
      mov   rdi, 1
      mov    rsi,%1
      mov   rdx, %2
      syscall
   %endmacro
How to call macro
Write msg,len
How to calculate the message length of any
message?
12. system calls for 32 bit and 64 bit ALP
System calls are APIs for the interface between the user space and the kernel space
32 bit System calls
1. Write
mov        edx,4            ; message length
mov        ecx,msg                ; message to write
mov        ebx,1            ; file descriptor (stdout)
mov        eax,4            ; system call number (sys_write)
int        0x80             ; call kernel
2. Read
mov eax,03 ;read system call
mov ebx,01
mov ecx,esi
mov edx,09
int 80H
3. Exit
mov eax,01 ;exit system call
mov ebx,00
int 80H
64 bit System Call
1. Write
mov rax, 1
   mov rdi, 1
   mov rsi,msg
   mov rdx, len
   syscall
2. Read
mov rax, 0
   mov rdi, 0
   mov rsi,num
   mov rdx, l
   syscall
3. Exit
mov rax,60
mov rdi,0
syscall
13. Why we use Read procedure in ALP?
Ans:- Convert ASCII to Hex
mov rcx,02
 mov rsi,num
 up1:
 rol bl,04
 mov al,[rsi]
 cmp al,39h
 jbe p1
 sub al,07h
 jmp p2
 p1: sub al,30h
 p2: add bl,al
 inc rsi
 loop up1
ret
   23. Why we use Display procedure in ALP?
   Ans:- Convert HEX to ASCII
   mov rcx,4
   mov rdi,result
   dup1:
   rol bx,4
mov al,bl
and al,0fh
cmp al,09h
jbe p3
add al,07h
jmp p4
p3: add al,30h
p4:mov [rdi],al
inc rdi
loop dup1
24. What are the sizes of following registers?
          GDTR, TR, LDTR, IDTR
25. What do you mean by MSW?
26. How to decide your system is in which mode and which bits decides it?
27.What is the use of AF where it is present, which register contains it andbit number?
28.What is the use of PF where it is present, which register contains it and bitnumber?
29.What are the different Linux system calls used for 32-bit and 64-bitexecution
   and how to define it?
30. What is the use of index register.
  31. How to calculate that number is positive or negative?
   32 How to calculate the factorial?
33 What do you mean by recursion?
34. What is the difference in between esi and [esi]?
35. What is Segmentation and Paging?
36. What are the features of 80386 DX microprocessor?
37. Difference between microprocessor and microcontroller?
38. What is the use of PG bit and which register contain this bit? What is theuse of it?
39. What is the use of PE bit and which register contain this bit? What is theuse of it?
40. What is an instruction queue? Explain?
41. What is REP prefix? How it functions for string instructions?
42. Explain the instructions (i) LDS (ii) PUSHF (iii) BT (iv) CLD
43. What is stack? Explain the use and operation of stack and stack pointer
    44. What are the various interrupts in 8086? Explain.
  45. Which interrupts are generally used for critical events?
  46. Explain different types of registers in 80386 microprocessor architecture.
  47. When you are using DIV command which registers holds the value automatically in
  32-bit and 64-bit register set and what are those values?
  48. When you are using MUL command which registers holds the value automatically
  in 32-bit and 64-bit register set and what are those values?
  49. What is the difference in between 80386DX and 80386SX?
  50. What is the use of direction flag?
NOTE:- Prepare for instructions and questions given after each assignments.