In x86 assembly language multitasking concepts, fill in the blanks regarding thread context switching: During a thread context switch, the processor state consisting of __________ and __________ must be saved onto the thread's stack before switching execution.
Ch 11: Real-Time Interrupts & Timer Programming
Technical study of timer channels, programming PIT control word registers (port 0x43), divisor calculations (1193180 / frequency), hooking timer tick interrupt 08h, and rendering on-screen digital clocks.
171 Questions171 MCQs0 Short Questions0 Long Questions
SEMESTER PASS
CS401 - Computer Architecture and Assembly Language Programming Examination Practice
Timed practice exam simulation for CS401 - Computer Architecture and Assembly Language Programming.
Showing 41 โ 50 of 171 Questions
Page 5 of 18
In NASM syntax, an imported symbol defined in an external object file is declared using the __________ directive, while an exported symbol visible to other modules is declared using the __________ directive.
Given the following 32-bit x86 assembly function `swap` that exchanges two integer values via pointers:
```assembly
[section .text]
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 into eax
xchg eax, [edx] ; exchange eax with *p2
mov [ecx], eax ; copy eax into *p1
ret ; return from function
```
Write a complete C language main program that declares, links, and calls this assembly routine to swap two integer variables.
In NASM syntax, an imported symbol defined in an external object file is declared with the __________, while an exported symbol visible to other modules is declared with the __________.
In standard 32-bit x86 C calling conventions (cdecl / stdcall), which general-purpose registers are designated as caller-saved (scratch) registers whose values may be modified without preservation across function calls?
Which register is utilized for accessing thread-local variables in assembly language function stack frames?
Explain the purpose of each instruction in the following code snippet taken from a Multitasking TSR caller program:
`mov al, [chars+bx]`
`mov [es:40], al`
`inc bx`
Define multitasking in computer systems and explain how context switching enables concurrent execution.
In a multithreaded architecture, each thread maintains its own private stack frame, enabling threads to have independent ________ function calls, parameters, and variables.
Provide inline comments explaining the exact operation of each instruction in the following snippet taken from a Multitasking TSR caller program:
`mov al, [chars+bx]`
`mov [es:40], al`
`inc bx`