msg1 db "Enter 5 64-bit numbers ",10,13
len1 equ $-msg1
msg2 db "Entered 5 64-bit numbers are ",10,13
len2 equ $-msg2
section .bss
array resb 120
count resb 1
section .text
global _start
_start:
;logic to read 5 64-bit numbers
mov bh,05 ; count is in bh
mov rbx,00 ; array index
up: mov rax,00
mov rdi,00
mov rsi,array
add rsi,rbx
mov rdx,17
syscall
add rbx,17
dec byte[count] ; dec count
jnz up ; check count is 0 or not using zero flag i;
mov byte[count],05 ; count is in bh
mov rbx,00 ;array index
up1: mov rax,01
mov rdi,01
mov rsi,array
add rsi,rbx
mov rdx,17
syscall
add rbx,17
dec byte[count] ; dec count
jnz up1 ; check count is 0 or not using zero flag i;
;exit syscall
mov rax, 60
mov rdi,00
syscall
Explain logic of the program
ReplyDelete