Viva Questions and Answers
Viva Questions and Answers
Loads the effective address of the source operand into the destination register.
6. What are the different types of system calls in Linux and how are they invoked in assembly?
Common calls: read/write/open/exit; invoked via INT 0x80 (32-bit) or SYSCALL (64-bit).
10. What is the purpose of the MOV instruction in 80386 microprocessor architecture?
Transfers data between registers, memory locations, or between register and memory.
11. What is the size of the stack in the 80386 processor and how is it managed?
Defined by SS:ESP/EBP; managed via PUSH/POP and manual ESP updates.
12. What are the possible values of the carry flag and how does it affect arithmetic operations?
CF=0 or 1; indicates unsigned overflow or borrow in arithmetic instructions.
14. Explain the purpose of the MUL and IMUL instructions in assembly.
MUL performs unsigned multiply; IMUL performs signed multiply.
15. What is the difference between PUSH and POP instructions in terms of stack operations?
PUSH decrements SP and stores value; POP loads value from stack then increments SP.
18. Explain the role of the CS, DS, SS, and ES registers in x86 architecture.
CS: code segment; DS: data segment; SS: stack segment; ES: extra segment for string ops.
25. Explain the ADD instruction and its effect on the EFLAGS register.
Adds source to destination; updates CF, OF, SF, ZF, AF, PF.
26. How does a NOP (No Operation) instruction work and when is it useful?
Does nothing; used for alignment or timing adjustments.
28. What is the difference between XOR and AND operations in assembly?
XOR toggles bits where bits differ; AND clears bits where either bit is 0.
29. What is the difference between 32-bit and 64-bit registers in x86 architecture?
64-bit registers (RAX, etc.) are wider and include more operand bits than 32-bit (EAX).
30. What is the importance of the IDT (Interrupt Descriptor Table) in the 80386 processor?
Holds pointers to interrupt/service routines and their attributes.
31. What are the major differences between protected mode and real mode in the 80386 microprocessor?
Protected supports segmentation/paging and privilege levels; real is 16-bit flat with <1MB memory.
32. What are segmentation and paging in the context of memory management in the 80386?
Segmentation divides memory into logical segments; paging divides into fixed-size pages.
33. Explain how the processor switches between different privilege levels.
Via call gates, interrupts/traps changing CPL based on descriptor privilege level.
34. What is a privilege level and how does it affect system execution?
Ring 0-3; controls access rights to instructions and memory regions.
35. What is the role of the GDT (Global Descriptor Table) and LDT (Local Descriptor Table) in memory management?
Define segment descriptors for code/data for all tasks (GDT) and per-task (LDT).
37. Explain how paging and segmentation work together in 80386 architecture.
Logical address segmented then page translated for physical address.
39. How does the processor handle overflow and underflow conditions?
Sets OF for signed overflow, CF for unsigned overflow/underflow.
40. What is the difference between word, double word, and quad word in terms of their size and usage?
Word=16 bits, Dword=32 bits, Qword=64 bits; used for data size definitions.
41. How is an interrupt handled by the processor?
Push flags, CS, EIP; load handler address from IDT; execute ISR; IRET restores state.
44. What are syscalls and how are they different from regular function calls in assembly language?
Syscalls trap to kernel via special instruction; function calls stay in user mode.
46. What is the importance of the TLB (Translation Lookaside Buffer) in memory management?
Caches recent page table entries for fast address translation.
47. What is the difference between MOV and LEA instructions in terms of functionality?
MOV transfers data; LEA computes addresses without memory access.
49. How does MOV work in terms of copying values between registers and memory locations?
Reads source operand and writes its value to destination register or memory.
50. Explain the difference between signed and unsigned integer operations in assembly.
Signed operations use OF flag and two's complement interpretation; unsigned use CF.