If you are a beginner in assembly language, running your first program on a 64-bit Windows operating system may be difficult. However, I can help you with this. To begin with, download MASM and DosBox software.
1. MASM
2. DosBox
After that, extract the MASM file into the 'C' drive, which will create a folder named 8086, and then install DosBox.
Once you have completed the installation, open the DosBox application from your desktop screen. You will see two files:
Now, type 'mount c c:\8086' and press Enter, followed by 'c:' and press Enter again. You are now ready to write your first program. Open an editor by typing 'EDIT program_name.ASM', and a new window will appear as shown below where you can write your program:
For example, I have provided a sample program for you to try.
.................................................................................................>
.MODEL SMALL.STACK 100H.DATA
MSG DB 'HELLO!$'.CODE
MAIN PROCMOV AX,@DATA
MOV DS,AXLEA DX,MSG
MOV AH,9INT 21h
MOV AH,4CHINT 21h
MAIN ENDPEND MAIN
....................................................>
You need to save the file with an extension '.asm', such as 'hello.asm.'
Once you have saved the program, exit the editor, and you will be returned to the previous DOSBox window. You should see 'C:>'.
Now you will write the following command:
masm program-name.asm
In our example, I will use the following command:
masm hello.asm
Then press Enter. You will see the following:
Now, press Enter again. You will see the following:
Press Enter again. You will see the following:
If there are any errors or warnings, you will be notified of them, and you need to correct them by typing 'EDIT program_name.ASM.' Once you have fixed the issues, type 'link program_name_without_extension'. In our example, we use the following:
LINK hello
Press Enter. You will see the following:
Finally, type 'program-name.exe' .For our example, it would be: hello.exe
To exit the DOSBox window, type 'exit'.