Ch 14: Preemptive Multitasking & Context Switching

90 Questions90 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 1 โ€“ 10 of 90 Questions
Page 1 of 9
Q1
๐Ÿ“ Short Q๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. MultitaskingEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
What is multitasking in operating systems and computer architecture?
Q2
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.2. MultithreadingEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In multi-threading operating systems, each thread independently executes function calls, accepts parameters, and maintains its own ________ variables.
  1. A.global
  2. B.local
  3. C.legal
  4. D.illegal
Q3
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.2. MultithreadingEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
The thread registration code initializes the Process Control Block (PCB) and adds it to the linked list so that the ________ will give it a turn to execute.
๐Ÿ’ป assembly Snippet
call init_pcb
  1. A.scheduler
  2. B.dispatcher
  3. C.interrupt handler
  4. D.assembler
Q4
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. Modular Programming and LinkageEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In NASM assembly, an imported symbol (defined in another module) is declared using the ________ directive, while an exported symbol (made accessible to other modules) is declared using the ________ directive.
๐Ÿ’ป assembly Snippet
EXTERN printf
GLOBAL _main
  1. A.EXTERN, GLOBAL
  2. B.GLOBAL, EXTERN
  3. C.IMPORT, EXPORT
  4. D.PUBLIC, EXTERN
Q5
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. Modular Programming and LinkageEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In NASM assembly, an imported symbol is declared with the ________, while an exported symbol is declared with the ________.
๐Ÿ’ป assembly Snippet
EXTERN external_func
GLOBAL main
  1. A.External directive, Global directive
  2. B.Global directive, External directive
  3. C.Home Directive, Foreign Directive
  4. D.Foreign Directive, Home Directive
Q6
๐Ÿง  Long Problem๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.2. Interfacing Assembly with High-Level LanguagesMedium๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
Given the assembly language routine `swap` below, write a C language program that declares and calls this assembly routine to swap two integer variables: ```assembly [section .text] global swap swap: mov eax, [esp+4] ; load pointer to first integer (int *a) mov ecx, [esp+8] ; load pointer to second integer (int *b) mov edx, [eax] ; edx = *a mov ebx, [ecx] ; ebx = *b mov [eax], ebx ; *a = *b mov [ecx], edx ; *b = *a ret ```
๐Ÿ’ป assembly Snippet
[section .text]
global swap
swap:
    mov eax, [esp+4]
    mov ecx, [esp+8]
    mov edx, [eax]
    mov ebx, [ecx]
    mov [eax], ebx
    mov [ecx], edx
    ret
Q7
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.2. Calling Conventions (cdecl vs Pascal)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
How many prevalent calling conventions (e.g., C calling convention and Pascal calling convention) primarily exist for interfacing assembly routines with high-level languages?
  1. A.2
  2. B.1
  3. C.3
  4. D.4
Q8
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. Modular Programming and Linkage DirectivesEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In NASM assembly language, an imported external symbol declared in another module is specified using which directive?
๐Ÿ’ป assembly Snippet
extern printf
  1. A.extern
  2. B.global
  3. C.import
  4. D.public
Q9
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. Modular Programming and Linkage DirectivesEasy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In NASM assembly language, an imported symbol is declared with the __________ directive, while an exported symbol is declared with the __________ directive.
๐Ÿ’ป assembly Snippet
extern printf
global _main
  1. A.External directive, Global directive
  2. B.Global directive, External directive
  3. C.Home Directive, Foreign Directive
  4. D.Foreign Directive, Home Directive
Q10
โ“ MCQ๐Ÿ“˜ CS401๐Ÿ“‘ Lec 14๐Ÿท๏ธ 14.1. Modular Assembly Programming (EXTERN and GLOBAL Directives)Easy๐Ÿ”โญ๐Ÿ’ก๐Ÿ“„๐ŸŽ“VU๐Ÿ›๏ธVU
In NASM assembly language, an imported symbol is declared with the ________ directive, while an exported symbol is declared with the ________ directive.
๐Ÿ’ป assembly Snippet
EXTERN external_routine
GLOBAL main_entry
  1. A.External directive, Global directive
  2. B.Global directive, External directive
  3. C.Home Directive, Foreign Directive
  4. D.Foreign Directive, Home Directive