Ch 16: Interfacing Assembly with C/C++

69 Questions69 MCQs0 Short Questions0 Long Questions
๐ŸŽฏ Exam Practice Papers
SEMESTER PASS

CS401 - Computer Architecture and Assembly Language Programming Examination Practice

Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.

๐Ÿ“˜ VU MID TERM EXAMLectures 1 to 22
โฑ๏ธ 60 Mins

Mid Term Examination

Covers syllabus of Lectures 1 to 22 with 30 high-yield MCQs in a timed exam environment.

๐Ÿ“30 MCQs
โฑ๏ธ60 Minutes
๐Ÿ“— VU FINAL TERM EXAMLectures 23 to 45
โฑ๏ธ 90 Mins

Final Term Examination

Comprehensive semester exam preparation with 45 MCQs covering Lectures 23 to 45 with complete course coverage.

๐Ÿ“45 MCQs
โฑ๏ธ90 Minutes
Showing 11 โ€“ 20 of 69 Questions
Page 2 of 7
Q11
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Protected Mode Architecture (Protected Mode Definition)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Define Protected Mode in x86 processor architecture.
Q12
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Protected Mode Architecture (32-Bit Address Space Capacity 4 GB)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
A processor with a 32-bit memory address register can directly access up to how much physical RAM address space?
  1. A.1 GB
  2. B.6 GB
  3. C.4 GB
  4. D.2 GB
Q13
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Protected Mode Architecture (Segment Selector Definition)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
When an x86 processor operates in protected mode, the 16-bit value loaded into a segment register is called a __________.
๐Ÿ’ป assembly Snippet
mov ax, 0x0010 ; 16-bit Segment Selector
mov ds, ax     ; Loads selector into DS segment register
  1. A.segment descriptor
  2. B.segment selector
  3. C.global descriptor table
  4. D.protected register
Q14
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Protected Mode Architecture (IDT Interrupt Descriptor Table)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In x86 protected mode, what does the acronym IDT stand for?
  1. A.interrupt descriptor table
  2. B.individual descriptor table
  3. C.inline data table
  4. D.interrupt data table
Q15
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Comparative Architecture (Motorola 68K 16 General Purpose 32-Bit Registers)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The Motorola 68000 (68K) processor architecture features how many 32-bit general-purpose registers in total (comprising 8 data registers D0โ€“D7 and 8 address registers A0โ€“A7)?
  1. A.4
  2. B.8
  3. C.16
  4. D.32
Q16
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Comparative Architecture (Motorola 68K 32-Bit Program Counter)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In Motorola 68K processors, the Program Counter (PC) register that holds the address of the currently executing/next instruction has a width of __________.
  1. A.8bit
  2. B.16bit
  3. C.32bit
  4. D.64bit
Q17
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Comparative Architecture (Motorola 68K General-Purpose Registers)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Motorola 68K processors feature how many total 32-bit general-purpose registers (combining 8 data registers D0-D7 and 8 address registers A0-A7)?
  1. A.4
  2. B.8
  3. C.16
  4. D.32
Q18
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ 16.1. Comparative Architecture (Motorola 68K Program Counter Register)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In Motorola 68K processors, there is a 32-bit __________ register that holds the physical memory address of the currently executing instruction.
  1. A.Program counter
  2. B.Stack pointer
  3. C.Register
  4. D.Stack
Q19
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ Function Calling ConventionsEasyโญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
How many standard function calling conventions are commonly used in high-level programming languages? State their names.
Q20
๐Ÿง  Long Problem๐Ÿ“˜ CS401๐Ÿ“‘ Lec 16๐Ÿท๏ธ Interfacing Assembly with High Level LanguagesHardโญ๐Ÿ’ก๐ŸŒŸ๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Translate the following 32-bit x86 assembly routine into an equivalent C language function: ```assembly global swap swap: mov ecx, [esp+4] ; copy parameter p1 to ecx mov edx, [esp+8] ; copy parameter p2 to edx mov eax, [ecx] ; copy *p1 to eax xchg eax, [edx] ; exchange eax with *p2 mov [ecx], eax ; copy eax to *p1 ret ; return ```
๐Ÿ’ป assembly Snippet
swap:
mov ecx, [esp+4]
mov edx, [esp+8]
mov eax, [ecx]
xchg eax, [edx]
mov [ecx], eax
ret