Program in Assembly to Print Triangle | masm 8086

Program in Assembly to Print Triangle | masm 8086

ORG 100H
.MODEL SMALL
.STACK 100H
.DATA

NEWLINE DB 0DH,0AH,’$’ ;NEW LINE

.CODE

FUN PROC

MOV CX,5
MOV BX,5

L1:

MOV CX,BX

L2:
CMP CX,0
JZ EXIT
MOV DL,1
MOV AH,02H
INT 21H

LOOP L2

DEC BX

LEA DX,NEWLINE
MOV AH,09H
INT 21H

LOOP L1

ENDP

EXIT:

MOV AH,4CH
INT 21H
RET

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s