8086 Assembler Tutorial for Beginners (Part 4)
Interrupts Interrupts can be seen as a number of functions. These functions make the programming much easier, instead of writing a code to print a character you can simply call the interrupt and it will do everything for you. There are also interrupt functions that work with disk drive and other hardware. We call such functions software interrupts. Interrupts are also triggered by different hardware, these are called hardware interrupts. Currently we are interested in software interrupts only. To make a software interrupt there is an INT instruction, it has very simple syntax: INT valueWhere value can be a number between 0 to 255 (or 0 to 0FFh), generally we will use hexadecimal numbers. You may think that there are only 256 functions, but that is not correct. Each interrupt may have sub-functions. To specify a sub-function AH register should be set before calling interrupt. Each interrupt may have up to 256 sub-functions (so we get The following example uses INT 10h sub-function 0Eh to type a "Hello!" message. This functions displays a character on the screen, advancing the cursor and scrolling the screen as necessary.
Copy & paste the above program to source code editor, and press [Compile] button. Run it! See list of basic interrupts for information about other interrupts. |