VU LIVE
📢 Browse Moaaz & Arslan Papers — CS, MTH, ENG, MGT and more — Free study resources
All Pages Linked

CS401 — Computer Architecture | VU Solved MCQs

Virtual Ustaad Verified VU Resource Report a wrong answer
CS401 Computer Architecture — VU solved MCQs

This solved paper covers CS401 — Computer Architecture and Assembly Language Programming for Virtual University of Pakistan students, with midterm (Lectures 1–22) and finalterm (Lectures 23–45) questions solved with answers. It includes 10 midterm MCQs, 10 finalterm MCQs, 5 midterm subjective questions and 5 finalterm subjective questions — 30 questions in total — covering computer architecture, assembly language, registers, memory and the 8088 microprocessor. Every answer was solved independently and cross-checked against the VU handout, with the handout lecture cited under each question; handout page numbers are being added as they are verified. Use the Take the CS401 quiz link below to practise all 20 MCQs interactively with a live score counter. See the CS401 course hub (https://virtualustaad.blogspot.com/p/cs401-computer-architecture-past-papers.html) for handouts, past papers and more, and the midterm and finalterm mega hubs for every subject. Compiled and verified by Virtual Ustaad. Last updated: 6 November 2026.

1. Midterm Solved MCQs

Q1. In the ADC instruction, what are the operands?
A) Two registers only
B) Two registers and one memory location
C) The carry flag (CF) and two other operands
D) The zero flag (ZF) and two other operands
Correct answer: C — The carry flag (CF) and two other operands
Reference: VU handout, Lecture 10 — Addition with carry (ADC).
Status: Verified

Q2. In assembly language, the CX register is normally used as which type of register?
A) Source register
B) Counter register
C) Index register
D) Pointer register
Correct answer: B — Counter register
Reference: VU handout, Lecture 5 — General-purpose registers.
Status: Verified

Q3. How many characters were defined by standard ASCII?
A) 64
B) 128
C) 256
D) 512
Correct answer: B — 128
Reference: VU handout, Lecture 3 — ASCII and character representation.
Status: Verified

Q4. The first instruction of a "COM" file must be at which offset?
A) 0x0010
B) 0x0100
C) 0x1000
D) 0x0000
Correct answer: B — 0x0100
Reference: VU handout, Lecture 12 — COM files and program loading.
Status: Verified

Q5. When the instruction "CMP AX, BX" executes and after execution ZF is set, what does it indicate?
A) BX is greater than AX
B) AX and BX are equal
C) ZF has no relation with CMP
D) AX is greater than BX
Correct answer: B — AX and BX are equal
Reference: VU handout, Lecture 9 — CMP and flags.
Status: Verified

Q6. When the operand of the DIV instruction is 16 bits, the implied dividend will be of how many bits?
A) 8 bits
B) 16 bits
C) 32 bits
D) 64 bits
Correct answer: C — 32 bits
Reference: VU handout, Lecture 11 — DIV instruction (implied dividend DX:AX).
Status: Verified

Q7. In the STOSW instruction, if DF = 0, by how much is DI incremented?
A) 1
B) 2
C) 3
D) 4
Correct answer: B — 2
Reference: VU handout, Lecture 18 — String instructions (STOSW moves a word).
Status: Verified

Q8. The execution of "mov word [ES:0], 0x0741" prints character "A" on the screen. What is the background colour of the character?
A) Black
B) White
C) Red
D) Blue
Correct answer: A — Black
Reference: VU handout, Lecture 21 — Video memory and the attribute byte (0x07 = white foreground on black background).
Status: Verified

Q9. Which assembly instruction puts the value of AX on the stack?
A) PUSH AX
B) MOV STACK, AX
C) ADD AX
D) SEND AX
Correct answer: A — PUSH AX
Reference: VU handout, Lecture 13 — Stack and PUSH/POP.
Status: Verified

Q10. The 8088 processor divides interrupts into how many classes?
A) 2
B) 3
C) 4
D) 5
Correct answer: A — 2
Reference: VU handout, Lecture 22 — Interrupts: software and hardware interrupts.
Status: Verified

2. Finalterm Solved MCQs

Q1. Suppose AL contains 5 decimal. After two left shifts, what value does AL contain?
A) 5
B) 10
C) 20
D) 40
Correct answer: C — 20
Reference: VU handout, Lecture 11 — Shift instructions (each left shift doubles the value: 5 → 10 → 20).
Status: Verified

Q2. In graphics mode, a location in video memory corresponds to what on the screen?
A) A character
B) A pixel (a single dot)
C) A whole line
D) A whole screen page
Correct answer: B — A pixel (a single dot)
Reference: VU handout, Lecture 30 — Graphics mode and video memory.
Status: Verified

Q3. Which IRQ is driven by the keyboard?
A) IRQ 0
B) IRQ 1
C) IRQ 3
D) IRQ 7
Correct answer: B — IRQ 1
Reference: VU handout, Lecture 23 — Interrupt controller and IRQ mapping (IRQ 1 = keyboard).
Status: Verified

Q4. Which INT 21H service is used to read a character from standard input with echo, returning the character in AL?
A) Service 01H
B) Service 02H
C) Service 09H
D) Service 4CH
Correct answer: A — Service 01H
Reference: VU handout, Lecture 25 — DOS services via INT 21H.
Status: Verified

Q5. Which INT 21H service is used to write a '$'-terminated string on standard output?
A) Service 01H
B) Service 02H
C) Service 09H
D) Service 0AH
Correct answer: C — Service 09H
Reference: VU handout, Lecture 25 — DOS services via INT 21H.
Status: Verified

Q6. The hard disk Master Boot Record (MBR) is of what size?
A) 446 bytes
B) 350 bytes
C) 512 bytes
D) 256 bytes
Correct answer: C — 512 bytes
Reference: VU handout, Lecture 38 — Hard disk, MBR and booting (446-byte boot code + 64-byte partition table + 2-byte signature = 512 bytes).
Status: Verified

Q7. BIOS video services are exported via which interrupt?
A) INT 10H
B) INT 16H
C) INT 17H
D) INT 21H
Correct answer: A — INT 10H
Reference: VU handout, Lecture 24 — BIOS and DOS interrupts.
Status: Verified

Q8. Which interrupt is the single entry point for DOS services?
A) INT 10H
B) INT 16H
C) INT 21H
D) INT 14H
Correct answer: C — INT 21H
Reference: VU handout, Lecture 24 — BIOS and DOS interrupts.
Status: Verified

Q9. A parallel port transfers data in what form?
A) One bit at a time
B) 8 bits simultaneously
C) One byte per second only
D) Only through the keyboard
Correct answer: B — 8 bits simultaneously
Reference: VU handout, Lecture 32 — Parallel port.
Status: Verified

Q10. Creation of threads can be:
A) Static only
B) Dynamic
C) Impossible in assembly
D) Only by the BIOS
Correct answer: B — Dynamic
Reference: VU handout, Lecture 40 — Multitasking and threads.
Status: Verified

3. Midterm Subjective

Q1. Explain the process of ADC.
Answer: Normal addition (ADD) has two operands: the second operand is added to the first. ADC (add with carry) effectively has three operands, because the carry flag (CF) is an implied third operand. ADC first adds CF to the destination and then adds the source operand, so a carry out of a lower part is not lost. This is used for multi-word addition: the lower halves are added with ADD, and the upper halves are added with ADC so that any carry from the lower half is carried into the upper half. For example, to add two 32-bit numbers on a 16-bit processor, ADD adds the low words and ADC adds the high words plus the carry.
Reference: VU handout, Lecture 10 — ADC instruction.
Status: Verified

Q2. What is the difference between the LES and LDS instructions?
Answer: Both LES and LDS load a segment register and a general-purpose register from two consecutive memory locations, and both are used when a subroutine receives a segment:offset pair as an argument. The difference is which segment register is loaded: LES loads ES, while LDS loads DS. Each takes two parameters — the general-purpose register to load and the memory location to load from. The offset goes into the general-purpose register and the segment goes into ES (for LES) or DS (for LDS).
Reference: VU handout, Lecture 17 — LES and LDS.
Status: Verified

Q3. What is the difference between the SHR and SAR instructions?
Answer: SHR (shift logical right) moves every bit one place to the right, inserts a 0 from the left, and copies the bit shifted out on the right into the carry flag. SAR (shift arithmetic right) also moves every bit one place to the right and copies the bit shifted out into the carry flag, but it keeps a copy of the most significant bit (the sign bit) in the most significant position. So SHR is used for unsigned numbers, while SAR preserves the sign of a signed number.
Reference: VU handout, Lecture 11 — Shift instructions.
Status: Verified

Q4. What is the difference between CALL and RET?
Answer: CALL allows a temporary diversion of control to a subroutine, so the same code can be reused from many places. It saves the return address (the offset, and the segment for a far call) on the stack and jumps to the subroutine. RET means return: it takes no destination argument, pops the saved return address from the stack, and transfers control back to the instruction following the CALL. Together they make subroutines reusable without duplicating code.
Reference: VU handout, Lecture 14 — CALL and RET.
Status: Verified

Q5. If DF = 0 what does it represent, and if DF = 1 what does it represent? Also explain incrementing and decrementing stacks.
Answer: The direction flag (DF) controls the direction of string instructions. If DF = 0 (cleared, e.g. with CLD), the direction is from lower addresses to higher addresses — autoincrement mode, so SI/DI are increased after each step. If DF = 1 (set, e.g. with STD), the direction is from higher addresses to lower addresses — autodecrement mode, so SI/DI are decreased. Separately, the 8088 stack is a decrementing stack: whenever an element is pushed, SP is decremented by 2 first and then the word is stored, and whenever an element is popped, the word is read and SP is incremented by 2. Because the unit of stack operation is a word, a single byte cannot be pushed or popped.
Reference: VU handout, Lecture 18 — Direction flag and string instructions; Lecture 13 — Stack.
Status: Verified

4. Finalterm Subjective

Q1. Differentiate between serial and parallel port communication.
Answer: A serial port sends and receives data one bit at a time over a single line, so it needs fewer wires and works well over longer distances, but it is slower. A parallel port sends several bits — typically 8 — simultaneously over separate lines, so it is faster over short distances but needs more wires and is more affected by interference over distance. In the PC, the serial port is accessed through INT 14H (COM1/COM2) and the parallel port through INT 17H (LPT1). Serial communication is used for modems and serial devices, while the parallel port was traditionally used for printers.
Reference: VU handout, Lecture 32 — Serial and parallel ports.
Status: Verified

Q2. Describe the commonly used INT 21H DOS services: 01H, 02H, 09H and 4CH.
Answer: INT 21H is the single entry point to DOS: the required function number is placed in AH before calling it. Service 01H reads a character from the keyboard with echo and returns it in AL. Service 02H displays the character in DL on the screen. Service 09H displays a '$'-terminated string whose offset is in DX. Service 4CH terminates the program and returns control to DOS, with the return code in AL. These four services cover basic console input, output and clean program exit.
Reference: VU handout, Lecture 25 — DOS services via INT 21H.
Status: Verified

Q3. How are interrupts handled in protected mode, and what is the IDTR?
Answer: In protected mode the real-mode interrupt vector table is replaced by the Interrupt Descriptor Table (IDT), which holds gate descriptors for each interrupt. The IDTR (Interrupt Descriptor Table Register) stores the base address and the limit (size) of the IDT, and it is loaded with the LIDT instruction. When an interrupt occurs, the processor uses the interrupt number as an index into the IDT, checks the descriptor's privilege level, and transfers control to the handler described there. Unlike real mode, the handler address is not a simple segment:offset pair in low memory, but a descriptor that the processor validates first.
Reference: VU handout, Lecture 36 — Protected mode and IDT.
Status: Verified

Q4. What is the format of the DOS input buffer (INT 21H service 0AH)?
Answer: The DOS buffered-input buffer is a memory area whose address is passed in DS:DX. Its first byte states the maximum number of characters the buffer can hold. Its second byte is filled in by DOS with the actual number of characters read (excluding the terminating carriage return). The characters themselves start at the third byte, and input ends when the user presses Enter, which DOS stores as a carriage return (0DH). The program must therefore set the first byte before the call and read the count from the second byte afterwards.
Reference: VU handout, Lecture 25 — DOS services via INT 21H.
Status: Verified

Q5. Explain the INT 14H read operation from the serial port.
Answer: INT 14H provides the BIOS serial (asynchronous) port services. To read, the function number for read is placed in AH (00H for initialise, 02H for receive), the port number (0 = COM1, 1 = COM2) is placed in DX, and INT 14H is called. The BIOS waits for a character to arrive over the serial line and returns it in AL. Status information, such as whether a character is ready or an error occurred, is returned in AH. Because serial data arrives one bit at a time, the program must initialise the port (baud rate, data bits, stop bits, parity) with INT 14H function 00H before reading.
Reference: VU handout, Lecture 33 — Serial port and INT 14H.
Status: Verified

Frequently asked questions

How many questions are in this CS401 solved paper? 30 questions in total: 10 midterm MCQs, 10 finalterm MCQs, 5 midterm subjective questions and 5 finalterm subjective questions, all with solved answers and handout references.

Are the answers verified? Yes. Every answer was solved independently and cross-checked against at least two sources, including the VU handout. Where a handout page number is confirmed it is cited under the question; page numbers still being verified are being added over time.

Can I practise these MCQs as a quiz? Yes — use the Take the CS401 quiz link in this post to practise all 20 MCQs interactively on the Solved MCQs page, with a live score counter.



Comments

Advertisement
Advertisement

Tool