0% found this document useful (0 votes)
13 views2 pages

Prac 1

The document presents an assembly language program written by Swapnil Suryavanshi to take five user inputs and store them in an array. It includes the code structure, which utilizes system calls to display prompts and entered numbers. The program is designed to run in a Linux environment and handles input and output operations efficiently.

Uploaded by

Paras Kamble
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Prac 1

The document presents an assembly language program written by Swapnil Suryavanshi to take five user inputs and store them in an array. It includes the code structure, which utilizes system calls to display prompts and entered numbers. The program is designed to run in a Linux environment and handles input and output operations efficiently.

Uploaded by

Paras Kamble
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Practical No.

1
Name: Swapnil
Suryavanshi
Roll No: S213074
Div: C
Batch: C2

Problem Statement:-
Write an assembly language program to take 5 inputs as a user and store it in an array and
display entered numbers.

Code:-
%macro disp 2
mov rax,1
mov rdi,1
mov rsi,%1
mov rdx,%2
syscall
%Endmacro

section .bss
arr resb 100
section .data
msg1 db"Enter five no:" ,10
len1 equ $-msg1
msg2 db"Entered no are:" ,10
len2 equ $-msg2
count db 05
section .text
global _start
_start:
mov rbx,00
disp msg1,len1
up:
mov rax,0
mov rdi,0
mov rsi,arr
add rsi,rbx
mov rdx,17
syscall
add rbx,17
dec byte[count]
JNZ up
mov byte[count],05
mov rbx,00
disp msg2,len2
up1:
mov rax,1
mov rdi,1
mov rsi,arr
add rsi,rbx
mov rdx,17
syscall
add rbx,17
dec byte[count]
JNZ up1
mov rax,60
mov rdi,0
syscall

Output:

You might also like