Program to print "Hello World" in Assembly Language using emu 8086

Assembly Language Programming Tutorial

Problem:

Write a program that print "Hello World" in Assembly Language.

Solution:

1. Create new file and save it as Hello World.asm

Assembly Basics, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, Programming for beginners, Programming Tutorial, Emu 8086, Assembly Language

2. Copy the following code into that file.

.model tiny                              ;code, data & program in 1 64K segment

.code                                       ;code segment

MAIN PROC
                       
    MOV AH, 09h                    ;function to display a string
    MOV DX, offset message  ;offset of Message string terminated with $

    int 21h                                 ;DOS interrupt
    MOV AH, 4ch                    ;funtion to terminate
    int 21h                                 ;DOS interrupt

ENDP
message db "Hello World $"   ;Message to be displayed terminated with $(indicates end of string)

END MAIN

3. Now compile the program and save the HelloWorld.com file.

Assembly Basics, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, Programming for beginners, Programming Tutorial, Emu 8086, Assembly Language

4. Run it.

5. You can see the output on the screen.

Output:

Assembly Basics, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, Programming for beginners, Programming Tutorial, Emu 8086, Assembly Language

Let me know in the comment section if you have any question.

Previous Post:
Run your first program in assembly language using MASM