section .data m1 db "Aditya Kelkar",10 ; l1 equ $-m1 m2 db "Roll no:54 ",10 l2 equ $-m2 m3 db "Panel E ",10 l3 equ $-m3 section .bss string resb 50 ;string array of size 50 strl equ $-string count resb 1 _output resb 20 %macro IO 4 ; simple macro , mov rax,%1 ; system call number mov rdi,%2 ; file descriptor mov rsi,%3 ;message mov rdx,%4 ; length syscall %endmacro section .text global _start _start: IO 1,1,m1,l1 ; display input: IO 0,0,string,strl mov [count],rax ;count now points to rax output: IO 1,1,m2,l2 ; display IO 1,1,string,strl IO 1,1,m3,l3 ; display mov rax,[count] ; value of count passed into rax call hex_to_dec IO 1,1,_output,16 exit: mov rax, 60 ; system call for exit mov rdi, 0 ; exit code 0 syscall hex_to_dec: mov rsi,_output+15 ; max size of display mov rcx,2 ; letter2:
To embed this project on your website, copy the following code and paste it into your website's HTML: