“Hello World ” in 8086 Assembly Language

Euhid Aman
2 min readMar 23, 2021

Nowadays, most of us are familiar with various technical languages such as C, C++ , Java or Python. But other than these languages, there is also a low level language called as “Assembly Language”.

It’s designed to make specific processors work.

One of the processors that the Assembly Language can program is Intel’s 8086 microprocessor. It was designed in 1976.

It’s a 16-bit microprocessor, with 20-bit address lines and a 16-bit data bus. And, it also has a memory capacity of 1mb.

Photo by Vishnu Mohanan on Unsplash

So, to make the 8086 microprocessor display “Hello World” on the output screen, the following code is to be written :

.model small

.data
msg db “Hello World !!$”

.code
mov ax, @data
mov ds, ax

lea dx, msg
mov ah, 09h
int 21h

mov ah, 4ch
int 21h
end

Now, I will explain what each part of the code does in summary :

.model small

This tells the assembler to use the small memory model. i.e., for small it’s 1 code segment, and 1 data segment.

.data
msg db “Hello World !!$”

This is the part, that is to be stored in the data segment.

Here, msg which contains “Hello World!!$” is stored. And, db stands for data byte. $ is used to show end of sentence in Assembly Language.

.code
mov ax, @data
mov ds, ax

lea dx, msg

This is the part, that is to be stored in Code Segment.

mov ax, @data
mov ds, ax

These two lines sets DS to point at the data segment.

lea dx, msg

This instructions loads the Effective address of the msg variable to DX.

mov ah, 09h
int 21h

mov ah, 4ch
int 21h
end

And, finally these are the lines, that are used to terminate and end the program.

--

--

Euhid Aman

I am a Computer Science student, who is eager to learn and spread his knowledge in basic and easy terms !!!