Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Hex
;nasm 2.11.08 section .data msg db "Enter 4 digit hex no",10,13 msglen equ $-msg msg1 db "Converted no is:",10,13 msglen1 equ $-msg1 cnt db 0 section .bss num resb 5 rem resb 1 %macro display 2 mov eax,4 mov ebx,1 mov ecx,%1 mov edx,%2 int 80h %endmacro %macro accept 2 mov eax,3 mov ebx,0 mov ecx,%1 mov edx,%2 int 80h %endmacro section .text global _start _start: display msg,msglen accept num,5 mov esi,num call ascii_original mov [num],ebx display msg1,msglen1 mov eax,[num] mov ebx,10 l1: mov edx,0 div ebx push dx inc byte[cnt] cmp ax,0 jnz l1 l2: pop dx add dl,30h mov [rem],dl display rem,1 dec byte[cnt] jnz l2 mov eax,1 mov ebx,0 int 80h ascii_original: mov eax,0 mov ebx,0 mov ecx,4 up1: rol bx,04 mov al,[esi] cmp al,39h jbe down1 sub al,07 down1:sub al,30h add bx,ax inc esi loop up1 ret
run
|
edit
|
history
|
help
0
gfsdfgdgfdgdgfdfgd
arithmetic
p2.asm
Hello
sdfafdsfds
dsfdsffdafdssd
MyFirst Program
lec4bb.asm
index2.asm
intmain2