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

1 / 12
About This Presentation
Title:

Introduction to Microprocessors CS 45 Art of Assembly Language Programming 1

Description:

Title - used to give 60 character title to program - Title ... EXIT marks the end of code segment, most of the time we use 4CH function of DOS interrupt 21H ... – PowerPoint PPT presentation

Number of Views:222
Avg rating:3.0/5.0
Slides: 13
Provided by: VTU1
Category:

less

Transcript and Presenter's Notes

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


1
Introduction to Microprocessors(CS 45)Art of
Assembly Language Programming - 1
2
AGENDA
  • Assembler Directives
  • Simple Program
  • TASM version
  • MASM version

3
Assembler Directives
  • Pseudo Instructions that direct assembly process
  • Indicate how an operand is treated and program is
    handled by an Assembler
  • So, Assembler specific
  • Also, indicate how data and programs are arranged
    in memory
  • They do not generate machine code

4
Some Assembler Directives
  • Title - used to give 60 character title to
    program
  • - Title 8086 program to find gcd of 2 bytes
  • MODEL

5
Some Assembler directives..
  • .STACK
  • .stack 100d or .stack 64h default 1024 bytes
  • .DATA
  • DB Define Byte
  • DW Define Word
  • DD Define Doubleword
  • DQ Define Quadword
  • DT Define Ten bytes
  • DUP used to declare an array of bytes

6
Some Assembler Directives
  • .CODE - indicates the beginning of code segment
  • .code name
  • ALIGN aligns the next segment at even address
  • ALIGN 16 aligns data segment at an address
    divisible by 16
  • .EXIT marks the end of code segment, most of
    the time we use 4CH function of DOS interrupt
    21H
  • END label ends the program

7
MASM specific Directives
  • Assume to give symbolic name to a segment
  • Assume cscode, dsdata, ssstack
  • SEGMENT marks the beginning of a segment
  • - data segment, code segment etc
  • ENDS ends a segment
  • code ends, data ends
  • PROC, ENDP MACRO, ENDM directives support
    modularity

8
ALP for GCD
Flow chart showing logic to find gcd of two
numbers
9
ALP for GCD contd..
  • TASM version of the program
  • MASM Version of the program
  • MOV, SUB and CMP instructions
  • Find LCM of those numbers continuing the same
    program
  • Find LCM using addition logic

10
What we studied in this session..
  • Assembler Directives
  • Simple ALP to begin with
  • Some Instructions

11
Probable Questions..
  • What are assembler directives? Explain some of
    them.
  • Write an ALP to find the GCD LCM of two numbers
    (bytes/words).

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