Assembly User Input Example Script

Posted by Suraj Singh on December 22, 2018 · 3 mins read
Hi readers,

Welcome Again To My Blog. I hope You all are Enjoying Latest Series of Assembly Tutorials. So, Today Again I am going To share Another piece of Code Of Assembly language Where I tried To Demonstrate how To Take inputs From User And Print Over Screen.

By The Way, If you Are new And Don't Know How To Start, Compile Or Run?
Then, Don't Follow up Our Previous Blog post. Here, it's The List.

1. Hello World In Assembly
2. Find String Length In Assembly Language
3. Subroutine Demo In Assembly language
4. Some Subroutine Functionality Example

Here, its Another Example

 User Input Taking Example In Assembly Language.

;     UserInput
; author : Suraj SIngh Bisht
; Email :

; Include Other Script
%include 'includable_functions_without_start.asm'
; ====================================================
; [ Includable File]
; Functions:
; _strlen
; _exit
; _print
; _printline
; ====================================================

; bss section
space_user resb 255 ; Reserve 255 Bytes in memory for Userinput

; data section
string0 db "[+] Please enter your name : ", 0h ; message
string1 db "[+] hello, ", 0h ; another string

; text section
global _start ; trigger routine

; start
; print string
mov eax, string0 ; Load String Address
call _print ; call print routine

; Take user input
mov eax, 3 ; invoke SYS_READ
mov ebx, 0 ; STDIN
mov ecx, space_user ; Address To Store
mov edx, 255 ; Address Space Available To Store
int 80h ; kernel interpt

; print another string
mov eax, string1 ; Load String address
call _print ; call print routine

; print user input
mov eax, space_user ; Load string address
call _print ; call print routine

jmp _exit ; exit routine

Please Check Github For Latest Error Free Examples Codes. Click here