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
VAR DW 2
.CODE
FUN PROC
MOV CX,1
MOV BX,1
L1:
INC VAR
L2:
CMP CX,11
JE EXIT
MOV DL,1
MOV AH,02H
INT 21H
LOOP L2
ADD CX,VAR
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