CS401 Final Term Premium Conceptual Preparation by ZB Zaib
- Type
- Final term past paper
- Course
- CS401 Computer Architecture and Assembly Language Programming
- Size
- PDF 176 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 14. Download the file for all 14 pages.
- This file follows the Final Term syllabus only (Topic 9.1, Page 105 to 184).
- Lessons are deeply explained to ensure conceptual clarity.
- Definitions are written in very simple English for easy understanding.
- Daily life examples are used to explain technical assembly concepts.
- VU exams are conceptual; focus on " How" and " Why" rather than just " What".
- Students must read LMS handouts at least three times.
- This file supports LMS handouts; it does not replace them.
Lesson-wise Content (In the Name of Allah)
Topic 9.1: Hardware Interrupts
Concept: Hardware interrupts are signals sent by external devices (like keyboard, mouse, or timer) to the processor. When a device needs attention, it "interrupts" the processor's current work. The processor stops, handles the request, and then goes back to its original task.
The processor is always busy executing instructions. If a key is pressed, the keyboard controller sends a signal to the Programmable Interrupt Controller (PIC). The PIC then “Insaan ke liye wahi kuch hota hai jis ke liye woh khud mehnat aur koshish karta hai.”Reference: Surah An-Najm, Ayah 39 tells the processor that a device needs help. The processor uses an Interrupt Vector Table (IVT) to find the address of the code (ISR) that knows how to handle that specific device.
Topic 9.2: I/O Ports
Concept: I/O ports are like "mailboxes" or "doors" through which the processor talks to hardware devices. Every device has a specific port number (address).
Unlike memory which stores data, I/O ports are used to control hardware. The processor uses special instructions like IN (to read from a device) and OUT (to send data to a device). In the IBM PC, there are 65,536 possible I/O ports.
Topic 9.3: Terminate and Stay Resident (TSR)
Concept: A TSR is a special type of program that, after it finishes its initial execution, stays in the computer's memory (RAM) and continues to work in the background.
Normally, when a program ends, its memory is freed for other programs. But a TSR uses a special DOS service ( INT 21h, Service 31h ) to tell the operating system: "I am done for now, but keep my code in memory because I need to respond to interrupts later." Example: Imagine you are reading a book (Processor executing a program). Suddenly, your doorbell rings (Hardware Interrupt). You put a bookmark in your book (Save current state), go to the door to check who it is (Execute ISR), and after talking to the person, you come back and start reading from where you left off (Resume program).
Example: Think of a large apartment building. Each apartment has a mailbox (I/O Port). If the manager (Processor) wants to give a message to a specific resident (Hardware Device), he puts it in that specific mailbox. If he wants to receive a message, he checks that mailbox.
Example: Think of a security guard at a bank. He arrives in the morning (Program starts), sets up his chair (Initialization), and then just sits there (Stays Resident). He isn't actively "working" until someone tries to enter (Interrupt), then he acts, and goes back to sitting.
Topic 10: Video Services & BIOS/DOS Interrupts
Concept: Instead of writing complex code to control the screen or hardware directly, we use " Services" provided by BIOS (Basic Input/Output System) and DOS.
BIOS interrupts (like INT 10h for video) are built into the hardware's ROM. DOS interrupts (like INT 21h ) are provided by the Operating System. These services make a programmer's life easy because they handle the difficult hardware details for us.
Topic 11: Serial and Parallel Ports
Concept: These are ways to connect external devices like printers (Parallel) or modems (Serial) to the computer.
- Parallel Port: Sends multiple bits of data at the same time (like an 8-lane highway). It is fast but only for short distances.
- Serial Port: Sends data one bit at a time (like a single-lane road). It is slower but can work over long distances.
Conceptual Questions (Short & Long)
Q1. Why do we push all registers at the start of an ISR?
Answer: We push registers to save their current values. Since an interrupt can happen at any time, the registers might be holding important data for the main program. If the ISR changes them, the main program will crash when it resumes. Example: If you want to travel to another city, you don't build a car yourself (Direct Hardware Access). Instead, you call a taxi service (BIOS/DOS Interrupt). You just tell the driver where to go, and he handles the engine, steering, and roads for you.
Example: Parallel: 8 people walking side-by-side through a wide gate. Serial: 8 people walking one after another through a narrow door.
Related CS401 files
All CS401 files →- CS401 Final Term Solved File 8 by Team Hadi Final term PDF 8 MB
- CS401 Final Term MCQs by VU Topper RM Final term PDF 434 KB
- CS401 Final Term Solved File 2 by Team Hadi Final term PDF 8.3 MB
- CS401 Final Term MCQs by VUBuddy Final term PDF 1.7 MB
- CS401 Highlighted Handouts by VU Sparky Highlighted PDF 4.5 MB
- CS401 MCQs by Waqas Qureshi MCQs PDF 2.3 MB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.