Program in assembly language using Stack | assembly language Programs
This program take a no as input and multiply the no four times using SHL and then half that no using SHR and then swap the four times no and half of that number using stack.
.model small
.stack 100h
.data
message db "enter a no:",'$'
message2 db "after multiply:"
r1 db ?
r2 db ?,'$'
message3 db "after divide:"
r3 db ?
r4 db ?,'$'
message4 db "after swapp"
r5 db ?
r6 db ?
r7 db ?
r8 db ?,'$'
.code
main proc
mov ax,@data
mov ds,ax
mov dx,offset message
mov ah,9
int 21h
xor ax,ax
mov ah,1
int 21h
sub al,48
mov cx,2
mov ah,0
for_1:
shl ax,1
loop for_1
push ax
mov bx,ax
mov dl,10
div dl
add al,30h
add ah,30h
mov r1,al
mov r2,ah
mov dx,offset message2
mov ah,9
int 21h
xor cx,cx
mov cx,1
for_2:
shr bx,1
loop for_2
push bx
mov ax,bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r3,al
mov r4,ah
mov dx,offset message3
mov ah,9
int 21h
pop ax
pop bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r5,al
mov r6,ah
mov ax,bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r7,al
mov r8,ah
mov dx,offset message4
mov ah,9
int 21h
mov ah,4ch
int 21h
main endp
end main
.model small
.stack 100h
.data
message db "enter a no:",'$'
message2 db "after multiply:"
r1 db ?
r2 db ?,'$'
message3 db "after divide:"
r3 db ?
r4 db ?,'$'
message4 db "after swapp"
r5 db ?
r6 db ?
r7 db ?
r8 db ?,'$'
.code
main proc
mov ax,@data
mov ds,ax
mov dx,offset message
mov ah,9
int 21h
xor ax,ax
mov ah,1
int 21h
sub al,48
mov cx,2
mov ah,0
for_1:
shl ax,1
loop for_1
push ax
mov bx,ax
mov dl,10
div dl
add al,30h
add ah,30h
mov r1,al
mov r2,ah
mov dx,offset message2
mov ah,9
int 21h
xor cx,cx
mov cx,1
for_2:
shr bx,1
loop for_2
push bx
mov ax,bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r3,al
mov r4,ah
mov dx,offset message3
mov ah,9
int 21h
pop ax
pop bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r5,al
mov r6,ah
mov ax,bx
mov dl,10
div dl
add al,30h
add ah,30h
mov r7,al
mov r8,ah
mov dx,offset message4
mov ah,9
int 21h
mov ah,4ch
int 21h
main endp
end main
Program In Assembly Language Using Stack >>>>> Download Now
ReplyDelete>>>>> Download Full
Program In Assembly Language Using Stack >>>>> Download LINK
>>>>> Download Now
Program In Assembly Language Using Stack >>>>> Download Full
>>>>> Download LINK
Adobe After Effects 2024 Free Full Version Download For PC >>>>> Download Now
ReplyDelete>>>>> Download Full
Microsoft Adobe illustrator 2024 Free Download Full Version For PC >>>>> Download LINK
>>>>> Download Now
Microsoft Office 2021 Professional Free Download Full Version For PC >>>>> Download Full
>>>>> Download LINK