Assembly Language Program To Read A String And Display

Assembly language comment begins with a semicolon (;). It may contain any printable character including blank. It can appear on a line by itself, like −; This program displays a message on screen or, on the same line along with an instruction, like −. Add eax, ebx; adds ebx to eax Assembly Language Statements. We specify the character to be displayed. This is done by storing the character’s ASCII code in a specific 8086 register. In this case we use the dl register, i.e. We use dl to pass a parameter to the output subprogram.

Write an Assembly Language Program to Display a String

Object:

Write an Assembly Language Program to Display a String / Text / Hello World.

Code:

.MODEL SMALL
.STACK 64
.DATA
MSG DB ‘Welcome to codeboks.com’,’$’

.CODE

MAIN PROC FAR

MOV AX,@DATA
MOV DS,AX
CALL D
MOV AH,4CH
INT 21H

MAIN ENDP

D PROC
MOV AH,09
MOV DX,OFFSET MSG
INT 21H
RET
D ENDP
END MAIN