HIGH 5
Name :
Ms. Nasrin Akter
Designation
Lecturer
Department
Department of Computer Science and Engineering
Faculty
Faculty of Science and Information Technology
E-mail
nasrin.cse@diu.edu.bd
Thofayel Ahmed Khan Shourov-----151-15-5192
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.
The Stack
Stack instruction are
PUSH,POP,PUSHF and POPF There
is no effect of stack instructions
on flag.
The stack
The 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.
Stack Instruction
PUSH source.
Source is 16 bit
register.
PUSH AL.
Sp decreased by 2.
.model small
.stack 100h
.data
main proc
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
mov ah,1
int 21h
push ax
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,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
mov ah,4ch
int 21h
main endp
Push
 The operation to place a new item at the top of the stack
Pop
 The operation to remove the next item from the top of the stack
stack in assembally language
stack in assembally language
stack in assembally language

stack in assembally language

  • 1.
  • 2.
    Name : Ms. NasrinAkter Designation Lecturer Department Department of Computer Science and Engineering Faculty Faculty of Science and Information Technology E-mail nasrin.cse@diu.edu.bd
  • 3.
    Thofayel Ahmed KhanShourov-----151-15-5192
  • 10.
    The Stack  Thestack 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.
  • 11.
    The Stack Stack instructionare PUSH,POP,PUSHF and POPF There is no effect of stack instructions on flag.
  • 12.
    The stack The precedingstack 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.
  • 13.
    Stack Instruction PUSH source. Sourceis 16 bit register. PUSH AL. Sp decreased by 2.
  • 15.
    .model small .stack 100h .data mainproc mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax mov ah,1 int 21h push ax
  • 16.
    pop bx mov ah,2 movdl,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,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 mov ah,4ch int 21h main endp
  • 18.
    Push  The operationto place a new item at the top of the stack
  • 20.
    Pop  The operationto remove the next item from the top of the stack