Assembly Language Programming Tutorial – 16 – Simple Input and Output

Brought to you by

Rasim from give us another tutorial on Assembly Language Programming . In this tutorial Rasim show us how to use simple input and output. He will show you how to make a program that lets you input a character and then print that character on the screen.

All references in this video came from:

Assembly Language for x86 Processors (6th Edition)



Google Plus:





Muhammad Mustafa says:

Why the name of the video is tutorial LOL.

maybe3392 says:

STRIKE THAT! I figured it out! The character is stored in AL and I was putting AH in the variable instead.


.model small


mov ah,1h
int 21h
inc al
mov dl,al
loop higher

  mov ah,02h
int 21h

This particular piece of code is taking multiple inputs but not giving output and when I pressed enter after inputting data cursor get back to the very first data byte that I have entered and when I tried to move to right data was gone and got message as emu halted.what is error in it?

Dejna4 says:

if i see int 21h i feel fuck you linux only win!. omg i cant find tutorial with nasm and x86 in linux assembly without C.

Nitish Rajoria says:

can u plz explain why did u use .model small and in the previous video u used .model tiny?? and the book which was recommended by u explain these things in a different way like they use a header file for the operation and some more dissimilarities are there..can u plz explain why is it so..

Amer Doule says:


Interpause says:

I made a loop using jmp, it is really amusing seeing it spam strangely

shah badshah says:

sir i want to get values by user to enter user name and password and if its true then show a message welcome and if is not then show an error message so what can i do for this in assembly language ??? Please make a video for this and send me the link for this tutorial thanks

Jerome Reyes says:

I really dont get it why did you use al

Mostafa tarek says:

how to print nums plz

jenina says:

Why on the previous video you used mov ah, 09h and say its the command to display on the screen and here its just INT 21h..?? What happen to the 09h which is the command to display on screen?


May I ask a question please? What IDE are you using in Assembly Language?

kyosuke asakura says:

what is the different .model tiny from your previous and .model small ????

Shyam Vaghela says:

Can I store Interrupts in AL register? for example mov al,4ch instead of mov ah,4ch

Silver Slayer says:

what if we want to input a number not a digit?? how to input a digit ?? al only stores 8 bit memory ……..reply man!

maybe3392 says:

HEY!! This is great! My question is how can you store this value? The number is imputed and immediately spit out. What if I want to use this number and do operations on it? Please let me know if you know how to do this.

Tony Rivera says:

Great video on this subject! If you keep it simple enough for me, I promise you I will learn a lot better and be wiser.  I love this stuff.

The_Ultimate_Wild-Wolf says:

If you got 2 inputs for values how do you add them?

Kiki Karypidou says:

Why do we use the register “ah” ?

Eder s says:

When I run it, it freezes the emulator, it also warns me about something with the stack

Surajit das says:

My lecturer taught us to program in fasm but i love your videos. I think its more clear and so i was using your code in the fasm assembler and actually it works fine. Am i doing something wrong like the code that you wrote, i wrote the same code in fasm as follows:-


org 100h

mov ah,1h

int 21h

mov dl,al
mov ah,2h
int 21h
int 20h

divyanshoo sinha says:

i didn’t understand the code properly especially on line 11,14 and 16, u were too fast . Pls explain in detail like be more clear about it.

Tejas Sontakey says:

why does it save it in the al register

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!