8086 hello world program Edit

Murugan Andezuthu Dharmaratnam | 01 September 2020 | 570

One of the first programs you write in any language is a hello world program. But in assembly language the first program you should write is This program when executed does only one thing, which is to return the control back to dos

Check below one of the simplest program in 8086, the hello world application.


;Program  : Hello World Program 
;FileName : Helloworld.asm
;I/P 	 : Nill
;O/P 	 : Displays Hello World 
;By       : Murugan AD 

.model tiny  		  		; com program
.code			  		; code segment
org 100h		  		; code starts at offset 100h	

main proc near
  mov ah,09h		   		; function to display a string 	
  mov dx,offset message 		; offset ofMessage string terminating with $
  int 21h                  		; dos interrupt
  mov ah,4ch               		; function to terminate
  mov al,00
  int 21h  		   		; Dos Interrupt 
message db "Hello World $"		; Message to be displayed terminating with a $
end main