Assembly Language Programming Tutorial
To run your first program in assembly language using emu 8086 follow the steps below:
.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
.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.
5. You can see the output on the screen.
Previous Post:
Run your first program in assembly language using MASM