8086 Assembly Program to Display String ‘hello’

data segment
msg1 db 'hello'
data ends

code segment
assume cs:code,ds:data
mov ax,data
mov ds,ax
mov sp,0d000h
mov bx,offset msg1
mov cx,0005h
mov ah,02h
mov dl,[bx]
int 21h
inc bx
dec cx
jnz move
mov ax,4c00h
int 21h
int 3
code ends
end start


C:\TASM>masm an_hello.asm
Microsoft (R) Macro Assembler Version 5.00
Copyright (C) Microsoft Corp 1981-1985, 1987.  All rights reserved.

Object filename [an_hello.OBJ]:
Source listing  [NUL.LST]:
Cross-reference [NUL.CRF]:

  50318 + 450338 Bytes symbol space free

      0 Warning Errors
      0 Severe  Errors

C:\TASM>link an_hello.obj

Microsoft (R) Overlay Linker  Version 3.60
Copyright (C) Microsoft Corp 1983-1987.  All rights reserved.

Run File [AN_HELLO.EXE]:
List File [NUL.MAP]:
Libraries [.LIB]:
LINK : warning L4021: no stack segment

C:\TASM>debug an_hello.exe
Program terminated normally

One thought on “8086 Assembly Program to Display String ‘hello’”

  1. I don’t why this stuff has to be so difficult, Everyone writes different and difficult codes, I think I will never understand this. I think I have to start from very Basic.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.