Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS2422 Assembly Language & System Programming November 2, 2006.

Similar presentations


Presentation on theme: "CS2422 Assembly Language & System Programming November 2, 2006."— Presentation transcript:

1 CS2422 Assembly Language & System Programming November 2, 2006

2 Today’s Topics INT (Interrupt). How Does a PC Boot?

3 Study Guide Interrupt: Sections 13.1.3 and 13.1.4. (Advanced) Interrupt Handler: Section 16.4. Boot Process: http://www.pcguide.com/ref/mbsys/bios/boot.htm http://www.pcguide.com/ref/mbsys/bios/boot.htm

4 Interrupt If you call your friend and his/her mom says he/she is not home, what do you do? Do something else, and get interrupted when I/O events happen. May be triggered by hardware or software. INT is also used for system calls (=low- level procedures).

5 Note that we will use the 16-bit mode in the following slides.

6 Examples of INT I/O Put parameters in registers Reference: chapter 8 Example: INT 10 –Function Code in AH –Function 06H = clear Example: Clear Screen MOV AX, 0600 MOV BH, 17 MOV CX, 0000 MOV DX, 184F INT 10

7 Examples of I/O INT Another Example: INT 21H –Function Code in AH –Function 09H = display –Assume the string ‘hello$’ is at DS:200 Example: Display ‘hello’ MOV AH, 09 MOV DX, 200 INT 21H

8 INT Vectors In 000h-3FFh (1KB) For INT 00-FF Each INT uses a 4-byte vector (CS:IP): –2 bytes for IP –2 bytes for CS Actual code (Service Routine) is in CS:IP IRET at the end of INT Service Routine

9 INT Vectors: Example Main proc MOV AX,@data MOV DS, AX … INT 21h Main endp PUSH DX PUSH CX … IPCS …… 0h0h 4h4h 3FFh …… 84h

10 Interrupt Vectoring Process

11 Common Interrupts INT 10h Video Services INT 16h Keyboard Services INT 17h Printer Services INT 1Ah Time of Day INT 1Ch User Timer Interrupt INT 21h MS-DOS Services

12 Boot Process (1) CPU Reset –Blank memory, except ROM –Start running from address FFFF0 (only 16 bytes left!)

13 Boot Process (2) BIOS Boot and POST (Power-On Self Test) –BIOS of other device may be checked too. (e.g., Video) –Flash ROM Upgrade Possible –If booting from hard disk  1 st Sector (MBR) loaded

14 System Boot (3) Master Boot Record (MBR) loaded. –Heard about LILO? –Remember that PC  DOS/Windows OS (e.g., Linux, MS-DOS or Windows) is then loaded. INT Services may be in ROM or set up while loading OS.

15 For Further Information… PC Guide – BIOS System Boot http://www.pcguide.com/ref/mbsys/bios/boot.htm


Download ppt "CS2422 Assembly Language & System Programming November 2, 2006."

Similar presentations


Ads by Google