Top Banner
fodil International Univers WELCOME TO OUR PRESENTATION REPRESENTED BY HIGH 5
23

stack in assembally language

Apr 12, 2017

Download

Education

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: stack in assembally language

Daffodil International University

WELCOME TO OUR PRESENTATION

REPRESENTED BY

“HIGH 5”

Page 2: stack in assembally language

Name :Ms. Nasrin AkterDesignationLecturerDepartmentDepartment of Computer Science and EngineeringFacultyFaculty of Science and Information [email protected]

SUBMITTED TO

Page 3: stack in assembally language

Arafat Rahman----152-15-5983Thofayel Ahmed Khan Shourov-----151-15-5192Nazmul Islam------152-15-5652Taijul Islam---------152-15-5613Mehedi Hassan----161-15-7667

Page 4: stack in assembally language

TOPICS : STACK & INTRODUCTION TO PROCEDURES

Page 5: stack in assembally language
Page 6: stack in assembally language
Page 7: stack in assembally language
Page 8: stack in assembally language
Page 9: stack in assembally language
Page 10: stack in assembally language

The Stack

The stack segment of a program is used for temporary storage of data and addresses. The item are added and removed from one end of the structure, and the processed in a “last-in, first-out”.

Represent an example of a procedure that performs binary multiplication by bit shifting and adding.

Page 11: stack in assembally language

The Stack

Stack instruction are PUSH,POP,PUSHF and POPF There is no effect of stack instructions on flag.

Page 12: stack in assembally language

The stackThe preceding stack declaration, SP.

The stack pointer is initialized to 0100h.

It is empty stack.

When it is not empty, it contains the offset address of the top of the stack.

Page 13: stack in assembally language

Stack Instruction

PUSH source.Source is 16 bit

register.PUSH AL.Sp decreased by 2.

Page 14: stack in assembally language

CODE

Page 15: stack in assembally language

.model small

.stack 100h

.data

main procmov ah,1int 21hpush ax

mov ah,1int 21h push ax

mov ah,1int 21hpush ax mov ah,1int 21hpush ax

mov ah,1int 21hpush ax

mov ah,1int 21hpush axmov ah,1int 21h push ax

mov ah,1int 21hpush ax

mov ah,1int 21hpush ax mov ah,1int 21hpush ax

Page 16: stack in assembally language

pop bx

mov ah,2

mov dl,0dh

int 21h

mov dl,0ah

int 21h

mov dx,bx

int 21h

pop bx

mov ah,2

mov dx,bx

int 21h

pop bx

mov ah,2

mov dx,bx

int 21h

pop bx

mov ah,2

mov dx,bx

int 21h

pop bx

mov ah,2

mov dx,bx

int 21h

pop bx mov ah,2mov dx,bxint 21h

pop bx mov ah,2mov dx,bxint 21h

pop bx mov ah,2mov dx,bxint 21h

pop bx mov ah,2mov dx,bxint 21h

pop bx mov ah,2mov dx,bxint 21h

mov ah,4chint 21h

main endp

Page 17: stack in assembally language
Page 18: stack in assembally language

Push The operation to place a new item at the top of the stack

Page 19: stack in assembally language
Page 20: stack in assembally language

Pop The operation to remove the next item from the top of the stack

Page 21: stack in assembally language
Page 22: stack in assembally language

THANK YOU ALL

Page 23: stack in assembally language