0% found this document useful (0 votes)
88 views33 pages

CS401 Short Notes

This document provides a summary of key concepts in computer architecture and assembly language programming. It includes 50 multiple choice questions covering topics like interrupts, the programmable interrupt controller, parallel ports, and multitasking. Correct answers are provided for each question to aid studying. The questions assess understanding of concepts like interrupt priorities, interrupt handling, context switching, and data structures used for task scheduling.

Uploaded by

asimtoqeer458
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
88 views33 pages

CS401 Short Notes

This document provides a summary of key concepts in computer architecture and assembly language programming. It includes 50 multiple choice questions covering topics like interrupts, the programmable interrupt controller, parallel ports, and multitasking. Correct answers are provided for each question to aid studying. The questions assess understanding of concepts like interrupt priorities, interrupt handling, context switching, and data structures used for task scheduling.

Uploaded by

asimtoqeer458
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

CS401

Computer Architecture and


Assembly Language
Programming
1
th
BSCS 4 semester
Final Term Short Notes + MCQS
1. Which One of the following instruction is used to return from an interrupts
service routine? (page 104)
Iret
2. The fist parallel port LPTI has ports designed from____to______ (page 125)
378,37A
3. _____is used for exporting keyboard services. (page 108)
INT 16
4. Which of the following in the priority of interrupt Request (IRQ) 0? (Page
114)
Highest
5. Each of Bits of Points_____corresponds to one of the interrupts Request
(IRQ) lines. (page 115)
21
6. If the_____flag is set, then after every instruction a type 1 interrupt will be
generated automatically. (page 133)
Trap OR Interrupt
7. ______is/are the point number(s) for parallel point. (page 115)
378
8. Which of the following stand for TSR? (page 121)
Terminate and Stay Resident
9. Which of the following is correct regarding the input frequency of
programmable interval timer (PIT)? (Page 122)
It is Fixed
10. At the end of servicing an interrupt ________signal is used to inform the
programmable interrupt controller (PIC) about it. (page 114)
EOI
11. In programmable interrupt controller which of the following ports is referred as interrupt
mask register?
a. 19
b. 20
c. 21
d. 22
12. ________is the highest priority interrupt in interrupt controller
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
13. IRET returns on the basis of _________ and ___________
a. CS, IP
b. DS, IP
c. CS, SS

0304-1659294 M. Junaid
2
th
BSCS 4 semester
d. IP, SP
14. If __________ is set, the after every instruction a type 1 interrupt will be automatically
generated.
a. Parity flag
b. Trap flag
c. Carry flag
d. Overflow flag
15. The interrupt handler uses _____________instruction to return back to the caller.
a. IRET
b. RETI
c. INTR
d. RET
16. Which of the following interrupt is used for Arithmetic overflow?
a. INT 1
b. INT 2
c. INT 3
d. INT 4
17. During the execution of INT instruction , some contents are pushed on to the stack , the order
of pushing then is
a. CS , IP and then FLAGS register
b. IP,CS and then FLAGS register
c. FLAGS register, CS and then IP
d. FLAGS register, IP and the CS
18. Each of the bits at port ___________corresponding to one of the IRQ lines.
a. 18
b. 19
c. 20
d. 21
19. Which of the following pins of the parallel port connector are grounded?
a. 10-18
b. 18-25
c. 25-32
d. 32-39
20. Which of the following interrupts plays the most significant part during step debugging of a
program?
a. INT 0
b. INT 1
c. INT 2
d. INT 3
21. Which of the following IRQs is connected to serial port COM 2?
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
22. Which of the following IRQs is connected to serial port COM 1?
a. IRQ 4

0304-1659294 M. Junaid
3
th
BSCS 4 semester
b. IRQ 5
c. IRQ 6
d. IRQ 7
23. Which of the following IRQs is used by the parallel port?
a. IRQ 4
b. IRQ 5
c. IRQ 6
d. IRQ 7
24. In programmable interrupt controller which of the following ports is used to selectively
enabling or disabling interrupts?
a. 19
b. 20
c. 21
d. 22
25. The space where all the registers of task are stored is called ______
a. Control block
b. Process control block
c. Stack
d. Memory
26. Which of the following is the destination register in IN instruction?
a. AL or AX
b. BL or BX
c. CL or CX
d. DL or DX
27. Which of the following interrupts is used for saving and restoring the registers
a. INT 6
b. INT 7
c. INT 8
d. INT 0
28. In multitasking environment, which of the following structure is used to maintain the
ordering of active PCBs?
a. Array
b. Register
c. Linked List
d. Stack
29. In multitasking which of the following interrupts is used as scheduler during context
switching?
a. INT 21
b. INT 16
c. INT 13
d. INT 8
30. Which of the following are required for thread entry?
a. CS and DS
b. CS and IP
c. IP and general purpose registers
d. SS and SP

0304-1659294 M. Junaid
4
th
BSCS 4 semester
31. The time interval between two timer tick is?
a. 40 ms
b. 45 ms
c. 50 ms
d. 55 ms
32. Which of the following flag can be used for mathematical operations?
a. Direction Flag
b. Carry Flag
c. Trap Flag
d. Interrupt Flag
33. In multi tasking, the process of saving and restoring to values of registers from a process
control block (PCB) is called _________
a. Context switching
b. Context saving
c. Context restoring
d. Code switching
34. When two devices in a system want to use the same IRQ line, is referred as:
a. IRQ Collision
b. IRQ Conflict
c. IRQ Crash
d. IRQ Blockage
35. An End of Interrupt (EOI) signal is sent by
a. Handler
b. Processor
c. IRQ
d. PIC
36. Which of the following is the BIOS interrupt providing keyboard service?
a. INT 0x13
b. INT 0x14
c. INT 0x15
d. INT 0x16
37. Threads can have function calls, parameters and _________ variables.
a. Global
b. Local
c. Legal
d. Illegal
38. Which of the following arranges jobs in a sequence in order to be executed?
a. Process control block
b. Arranger
c. Control unit
d. Scheduler
39. Which of the following flags cannot be cleared using an assembly instruction?
a. Trap flag
b. Interrupt flag
c. Direction flag
d. Carry flag

0304-1659294 M. Junaid
5
th
BSCS 4 semester
40. Which of the following is the highest priority interrupt?
a. INT3
b. INT2
c. INT1
d. INT0
41. At the end of servicing an interrupt, which of the following is used to inform tha PIC that it is
completed?
a. RET
b. EOI
c. IRET
d. RET N
42. Which of the following interrupts is used for maintaining the system time?
a. INT 0
b. INT 1
c. INT 8
d. INT 10
43. Which of the following is used for exporting parallel port services?
a. INT 17
b. INT 16
c. INT 15
d. INT 8
44. In programmable interrupt controller which of the following ports is referred as a control
port?
a. 19
b. 20
c. 21
d. 22
45. The first parallel port LPT1 has port number designated from _______.
a. 178 to 17A
b. 278 to 27A
c. 378 to 37A
d. 478 to 47A
46. ___________ is/are the port number(s) for parallel port.
a. 20 and 21
b. 60 to 64
c. 380
d. 378
47. The number of pins in a parallel port connector are?
a. 20
b. 25
c. 30
d. 35
48. The offset address of an interrupt n will be at
a. n
b. nx2
c. nx3

0304-1659294 M. Junaid
6
th
BSCS 4 semester
d. nx4
49. Programmable interrupt controller has two ports (20 and 21). Port 20 is the control port while
port 21 is _______.
a. The interrupt mask register
b. Interrupt port
c. Output port
d. Input port
50. Which of the following instruction selects memory address space?
a. MOV
b. DEC
c. IN
d. ADD
51. The thread registration code initializes the PCB and adds it to the linked list so that the
_______ will give it a turn.
a. Assembler
b. Scheduler
c. Linker
d. Debugger
52. Which of the following instruction is used for disabling all the interrupts during a program
execution?
a. Cli
b. Sti
c. Reti
d. Iret
53. IBM AT has how many PICs (Programmable interrupt controller)
a. 1
b. 2
c. 3
d. 4
54. Programmable interrupt controller (PIC) has
a. One input signals and eight output signals
b. One input signal and one output signal
c. Eight input signals and one output signals
d. Eight input signals and eight output signals
55. In 8088 processor, there can be total _______ possible entries in an interrupt vector table.
a. 256
b. 64
c. 128
d. 512
56. Each thread can have their own
a. Execution area
b. Stack
c. Memory
d. Array
57. The parallel port connector is called ?
a. DB-25

0304-1659294 M. Junaid
7
th
BSCS 4 semester
b. BD-25
c. DB-24
d. BD-24
58. In 8088, the physical memory address for Interrupt Vector Table is fixed and the table
occupies exactly ______ of memory.
a. 1 KB
b. 1 MB
c. 64 KB
d. 4 Bytes
59. Which of the following interrupts is non maskable interrupt?
a. INT 0
b. INT 1
c. INT 2
d. INT 3
60. Using OUT instruction on parallel data port results into a signal of ________ for every 1 bit.
a. 0 V
b. 1 V
c. 5 V
d. 10 V
61. PCB stands for?
a. Process Control Block
b. Process Cleaning Block
c. Programmable Counter Block
d. Programs Control Block
62. Which of the following interrupts is used in debugging with the trap flag?
a. INT 0
b. INT 1
c. INT 2
d. INT 3
63. Which of the following port number is used to send an end of interrupt (EOI) signal to the
PIC after an interrupt is ended?
a. 0x16
b. 0x20
c. 0x60
d. 0x378
64. Which of the following instruction is used for reading a char from keyboard?
a. out al, 0x60
b. in al, 0x60
c. out dx, al
d. out dx, 0x378

65. In PIC, which of the following port is used for selectively enabling or disabling interrupts?
a. 19
b. 20
c. 21
d. 22

0304-1659294 M. Junaid
8
th
BSCS 4 semester
66. DOS has single entry point to access all its services through interrupt________
a. INT 21
b. INT 16
c. INT 2
d. INT 10
67. Which of the following pins of parallel port are used to carry the data from processor to the
device connected through parallel port?
a. Pin 2 to pin 9
b. Pin 10
c. Pin 4
d. Pin 18 to pin 25
68. The input frequency of the programmable interval timer(PIT) is
a. Fixed
b. Depends on processor block
c. Variable
d. Depends on hardware attached
69. All registers of task are stored in space called ________
a. Process storage block
b. Process control block
c. Process terminal
d. Swapping space
70. Which of the following IRQ`s is derived by a key board
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
71. The programmable interval timer (PIT) has input frequency of
a. 1.193MHz
b. 2.193MHz
c. 3.193MHz
d. 4.193MHz
72. Changing and restoring the state of Control processing unit (CPU) is referred as
a. Thrashing
b. Multitasking
c. Context Switching
d. Multithreading
73. For the external hardware to generate an interrupt there are how many pins outside the
processor?
a. 1
b. 2
c. 3
d. 4
74. Which of the following instruction selects peripheral address space?
a. MOV
b. DEC
c. IN

0304-1659294 M. Junaid
9
th
BSCS 4 semester
d. ADD
75. Which of the following is the most commonly used port with printer?
a. Serial Port
b. USB port
c. Parallel Port
d. DVI Port
76. _________allows us to execute one instruction at a time rather than the whole program at
once
a. INT 0
b. INT 1
c. INT 2
d. INT 3
77. Which of the following is used for exporting keyboard services?
a. INT 16
b. INT 11
c. INT 12
d. INT 8
78. TSR stands for
a. Terminate and store routines
b. Transmits and save resources
c. Terminate and Stay resident
d. Truncate and start recursively
79. Which of the following interrupts is of highest priority interrupt?
a. Key Board Interrupt
b. Timer Interrupt
c. INT 2
d. INT 3
80. In older computers, the port number designed for parallel pert LPT2 are_____
a. 078-07A
b. 178-17A
c. 278-27A
d. 378-37A
81. Which of the following is the ACK pin in DB-25 Connector
a. 10
b. 11
c. 12
d. 13
82. Which of the following IRQs is a cascading interrupt?
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
83. In interrupt masking, we use _______ to get control from the program without letting the
program know about it.
a. IRQ 0
b. IRQ 1

0304-1659294 M. Junaid
10
th
BSCS 4 semester
c. IRQ 5
d. IRQ 7
84. The output of programmable timer interval is connected to which line of the PIC?
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
85. Which of the following IRQs is used for Floppy disk drive?
a. IRQ 4
b. IRQ 5
c. IRQ 6
d. IRQ 7
86. In multitasking, each PCB requires _______ bytes to store the values of registers.
a. 14
b. 28
c. 32
d. 16
87. Which of the following IRQs is used for sound card or network card?
a. IRQ 4
b. IRQ 5
c. IRQ 6
d. IRQ 7
88. Programmable interrupt controller has _______ ports.
a. 1
b. 2
c. 3
d. 4
89. Which of the following bits of parallel control port enables the IRQ 7 triggering by the ACK
pin?
a. Bit 1
b. Bit 2
c. Bit 3
d. Bit 4
90. Which of the following IRQs is derived by a timer device?
a. IRQ 0
b. IRQ 1
c. IRQ 2
d. IRQ 3
91. ________is a special type of interrupt that returns to the same instruction instead f the next
instruction
a. Divide overflow
b. Debug interrupt
c. Arithmetic overflow interrupt
d. Change the sign interrupt
92. All the registers & stack are saved in
a. Multitasking

0304-1659294 M. Junaid
11
th
BSCS 4 semester
b. Multi-Processing
c. Function call
d. BIOS
93. Which of the following is the source register in OUT instruction?
a. AL or AX
b. BL or BX
c. CL or CX
d. DL or DX
94. Which of the following is the destination register in IN instruction?
a. AL or AX
b. BL or BX
c. CL or CX
d. DL or DX
95. In the context of video service, if we want to set the cursor at top left
corner, which of the values will be stored in DH and DL respectively?
a. 00.00 page 141
a. 00.80
b. 25.80
c. 0.01
96. Which of the following INT 21 service is used to read character from standard input?
a. 00
b. 01 page 144
b. 02
c. 03
97. “INT13-BIOS disk service” generally uses which register to return the “error flag”?
a. CF page 148
a. DL
b. AH
c. AL
98. Which of the following service of INT 10 is used to get the video font information?
a. 1129h
b. 1130h page 142
b. 1128h
c. 1127h
99. Which of the following service of INT 10 is used to write graphic pixel on the screen?
a. 0x0A
b. 0x0B
c. 0x0C page 144
c. 0x0D
100. On executing INT 0x21-service 0x3D, if file is successfully opened
then
a. CF will contain 1

0304-1659294 M. Junaid
12
th
BSCS 4 semester
b. CF will contain 0
c. ZF will contain 1
d. ZF will contain 0
101. On executing INT 0x21-service 0x3D, if file can’t be opened then
a. CF will contain 1
b. CF will contain 0
c. ZF will contain 1
d. ZF will contain 0
102. Device drivers can be divided into ______ major categories
a. 5
b. 4
c. 3
d. 2
103. We can set the current file position in DOS using service number
________
a. 0x38
b. 0x40
c. 0x42 page 154
e. 0x43
104. COM1 is accessible via ports _________ while COM2 is accessible via
______
a. 3FD, 3F9
b. 2F8-2FF, 3F8-3FF
c. 3F9, 3FD
d. 3F8-3FF, 2F8-2FF page 164
105.In the context of vides services, if we want to write string then which of the
value will be placed in AH?
a. 10h
b. 12h
c. 11h
d. 13h page 142
106.In the context of video service, if we want to scroll the window up
which of the following will be value of AH?
a. AH = 05h
b. AH = 06h page 141
a. AH = 07h
b. AH = 08h
107.In the context of video services, if we want to set cursor position which of
the following will be the value of AH?
a. AH = 01h
b. AH = 02h page 139

0304-1659294 M. Junaid
13
th
BSCS 4 semester
c. AH = 03h
d. AH = 04h
108.Which standard format is used for sending data on the serial port?
a. Full duplex
b. BIOS INT 14
c. RS232 page 163
d. COM1
109.INT 0x13 service 0x08 is use to ____________
a. Read disk sector
b. Write disk sector
c. Reset disk sector
d. Get drive parameter page 148
110. Parameters pushed to the routine in _______ order with the
rightmost being pushed first using language
a. Reverse page 179
b. Proper
c. Forward
d. Same
111. Parameters pushed to the routine in _______ order with the left
most being pushed first using Pascal language
a. Proper page 179
b. Same
c. Reverse
d. Forward
112. _________ symbol is added to any function or variable using the C language
naming
convention
a. Underscore page 177
b. #
c. &
d. @
113. Which of the following BIOS INT provides serial port services
a. INT 21
b. INT 14 page 163
c. INT 10
d. INT 08
114. A 32-bit address register can access up to ________ of memory
a. 2 MB
b. 2 GB
c. 4 MB
d. 4 GB page 167

0304-1659294 M. Junaid
14
th
BSCS 4 semester
115. . BIOS video services are exported via interrupt
a. INT 10 page 139
b. INT 9
c. INT 8
d. INT 7
116. Which of the following is used to terminate a string in assembly
language?
a. !
b. #
c. $
d. ;
117. The bits are sent one by one in specially formatted fashion on
the___________
a. Half duplex
b. Parallel port
c. Full duplex
d. Serial port page 163
118. In VESA defined modes _______bits for every pixel
are organized
a. 8 color
b. 16 color page 172
c. 32 color
d. 64 color
119. What is the abbreviation VESA _____________ and VBE ___________
a. Video Electrical System Association, VGA BIOS Extensions
b. Video Electronics Standards Administration , Video Bus Extensions
c. Video Electronics Standard Association, Video BIOS Extensions
page 172
d. VGA Electronics Standard Association, Video BIOS External
120.Which of the following services of INT 21 is used to write a string on standard output?
a. 00h
b. 02h
c. 09h page 144
d. 10h
121. In 9pin DB 9 connector, which pin is assigned to RD (Received Data)?
a. 1
b. 2 page 163
c. 3
d. 4
122. The maximum length of DOS command line parameters is
a. 64 bit

0304-1659294 M. Junaid
15
th
BSCS 4 semester
b. 127 bits
c. 256 bits
d. 512 bits
123. In C _______ is responsible for removing the parameters.
a. Clear
b. Callee
c. Caller page 179
d. Stack
124. While using INT 10 for writing graphic pixel on screen, which of the
following registers hold the information about pixel color?
a. DH
b. DL
c. AH
d. AL page 144
125. . As compared to _________ , __________ provides more cooked
services.
a. BIOS, DOS page 144
b. DOS, OS
c. DOS, BIOS
d. OS, DOS
126. _____________ Register is used for storing the base and limit of GDT.
a. LGDT
b. GDTR page 168
c. Null Descriptor
d. LDT
127. INT13-BIOS disk service” generally uses which register to return the “error
code”?
a.CF
b.DL
c.AH page 148
d.AL
128. In case of COM File, first command line parameter is stored at
_______________ offset of ‘Program segment prefix’
a. 0x80
b. 0x82
c. 0x84
d. 0x86
129. New devices are allowed to work with the existing operating system with the
help of
________.
a. Sockets

0304-1659294 M. Junaid
16
th
BSCS 4 semester
b. Port addresses
c. BIOS
d. Device drivers page 158
130. _________ byte of DOS data buffer stores the maximum characters buffer can
hold.
a.First page 144
b.Second
c.Third
d.Last
131. The register size of 386 architecture is _______
a. 16 bit
b. 32 bit page 167
c. 20 bit
d. 4 GB
132. Com 1 is connected with
a. IRQ 2
b. IRQ 3
c. IRQ 4 page 106
d. IRQ 5
133. Which of the following services of INT 10 is used for writing the
string?
a. 0x12
b. 0x13 page 142
c. 0x11
d. 0x10
134. The first entry of the GDT must always be zero, it is called the
___________
a. Null Descriptor page 168
b. Data Descriptor
c. Code Descriptor
d. Global Descriptor Table
135.The first sector on hard disk contains the
a. Hard disk
b. Partition table page 150
c. Data size
d. Sector size
136. BIOS video services are broadly classified into
________________categories
a. 1
b. 2 page 140
c. 3
d. 4

0304-1659294 M. Junaid
17
th
BSCS 4 semester
137. In case of COM file, maximum length of parameters passed
through command line can be _____
a. 63 bytes
b. 127 bytes
c. 255 bytes
d. 511 bytes
138. In Pascal _______ is responsibility for removing the parameters
a. Stack
b. Clear
c. Caller
d. Callee page 179

139. Hard disk MBR (Master Boot record) is of size


a. 446 bytes page 150
b. 350 bytes
c. 512 bytes
d. 256 bytes
140. In 9pin DB 9 connector , which pin is assigned to Signal Ground
a. 3
b. 4
c. 5 page 163
d. 6
141. Two prevalent calling conventions are the __________ and _________
a. C# calling convention, Java calling convention
b. C calling convention, Pascal Calling convention page 179
c. C++ calling convention, Java calling convention
d. C++ calling Convention, Python calling Convention
142. Com2 is connected with
a. IRQ 2
b. IRQ 3 page 106
c. IRQ 4
d. IRQ 5
143. BPB stands for
a. Basic Parameter Block
b. BIOS Precise Block
c. Basic Precise Block
d. Bios Parameter Block page 159
144. While writing graphic pixel on the screen, which registers hold
the value for setting cursor position?
a. AX, BX
b. AX, CX

0304-1659294 M. Junaid
18
th
BSCS 4 semester
c. BX, CX
d. CX, DX
145. The VESA VBE 2.0 standard include a ______ mode which allows
direct access to the whole video memory.
a. Parallel frame buffer
b. Liner frame buffer page 172
c. Real
d. Protected
146. In 9pin DB 9 connector, which pin is assignment to TD (Transmitted
Data)?
a. 1
b. 2
c. 3
d. 4
147. INT 0x13 service 0x03 is used to ____________
a. Read disk sector
b. Write disk sector page 148
c. Reset disk sector
d. Get drive parameter
148. Serial port services are provided by the ________
a. BIOS INT 11
b. BIOS INT 14 page 163
c. BIOS INT 13
d. RS232
149. Which of the following register hold the page number for using the
write string service of INT 10?
a. AH
b. BL
c. CL
d. BH page 144
150. The “program segment prefix” for com file is of _______size
a. 64bytes
b. 128 bytes
c. 256 bytes
d. 512 bytes
151. Which of the following registers are used as DOS input buffer
a. DS, AX
b. SS, SP
c. DS, DX page 144
d. CS:BX

0304-1659294 M. Junaid
19
th
BSCS 4 semester
152. Which register is generally used to specify the service number of an
interrupt
a. DX
b. AX page 100
c. BX
d. CX
153. The root directory of floppy contains _______fixed entries
a. 64
b. 256
c. 128
d. 512 page 156
154.In FAT32 file system directory entry in DOS consist of how many bytes?
a. 16
b. 24
c. 32 page 147
d. 64
155. ____________ is the highest priority interrupt in interrupt controller
a. IRQ 0 page 106
b. IRQ 1
c. IRQ 2
d. IRQ 3
156. Operating system organize data in form of
a. Folder
b. Batch file
c. File page 153
d. None of given
157. The higher 16 bit of EAX register are labeled as
a. AX
b. EAH
c. AH
d. None of given
158. ________is special type of interrupt that returns to the same instruction
instead of the next instruction. (page 107)
Divide overflow interrupt
159. In Intel 8088, there are total of____possible interrupt vectors in an interrupt
vector table. (page 105)
256
160. Which of the following pins of DB-256 connector are ground? (page 125)
18-25
161. Which of the following interrupts is used for saving and restoring the
register? (page141)

0304-1659294 M. Junaid
20
th
BSCS 4 semester
INT 08
162. Which of the following instructions is used to read a character from the
keyboard port? (page
INT al, Ox60
163. In Intel 8088, the interrupt vector Table occupies ____ of memory.
1 KB NOT Sure (GOOGLE)
164. Which of the following interrupt request is used for a floppy disk drive?
(Page 114)
IRQ 6
165. Which of the following interrupt request is used for a parallel ports? (page
114)
IRQ 7
166. Which of the following is the order of pushing the contents on stack during
the execution of INT instruction?
Flags, CS and Then IP
167. Which of the following interrupt request (IRQ) is connected to the serial
Ports COM2? (Page 114)
IRQ 3
168. Which of the following interrupt request (IRQ) is connected to the sound
card or the network card or the modem? (Page 114)
IRQ 5
169. Which of the following interrupt request (IRQ) is connected to the serial
Ports COM1? (Page 114)
IRQ 4
170. Which of the following Interrupts play the most significance part during
single step debugging of a program? (Page 105)
INT 1
171. Which of the following is the highest priority interrupt? (Page 114)
INT 08
172. An end of interrupt (EOI) signal is sent by the ______ (Page 114)
Interrupt Handler
173. Which of the following flags can be used in mathematical operation? (Page
133)
Carry flag
174. The thread registration code initializes the process control block (PCB) and
adds it to the linked list. The_______ then gives it a turn. (Page 141)
Scheduler
175. Which of the following IRQs is derived by a keyboard? (Page 114)
IRQ 1
176. Which of the following IRQs is the cascading interrupt connected to the
output of the second 8451? (Page 114)
IRQ 2
177. The space where all the registers of task are stored is called ______ (page 140)

0304-1659294 M. Junaid
21
th
BSCS 4 semester
Process Control Block OR PCB
178. Which of the following is the destination register in IN instruction? (Page
115)
AL OR AX
179. Which of the following interrupt is used for Arithmetic overflow? (page 106)
INT 4

180. Which of the following interrupt is used for NMI-Non Mask Able? (Page 105)
INT 2

181. Which of the following interrupt Trap, Single step? ( Page 105)
INT 1

182. Which of the following interrupt Division by zero? (Page 105)


INT 0
183. IRET returns on the basis of _________ and ___________ (Page 104)
CS and IP
184. Which of the following interrupts is used for saving and restoring the
registers? (Page 141)
INT 08 OR INT 8
185. The time interval between two timer tick is. (Page 122)
55ms
186. When two devices in a system want to use the same IRQ line, is referred as.
(Page 114)
IRQ Conflict
187. Which of the following is the BIOS interrupt providing keyboard service?
(Page 110)
INT 0x16
188. Threads can have function calls, parameters and _________ variables. (Page
141)
LOCAL
189. Which of the following flags cannot be cleared using an assembly instruction?
Trap Flag
190. In older computers, the port number designed for parallel pert LPT2
are_____ (Page 125)
278-27A
191. Which of the following instruction selects memory address space? (Page 115)
MOV
192. Which of the following port number is used to send an end of interrupt (EOI)
signal to the PIC after an interrupt is ended? (Page 124)
0x20
193. The parallel port connector is called? (Page 125)
DB-25

0304-1659294 M. Junaid
22
th
BSCS 4 semester
194. The interrupt mask register which can be used for enabling or disabling
interrupts is associated with. (Page 115)
21

Short Notes:
Leacture 10

The three flags not used for mathematical operations are:

1. the direction flag,


2. the interrupt flag and
3. the trap flags

If the trap flag is set, the after every instruction a type 1 interrupt will be automatically
generated. This is named as the single step interrupt. This is like the divide by zero interrupt
which was never explicitly invoked but it came itself. The debugger is made using this interrupt.

INT 1 function: It allows one instruction to be executed and then return control to us. It has its
display code and its code to wait for the key in the INT 1 handler. Therefore, after every
instruction the values of all registers are shown and the debugger waits for a key.
Another interrupt used by the debugger is the break point interrupt INT 3.

INT 3 has a single byte opcode so it can replace any instruction. To put a breakpoint, the
instruction is replaced with INT 3 opcode and restored in the INT 3 handler. The INT 3 opcode is
placed again by a single step interrupt that is set up for this purpose after the replaced
instruction has been executed.

Note: There is no instruction to set or clear the trap flag like there are instructions for the
interrupt and direction flags.

PUSHF and POPF:

We use two special instructions PUSHF and POPF to push and pop the flag from the stack.

We use PUSHF to place flags on the stack, change TF in this image on the stack and then reload
into the flags register with POPF. The single step interrupt will come after the first instruction
after POPF.

The interrupt mechanism automatically clears IF and TF otherwise there would an infinite
recursion of the single step interrupt.

The TF is set in the flags on the stack so another interrupt will come after one more instruction
is executed after the return of the interrupt.
Leacture 11:

0304-1659294 M. Junaid
23
th
BSCS 4 semester
To get control from the program without the program knowing about it, we can use the IRQ 0
highest priority interrupt that is periodically coming to the processor.
PCB:

The space where all registers of a task are stored is called the process control block or PCB.

INT 08 that is saving and restoring the registers is called the scheduler and the whole event is
called a context switch.

Threads can have function calls, parameters and local variables etc.
How to improve the slowdown in the speed of multitasking:

As keys are pressed and new threads are registered, there is an obvious slowdown in the speed
of multitasking. To improve that, we can change the timer interrupt frequency. The following
can be used to set to an approximately 1ms interval:
mov ax, 1100
out 0x40, al
mov al, ah
out 0x40, al
This makes the threads look faster.
Leacture 12:

The video services are exported via INT 10.

Classification of Video services:


1. graphics mode services and
2. text mode services.

In graphics mode a location in video memory corresponds to a dot on the screen.

In text mode, the video memory holds the ASCII of the character to be shown and the actual
shape is read from a font definition stored elsewhere in memory.

A list of common video services used in text mode.


INT 10 - VIDEO - SET VIDEO MODE
AH = 00h
AL = desired video mode

Some common video modes include 40x25 text mode (mode 0), 80x25 text mode (mode 2),
80x50 text mode (mode 3), and 320x200 graphics mode (mode D).

INT 10 - VIDEO - SET TEXT-MODE CURSOR SHAPE


AH = 01h
CH = cursor start and options

0304-1659294 M. Junaid
24
th
BSCS 4 semester
CL = bottom scan line containing cursor (bits 0-4)

INT 10 - VIDEO - SET CURSOR POSITION


AH = 02h
BH = page number
0-3 in modes 2&3
0-7 in modes 0&1
0 in graphics modes
DH = row (00h is top)
DL = column (00h is left)

INT 10 - VIDEO - SCROLL UP WINDOW


AH = 06h
AL = number of lines by which to scroll up (00h = clear entire window)
BH = attribute used to write blank lines at bottom of window
CH, CL = row, column of window's upper left corner DH,
DL = row, column of window's lower right corner
Leacture 14:
Serial port:

Serial port is a way of communication among two devices just like the parallel port.

Difference b/w parallel and serial ports:

The basic difference is that whole bytes are sent from one place to another in case of parallel
port while the bits are sent one by one on the serial port in a specially formatted fashion.
The serial port connection is a 9pin DB-9 connector with pins assigned as shown below.

The data on the serial port is sent in a standard format called RS232 communication.
Start bit, data bit, parity bit and stop bit:

0304-1659294 M. Junaid
25
th
BSCS 4 semester
The data starts with a 1 bit called the start bit, then five to eight data bits, an optional parity bit,
and one to two 0 bits called stop bits.

The number of data bits, parity bits, and the number of stop bits have to be configured at both
ends. Also, the duration of a bit must be precisely known at both ends called the baud rate of
the communication.

The BIOS INT 14 provides serial port services.

Limitation in using BIOS:

A major limitation in using BIOS is that it does not allows interrupt driven data tra nsfer, i.e. we
are interrupted whenever a byte is ready to be read or a byte can be transferred since the
previous transmission has completed. To achieve this, we have to resort to direct port access.

Important BIOS services regarding the serial port are discussed below:
INT 14 - SERIAL - INITIALIZE PORT
AH = 00h
AL = port parameters
DX = port number (00h-03h)
Return:
AH = line status
AL = modem status

Modem status is not used in direct serial communication.

The port parameters in AL consist of the baud rate, parity scheme, number of stop bits, and
number of data bits.

INT 14 - SERIAL - WRITE CHARACTER TO PORT


AH = 01h
AL = character to write
DX = port number (00h-03h)
Return:
AH bit 7 = error flag
AH bits 6-0 = port status

INT 14 - SERIAL - READ CHARACTER FROM PORT


AH = 02h
DX = port number (00h-03h)
Return:
AH = line status
AL = received character if AH bit 7 clear

0304-1659294 M. Junaid
26
th
BSCS 4 semester
INT 14 - SERIAL - GET PORT STATUS
AH = 03h
DX = port number (00h-03h)
Return:
AH = line status
AL = modem status
Serial port access:
Serial port is also accessible via I/O ports.

COM1 is accessible via ports 3F8-3FF while COM2 is accessible via 2F8-2FF.

The first register at 3F8 (or 2F8 for the other port) is the transmitter holding register if written
to and the receiver buffer register if read from.

3F9 whose bit 0 must be set to enable received data available interrupt and bit 1 must be set to
enable transmitter holding register empty interrupt.

Bit-0 of 3FA is set if an interrupt is pending and its bits 1-3 identify the cause of the interrupt.
The three-bit causes are as follows:
110 (16550, 82510) timeout interrupt pending
101 (82510) timer interrupt
100 (82510) transmit machine
011 receiver line status interrupt. priority=highest
010 received data available register interrupt. priority=second
001 transmitter holding register empty interrupt. priority=third
000 modem status interrupt. priority=fourth

The register at 3FB is line control register while the one at 3FD is line status register.

The register at 3FC is the modem control register. Bit-3 of this register must be set to enable
interrupt generation by the serial port.
Leacture 15:

Protected Mode:

Switching processor in the newer 32-bit mode is a very easy task. Just turn on the least
significant bit of a new register called CR0 (Control Register 0) and the processor switches into
32-bit mode called protected mode. However, manipulations in the protected mode are very
different from those in the read mode.

Extended registers:

All registers in 386 have been extended to 32-bits. The new names are EAX, EBX, ECX, EDX, ESI,
EDI, ESP, EBP, EIP, and EFLAGS. The original names refer to the lower 16-bits of these registers.

0304-1659294 M. Junaid
27
th
BSCS 4 semester
A 32-bit address register can access up to 4GB of memory so memory access has increased a
lot.

Segment selectors:

We call segment registers as segment selectors and they are still 16-bits wide. We are also
given two other segment selectors FS and GS for no specific purpose just like ES.

The working of segment registers as being multiplied by 10 and added into the offset for
obtaining the physical address is totally changed.

Working of segment selector:

Now the selector is just an index into an array of segment descriptors where each descriptor
describes the base, limit, and attributes of a segment.

Role of selector is to select on descriptor from the table of descriptors and the role of
descriptor is to define the actual base address.

For example, an operating system can define the possible descriptors for a program and the
program is bound to select one of them and nothing else. This sentence also hints that the
processor has some sense of programs that can or cannot do certain things like change this
table of descriptors. This is called the privilege level of the program and varies for 0 (highest
privilege) to 3 (lowest privilege).
Format of a selector:
The format of a selector is shown below.

The table index (TI):


TI is set to 0 to access the global table of descriptors called the GDT (Global Descriptor Table).
It is set to 1 to access another table, the local descriptor table (LDT).

RPL:

0304-1659294 M. Junaid
28
th
BSCS 4 semester
RPL is the requested privilege level that ranges from 0-3 and informs what privilege level the
program wants when using this descriptor.
Index:

The 13-bit index is the actual index into the GDT to select the appropriate descriptor. 13 bits
mean that a maximum of 8192 descriptors are possible in the GDT.

GDT:

The GDT itself is an array of descriptors where each descriptor is an 8-byte entry. The base and
limit of GDT is stored in a 48-bit register called the GDTR.

This register is loaded with a special instruction LGDT and is given a memory address from
where the 48-bits are fetched.

The first entry of the GDT must always be zero. It is called the null descriptor. After that any
number of entries up to a maximum of 8191 can follow.
Format of code & data descriptor:

The format of a code and data descriptor is shown below.

0304-1659294 M. Junaid
29
th
BSCS 4 semester
The 32-bit base in both descriptors is scattered into different places because of compatibili ty
reasons.

The limit is stored in 20 bits but the G bit defines that the limit is in terms of bytes of 4K pages
therefore a maximum of 4GB size is possible.

The P bit must be set to signal that this segment is present in memory.

DPL is the descriptor privilege level again related to the protection levels in 386.

D bit defines that this segment is to execute code is 16-bit mode or 32bit mode.
195. is conforming bit.
R signals that the segment is readable.

A bit is automatically set whenever the segment is accessed.

The combination of S (system) and X (executable) tell that the descriptor is a code or a data
descriptor.
B (big) bit tells that if this data segment is used as stack SP or ESP is used.

VESA and VBE:

VESA is the Video Electronics Standards Association and VBE is the set of Video BIOS Extensions
proposed by them. The VESA VBE 2.0 standard includes a linear frame buffer mode. This mode
allows direct access to the whole video memory.

Some important VESA services are listed below:


INT 10 – VESA – Get SuperVGA Information
AX = 4F00h
ES:DI -> buffer for SuperVGA information
Return:
AL = 4Fh if function supported
AH = status
INT 10 – VESA – Get SuperVGA Mode Information
AX = 4F01h
CX = SuperVGA video mode
ES:DI -> 256-byte buffer for mode information
Return:
AL = 4Fh if function supported
AH = status
ES:DI filled if no error
INT 10 – VESA – Set VESA Video Mode
AX = 4F02h
BX = new video mode

0304-1659294 M. Junaid
30
th
BSCS 4 semester
Return:
AL = 4Fh if function supported
AH = status

VESA mode 4117:

One of the VESA defined modes is 4117 which is a 1024x768 mode with 16-bit color and a linear
frame buffer. The 16 color bits for every pixel are organized in 5:6:5 format with 5 bits for red, 6
for green, and 5 for blue. This makes 32 shades of red and blue and 64 shades of green and 64K
total possible colors. The 32-bit linear frame buffer base address is available at offset 28 in the
mode information buffer.
INTERRUPT HANDLING
Handling interrupts in protected mode is also different. Instead of the IVT at physical address 0
there is the IDT (interrupt descriptor table) located at physical address stored in IDTR, a special
purpose register.
IDTR:

The IDTR is also a 48-bit register similar in structure to the GDTR and loaded with another
special instruction LGDT.

The format of the interrupt descriptor is as shown below:

The P and DPL have the same meaning as in data and code descriptors.

The S bit tells that this is a system descriptor while the 1110 following it tells that it is a 386-
interrupt gate.

Past PAPERS

0304-1659294 M. Junaid
31
th
BSCS 4 semester
41.Why memory to memory move is not allow in 8088 processor architecture?

42.following are three INT 13 Disk of Bios write services number against each
service?
1 .get drive perameter
.read disk sector
.write disk sector

43. Difference between the order of parameter passing in pascal and C?

44.In multitasking environment,which process is used to store and restore states


of process

45.which basic system programs are used to stard the computer

46.explain following four lines


1 mov si,l2
mov al,[cs:si]
mov [opcode],al
mov byte [cs:si],0xCC

47.which instructions are used to call subordinate and then get back to the same
point where the function was called? explain these intstruction with help of
example

48.what are the important " command codes" in real header of device drivers?

49. How interrupt handling in protected mode is different than the interrupt
handling in real mode

50. Suppose you desire to work on computer system and you switch on the
computer, identify which service is executed to boot the computer system and
also explain the main responsibilities of the services?

In truncated file service which register read service and file attributes
2.SACS instruction works?
3.which interrupt is called scheduler.which main purpose of that.
4.which interrupt interrupt and control back to dos.write name of interrupt and
service number.
5.serial port intiziltaion service number and also write attributes of it with service
number those initialize them.
6.physical address btna tha

0304-1659294 M. Junaid
32
th
BSCS 4 semester
7.data movment instruction de v thi un ka btna tha k kon sy processor me use hoti
hain.
8.code dia hua tha btna tha k instruction kya kam kr rhi us me.
9.code likhna tha apna name on top of screen show krny ka.
10.code likhna tha aik array ka jis me 128 elements ho har element 4 byte ka ho or
har element ki value 0 ho.
Overall paper bhut easy tha..

0304-1659294 M. Junaid

You might also like