Masam is a Microsoft Assembler That is used to assemble Assembly language programs. Assemble codes of your assembly language program cannot be assemble without Command line user interface I mean command prompt or cmd. You have to use Command prompt for assembling your codes. The method of assembling codes and how to run your program after assembling it, is given below.
Steps to follow:
- First of all rename the folder which contains Masm to masm.
- Copy masm folder in C drive so it should be found at c:\masm .
- Then from start menu=> run and type cmd and press enter key to open command prompt.
- Then type following commands below.
- cd\ press enter (this will make your current directory to root directory)
- cd masm press enter (cd : change directory(folder) to one name masm)
- cd bin press enter (change directory to one name is bin this is equivalent to double click on bin folder in windows xp GUI)
- Now if every thing is ok then you must be in bin folder(directory) as you can see c:\masm\bin> in screen shot above.
- Now Type edit prog1.asm press enter here, this will open the cmd text editor, in this editor type the codes of assembly language given below.
;Assembly sample codes to print A on screen
.model small
.stack 100h
.code
main proc
mov dl,65
mov ah,02
int 21h
mov ax,4c00h
int 21h
main endp
end main
- Type the codes in the blue screen given above after that in edit file menu select save to save the program.
- Then from the same file menu select exit to close edit.
- What you have done is you have made a file named prog1.asm. This file contains assembly program codes to print A on screen.
- Then type ml prog1.asm press enter , this command will assemble the codes in file prog1.asm and make an object file and executable(prog1.exe) file.
- The type prog1 press enter. this will run prog1.exe that you have made by ml command.
- All Done, now you can see A on cmd screen as in snapshot above.