Introduction to Microprocessors CS 45 Art of Assembly Language Programming 5 - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Introduction to Microprocessors CS 45 Art of Assembly Language Programming 5

Description:

Introduction to Microprocessors (CS 45) Art of Assembly Language Programming - 5 ... int 21h ; prints a on CRT. Examples DOS services. Function 07 Character ... – PowerPoint PPT presentation

Number of Views:284
Avg rating:3.0/5.0
Slides: 16
Provided by: VTU1
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Microprocessors CS 45 Art of Assembly Language Programming 5


1
Introduction to Microprocessors(CS 45)Art of
Assembly Language Programming - 5
2
AGENDA
  • BIOS and DOS services
  • ALPs to
  • Find first n Fibonacci numbers
  • Sort given array using bubble sort
  • Check for Palindrome
  • Find whether substring is present in main string

3
BIOS and DOS Services
  • Any program access h/w for the reasons
  • To read characters from the keyboard
  • To display information on CRT
  • To read from, or write to disk
  • To send information to a printer

4
Ways of accessing hardware
  • There are 4 methods as
  • Direct Access
  • Using BIOS services
  • Using DOS services
  • Using high level language service

5
Merits and Demerits
  • Each method has its own merits and demits in
    terms of
  • Portability of programs
  • Thorough knowledge of I/O servics
  • Speed of execution
  • Complexity of programs
  • Functions available

6
Direct Access to Hardware
  • Uses IN and OUT instructions
  • Not portable as I/O ports change
  • Thorough knowledge of I/O devices is needed
  • Access to hardware is faster
  • Gives complete control over the functioning of
    the hardware
  • Not recommended until others methods fail

7
BIOS Services
  • Available as functions on system ROM
  • At FE000H to FFFFFH
  • Can use services using int 10H instruction
  • Generally portable
  • Thorough knowledge of I/O device is not needed
  • Execution speed is nearly same as direct access
  • Mostly display functions

8
DOS Services
  • Collection of procedures present in MSDOS.SYS
  • More easier compared to BIOS
  • Can use these services using int 21H instruction
  • Portable, but should have DOS OS
  • Slower execution speeds as services are present
    on a file
  • Recommended except in places where speed is needed

9
High Level Language Services
  • Makes use of OS services
  • No need of BIOS and DOS services
  • More portable with appr. compilers
  • Easy to write the programs
  • No need to have thorough knowledge of I/O
  • Quite Slower compared to other services
  • Recommended except in place where speed is needed

10
Examples DOS services
Function 01 Character input with echo Inputs
AH 01 Returns AL ASCII value of character
input Sample code mov ah, 01 int 21h
returns ascii value of key pressed
in AL reg.
11
Examples DOS services
Function 02 Display character Inputs AH
02 DL ASCII value of character to be
displayed Returns nothing Sample code mov
ah, 02 mov dl, 41h ASCII value of
a int 21h prints a on CRT
12
Examples DOS services
Function 07 Character input without echo
Inputs AH 07 Returns AL ASCII value of
character input Sample code mov ah, 07 int
21h returns ASCII value of key
pressed in AL reg.
13
Examples DOS services
Function 09 Display string Inputs AH
09 DX offset of string Returns nothing Sampl
e code mov ah, 09 lea dx, str1 staring
offset of str1 int 21h prints str1
on CRT
14
Examples BIOS services
Function 02 set cursor position Inputs AH
02 DH row no. (y coordinate) DL column
no (x coordinate) Returns nothing Sample
code mov ah, 02 mov dh, 40d mov dl,
12d int 10h cursor is placed to
40X12 position
15
Thank You
Q A
Write a Comment
User Comments (0)
About PowerShow.com