MuruganAD.Net


To Begin with , A simple "Hello World" program
----------------------------------------
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 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 
endp 
message db "Hello World $"		; Message to be displayed terminating with a $
end main

Generete Executable using Tasm / Tlink 
tasm helloworld.asm
tlink /t helloworld


----------------------------------------
Program  : Write Directly to Video Memory 
FileName : DisplayText.asm
I/P 	 : Nill
O/P 	 : Displays Hello Mem
By       : Murugan AD 
----------------------------------------

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

main proc near
  mov ax,b800h
  mov es,ax
  mov mov ax,offset message 		; offset ofMessage string terminating with $
  mov si,ax                             ; Make Si point to string address
  mov di,0                              ; Make Destination Index point to B800:0000
loop1:
  mov al,[si]				; Read First Character
  mov es:[di],al                        ; Write to Video
  inc si                                ; Point to next character
  inc di
  inc di                                ; Next Display Area
  cmp al,'&'
  jne loop1                             ; if not '$' jump to loop1 				
 
  mov ah,4ch               		; function to terminate
  mov al,00
  int 21h  		   		; Dos Interrupt 
endp 
message db "Hello World $"		; Message to be displayed terminating with a $
end main

Generete Executable using Tasm / Tlink 
tasm displaytext.asm
tlink /t displaytext


HOME ABOUT ME ARTICLES LINKS DOWNLOADS 8086 C++ VC++ SITEMAP INDEX