Here we are going to write a simple assembly language program to ask an user to type his name and display his name with Welcome greetings.
Sir is told us not to use printf statement of gcc multillib so we are not going to use this printf in this example.
Here is the link of the code https://gist.github.com/1594788
section .data; Declare/store the information “Hello World!”prompt db ‘What is your name? ‘; do not change the order of the following three lines!helloMsg dq ‘Hello ‘name db ‘ ‘ ; space charactersendOfLine db ‘!’; do not change the order of the previous three lines!section .textglobal _start_start:; Output the information ‘What is your name? ‘mov eax, 4 ; write…mov ebx, 1 ; to the standard output (screen/console)…mov ecx, prompt ; the information at memory address promptmov edx, 19 ; 19 bytes (characters) of that informationint 0x80 ; invoke an interrupt; Accept input and store the user’s namemov eax, 3 ; read…mov ebx, 1 ; from the standard input (keyboard/console)…mov ecx, name ; storing at memory location name…mov edx, 23 ; 23 bytes (characters) is ok for my nameint 0x80; Output that information “Hello…”mov eax, 4 ; write…mov ebx, 1 ; to the standard output (screen/console)…mov ecx, helloMsg ; the information at helloMsg…mov edx, 23 ; 23 bytes (characters) is ok for my nameint 0x80; Exitmov eax, 1 ; sys_exitmov ebx, 0 ; exit status. 0 means “normal”, while 1 means “error”int 0x80