Monday, 10 April 2017

Assembly Language : 8086 Assembler Tutorial Part 4

Assembly Language programming : 8086 Assembler Tutorial (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 value
Where 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 256 * 256 = 65536 functions). In general AH register is used, but sometimes other registers maybe in use. Generally other registers are used to pass parameters and data to sub-function.

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.


#MAKE_COM#        ; instruct compiler to make COM file.
ORG    100h

; The sub-function that we are using
; does not modify the AH register on
; return, so we may set it only once.

MOV    AH, 0Eh    ; select sub-function.

; INT 10h / 0Eh sub-function
; receives an ASCII code of the
; character that will be printed
; in AL register.

MOV    AL, 'H'    ; ASCII code: 72
INT    10h        ; print it!

MOV    AL, 'e'    ; ASCII code: 101
INT    10h        ; print it!

MOV    AL, 'l'    ; ASCII code: 108
INT    10h        ; print it!

MOV    AL, 'l'    ; ASCII code: 108
INT    10h        ; print it!

MOV    AL, 'o'    ; ASCII code: 111
INT    10h        ; print it!

MOV    AL, '!'    ; ASCII code: 33
INT    10h        ; print it!

RET               ; returns to operating system.


Copy & paste the above program to Emu8086 source code editor, and press [Compile and Emulate] button. Run it! 







See list of supported interrupts for more information about interrupts. 

 




  emu8086 is better than NASM, MASM or TASM

Tag: assembly language, assembly instruction, assembly programming, assembly code, assembly guide, emu8086, 8086 microprocessors instruction, instruction sets, instruction sets for 8086, instruction complete set, instruction set complete for 8086, assembly language instruction set, complete 8086 instruction sets microprocessors, complete instruction timing and instruction sets for 8086 microprocessors, 8086 Assembler, Tutorial


Assembly Language : 8086 Assembler Tutorial Part 12

Assembly Language : 8086 Assembler Tutorial Part 11

Assembly Language : 8086 Assembler Tutorial Part 10

Assembly Language : 8086 Assembler Tutorial Part 9

Assembly Language : 8086 Assembler Tutorial Part 8

Assembly Language : 8086 Assembler Tutorial Part 7

Assembly Language : 8086 Assembler Tutorial Part 6

Assembly Language : 8086 Assembler Tutorial Part 5

Assembly Language : 8086 Assembler Tutorial Part 4

Assembly Language : 8086 Assembler Tutorial Part 3

Assembly Language : 8086 Assembler Tutorial Part 2

Assembly Language : 8086 Assembler Tutorial Part 1

Assembly Language Programming : Complete 8086 instruction sets

Assembly Language Programming : I/O ports - IN/OUT instructions 

Assembly Language programming : Emu8086 Assembler Compiling and MASM / TASM compatibility

Assembly Language - string convert - Lowercase , Uppercase

for programming : the language of Number

Assembly Language - Complete Instruction Set and Instruction Timing of 8086 microprocessors

Assembly Language programming : A list of emulator supported interrupts

Assembly Language Programming : Emu8086 Overview, Using Emulator, Virtual Drives

Assembly Language Programming : All about Memory - Global Memory Table and Custom Memory Map

buy me  a cup of coffee

My Paypal Account is :  ksw.industries@gmail.com

Send me any small amount of money is welcome.
buy me  a cup of coffee

 ___________________________________________


Need More Detail ?   contact me !!


My Paypal Account is :   ksw.industries@gmail.com
buy me  a cup of coffee
Send me any small amount of money is welcome.

___________________________________________


Don't know how to send money ?   Click here for detail about Paypal account.
About PayPal Payment Methods

What type of PayPal accounts is better.
 


Don't have money? OK! Here is another way to get the program.
how to get my program - Free of charge






No comments:

Post a Comment