8086 Assembly Program to print different Strings in different lines

Title: 8086 Assembly Program to print String “Hello World, Good Moring, Have Good Day” in 3 different lines

Description: If you have seen your first Hello World ALP, this assembly program prints STRING from .DATA, but in three different lines. So, here we’ll be saving 3 different Strings to .DATA, and then print them one by one. From our first Hello World ALP hope you have understood the use of mnemonics to display the string and the interrupt request.

Same instructions are used here, but repeatedly. This programs for 8086 Assembly Program to print different Strings in different lines.

 

8086 ALP to print string “HELLO WORLD, GOOD MORING, HAVE GOOD DAY” in 3 three different lines:

.MODEL SMALL

.STACK

.DATA

STRING1 DB ‘HELLO WORLD $’                                    ; declaring string

STRING2 DB 10, 13, ‘GOOD MORNING $’               ; declaring string

STRING3 DB 10, 13, ‘HAVE GOOD DAY $’                                ; declaring string

.CODE

MAIN PROC                                                                                        ; main procedure

MOV AX, @DATA                                                             ; initialize the data segment

MOV DS, AX

LEA DX, STRING1                                                              ; loading the effective address

MOV AH, 09H                                                                    ; for string display

INT 21H                                                                                ; dos interrupt function

LEA DX, STRING2                                                              ; loading the effective address

MOV AH, 09H                                                                    ; for string display

INT 21H                                                                                ; dos interrupt function

LEA DX, STRING3                                                              ; loading the effective address

MOV AH, 09H                                                                    ; for string display

INT 21H                                                                                ; dos interrupt function

MOV AX, 4C00H                                                                ; end request

INT 21H

MAIN ENDP                                                                        ; end procedure

END MAIN                                                                                          ; end program

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>