0% found this document useful (0 votes)
18 views3 pages

Viva Questions and Answers

The document provides a comprehensive overview of various assembly language instructions and concepts, including the functions of LEA, MOV, PUSH, and CALL instructions, as well as the significance of registers like EAX and AX. It explains memory management techniques such as segmentation and paging, along with the handling of interrupts and system calls in the 80386 microprocessor. Additionally, it discusses arithmetic operations, data alignment, and the differences between signed and unsigned numbers.
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)
18 views3 pages

Viva Questions and Answers

The document provides a comprehensive overview of various assembly language instructions and concepts, including the functions of LEA, MOV, PUSH, and CALL instructions, as well as the significance of registers like EAX and AX. It explains memory management techniques such as segmentation and paging, along with the handling of interrupts and system calls in the 80386 microprocessor. Additionally, it discusses arithmetic operations, data alignment, and the differences between signed and unsigned numbers.
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/ 3

1. What is the function of the LEA instruction in assembly?

Loads the effective address of the source operand into the destination register.

2. Explain the difference between MOV and PUSH instructions.


MOV copies data between registers/memory; PUSH places data onto the stack (decrements SP and stores value).

3. What is the significance of the REP prefix in assembly instructions?


Repeats the following string instruction ECX times.

4. How does the processor handle data alignment in memory?


Accesses aligned addresses faster; misaligned accesses may cause additional cycles or faults.

5. Explain the concept of signed and unsigned numbers in assembly.


Signed uses two's complement with MSB as sign; unsigned interprets all bits as magnitude.

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).

7. What is the significance of the EAX register in the x86 architecture?


Accumulator register used for arithmetic and as return value for functions/system calls.

8. How does the CALL instruction differ from a JMP instruction?


CALL pushes return address on stack then jumps; JMP simply jumps without return info.

9. Explain the XOR operation in assembly language. What is it used for?


Performs bitwise exclusive OR; often used to zero a register by XOR with itself.

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.

13. What are conditional jumps in assembly? Give examples.


Jumps based on flags: JZ/JE (zero), JNZ/JNE (not zero), JC (carry), JNC (not carry), JO (overflow), JNO.

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.

16. What is the purpose of the IN and OUT instructions in assembly?


Perform I/O operations: IN reads from port into AL/AX/EAX; OUT writes AL/AX/EAX to port.

17. How does the JZ (Jump if Zero) instruction work?


Jumps to target if ZF (zero flag) is set.

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.

19. What is a memory-mapped I/O and how is it accessed in assembly language?


I/O devices mapped into memory space; accessed via MOV to/from specific addresses.

20. What are the different stages of instruction execution in a microprocessor?


Fetch, Decode, Execute, Memory access, Write-back.
21. What is the function of the SBB (Subtract with Borrow) instruction?
Subtracts source and CF from destination (dest - src - CF).

22. Describe how the MOVSX and MOVZX instructions work.


MOVSX sign-extends source to destination; MOVZX zero-extends source.

23. What is the use of the CLD and STD instructions?


CLD clears Direction Flag (forward string ops); STD sets DF (reverse string ops).

24. How does the SHL (Shift Left) instruction work?


Shifts bits left, inserting zeros on right; multiplies unsigned values by 2.

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.

27. Explain how the CMP instruction works in assembly language.


Subtracts source from destination setting flags without storing result.

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).

36. How does the 80386 processor handle virtual memory?


Uses paging with page tables to map virtual to physical addresses.

37. Explain how paging and segmentation work together in 80386 architecture.
Logical address segmented then page translated for physical address.

38. What is the purpose of the MOV instruction in a data segment?


Transfers data values into data segment memory or registers.

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.

42. Explain the concept of memory protection in the 80386 processor.


Uses segment limits/privilege levels and page protection bits to guard memory.

43. What is the role of the TS (Task State Segment) in 80386?


Holds CPU state for hardware task switching.

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.

45. What is the structure of a segment descriptor in the 80386 processor?


Contains base address, limit, type, DPL, present bit, and flags.

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.

48. How is the AX register used in performing 16-bit multiplication in x86?


MUL multiplies AL or AX with operand, result in AX or DX:AX.

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.

You might also like