“Hello World ” in 8086 Assembly Language
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.
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, axlea dx, msg
mov ah, 09h
int 21hmov 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, axlea 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 21hmov ah, 4ch
int 21h
end
And, finally these are the lines, that are used to terminate and end the program.