Run your first program in assembly language using MASM

Assembly Language Programming Tutorial

Run your first program in assembly language using MASM and DosBox by follwoing the steps below:

First of all download
  1. MASM 
  2. DosBox
from drive and follow the following steps:
1. Install DosBox directly into your C Drive.
2. Extract files from MASM folder, it will contains multiple exe files. Place this folder into your C drive and rename it to 8086.
3. Run DosBox and write the following:

mount c c:\8086

4. Create a file with .asm extension e.g. hello.asm using notepad in 8086 folder.
5. Copy the following code into that file and save that file.

dosseg
.MODEL SMALL

.STACK 100H

.DATA
MSG DB 'HELLO!$'

.CODE
MAIN PROC
MOV AX, @DATA
MOV DS, AX
LEA DX, MSG
MOV AH,9

INT 21h
MOV AH,4CH
INT 21h

MAIN ENDP
END MAIN

6. Now in the running DosBox, run the following commands:

masm hello.asm

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

if there are any errors, remove those errors. After that, type

link hello

Assembly Basics, Assembly Language, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, MASM, Programming for beginners, Programming Tutorial
and press enter, and then type,

hello.exe

Assembly Basics, Assembly Language, Coding for beginners, Coding tutorial, Computer Science, Learn Coding, Learn programming, MASM, Programming for beginners, Programming Tutorial
and you can see the output.

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

Previous Post:
Run your first program with asp.net C#