Introduction to Microprocessors CS 45 Session 2 Art of Assembly Language Programming 6 Modular Progr - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Introduction to Microprocessors CS 45 Session 2 Art of Assembly Language Programming 6 Modular Progr

Description:

Monolithic programming consumes time and no reusability. Given work can ... Only one copy of procedure in memory. Use stack to save and retrieve return address ... – PowerPoint PPT presentation

Number of Views:306
Avg rating:3.0/5.0
Slides: 8
Provided by: VTU1
Category:

less

Transcript and Presenter's Notes

Title: Introduction to Microprocessors CS 45 Session 2 Art of Assembly Language Programming 6 Modular Progr


1
Introduction to Microprocessors(CS 45)Session
2Art of Assembly Language Programming
6Modular Programming
2
AGENDA
  • Bubble Sort
  • Insertion Sort
  • Modular Programming
  • Procedures
  • Macros
  • Recursion example

3
Modular Programming
  • Monolithic programming consumes time and no
    reusability
  • Given work can be divided into subtasks
  • Each task can be carried out independently and in
    parallel
  • Saves time and cost in the long run
  • Amortizes the cost of developing products

4
Modular Programming in 8086 - 1
  • Can be done using 2 techniques
  • Procedures
  • Macros
  • Procedures
  • Use PROC and ENDP directives
  • Only one copy of procedure in memory
  • Use stack to save and retrieve return address

5
Modular Programming in 8086 - 2
  • Macros
  • Use MACRO and ENDM directives
  • Set of instructions replace the invocation
  • So, multiple copies of macro in memory
  • Sequential flow hence, no stack requirement
  • Bit faster, but they take more memory space

6
Recursion in ALP
  • Lets take the example of factorial
  • 1 if n 0
  • Fact (n)
  • n fact (n-1) otherwise

7
Thank You
Q A
Write a Comment
User Comments (0)
About PowerShow.com