Owiti gracie
Owiti gracie

Reputation: 1

Output more than one line in assembler language

My lecturer requires us to write an assembly language code that displays a poem or paragraph. How do I do this? From my knowledge I can only display a single sentence like "hello world".

An example code was this:

.model small
        .stack 100h

CR          equ     13d
LF          equ     10d

            .data
message     db      'Hello World', CR, LF, '$'                 ; note the terminating $ 

            .code
start:      
            mov ax, @data
            mov ds, ax

            mov dx, offset message
            mov     ah, 9           ; subprogram for string output
            int     21h                ; call ms-dos to display string

            mov ax, 4c00h
            int     21h

            end start

Upvotes: 0

Views: 530

Answers (1)

Simone
Simone

Reputation: 11

The "$" is the string ending while CR is Carriage return and LF is Line Feed. Write the entire poem in "message" and put that $ at the end of it.

Upvotes: 1

Related Questions