i tried a code to accept a character and print the same !
i can accept it with following code but its not working with printing that character
i am a linux nasm user
segment .data msg1: db 'Enter a key',10 msg1len: equ $-msg1 msg2: db 'the key entred is',10 msg2len: equ $-msg2 segment .text global _start _start: mov eax,4 mov ebx,1 mov ecx,msg1 mov edx,msg1len int 80h call getchar call putchar mov eax,1 mov ebx,0 int 80h getchar: pushad pushfd mov eax, 3 mov ebx, 0 mov ecx, esi mov edx, 2 int 80h popfd popad ret putchar: pushad pushfd mov eax,4 mov ebx,1 mov ecx,esi mov edx,2 int 80h popfd popad retthanks in advance :)


Sign In
Create Account

Back to top









