Computer organization assembly language
Download
1 / 13

Computer Organization & Assembly Language - PowerPoint PPT Presentation


  • 55 Views
  • Uploaded on

Computer Organization & Assembly Language. University of Sargodha, Lahore Campus Prepared by Ali Saeed. Interrupts. Interrupts can be seen as a number of functions. These functions make the programming much easier

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' Computer Organization & Assembly Language' - mimi


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Computer organization assembly language

Computer Organization & Assembly Language

University of Sargodha, Lahore Campus

Prepared by Ali Saeed


Interrupts
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.


Interrupts1
Interrupts

  • 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.


Interrupts2
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


Int 21h
INT 21H

  • INT 21H may be used to invoke a large number of DOS functions

  • A particular number of interrupt in AH register


Int 21h1
INT 21H

  • INT 21H function expect input value in a certain register and return output in a certain register e.g.

  • MOV Ah,1

  • INT 21H

  • Take a character as input and put the ASCII in AL register

  • It will put 0 in AL if non character key is pressed


Int 21h2
INT 21H

  • display the character ’a’ on the screen:

  • mov dl, ‘a‘ ; dl = ‘a‘

  • mov ah, 2h ; character output subprogram

  • int 21h ; call ms-dos output character

  • Student Exercise: Write a code that takes one character input from user, and display 2 times on screen.


Int 21h3
INT 21H

  • String Function

  • AH contain 9

  • Inputs: DX= offset address of string

  • The String must end with $ character

  • E.g

  • Msg DB ‘Hello!$’

  • LEA DX, Msg

  • Mov AH,9

  • INT 21H

  • Output: Hello!


Lea instruction
LEA Instruction

  • Load Effective Address

  • LEA Destination, Source

  • It get offset address of source and put it into destination register

  • E.g

  • LEA DX, Msg

  • Put offset of Msg in DX register


Control function
Control Function

  • DL contain ASCII code of control character

  • INT 21H cause control function to be performed


Student assignment
Student Assignment

  • Multiplication of 3x3 Matrics

  • Dead Line Next Week 1st Class




ad