global _start _start: section .text %macro disp_msg 2 mov rax,1 mov rdi,1 mov rsi,%1 mov rdx,%2 syscall %endm ; read %macro read 2 mov rax,0 mov rdi,0 mov rsi,%1 mov rdx,%2 syscall %endm disp_msg msg1,len1 read no1,2 mov al,byte[no1] sub al,30h mov rsi,arr l11:mov bl,[rsi] cmp al,bl je l10 jmp l13 l10:disp_msg msg2,len2 jmp exit l13:inc rsi dec byte[cnt1] jnz l11 l12:disp_msg msg3,len3 exit:mov rax,60 mov rdi,0 syscall display: mov rcx,02h mov rsi,disparr+1 l3:mov rdx,0h mov rbx,10h div rbx cmp dl,09h jbe l4 add dl,07h l4:add dl,30h mov [rsi],dl dec rsi dec rcx jnz l3 disp_msg disparr,2 ret section .data cnt1 db 05h msg1 db "Enter no" len1 equ $-msg1 arr db 01h,02h,03h,04h,05h msg2 db "No is present" len2 equ $-msg2 msg3 db "no not found" len3 equ $-msg3 section .bss no1 resb 50 disparr resb 50 len_no1 resb 50
To embed this project on your website, copy the following code and paste it into your website's HTML: