Tag: triangle

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
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