Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .DATA
- MSG1 DB "PRINT A HALF PIRAMID UPSIDE DOWN$"
- MSG2 DB 10,13,"ENTER A NUMBER: $"
- R DB ?
- C DB ?
- .CODE
- MAIN PROC
- MOV AX,DATA
- MOV DS,AX
- INT 21H
- ;PRINT MSG1
- MOV AH,9
- MOV DX,OFFSET MSG1
- INT 21H
- ;PRINT MSG2
- MOV AH,9
- MOV DX,OFFSET MSG2
- INT 21H
- ;INPUT TO R
- MOV AH,1
- INT 21H
- SUB AL,30H
- MOV R,AL
- MOV C,AL
- MOV DL,10 ;NEW LINE
- MOV AH,2
- INT 21H
- MOV DL,13 ;CARRIAGE RETURN
- MOV AH,2
- INT 21H
- MOV CL,R
- TOP:
- MOV R,CL
- MOV CL,C
- TOP1:
- MOV DL,42 ;PRINT STAR
- MOV AH,2
- INT 21H
- LOOP TOP1
- MOV DL,10 ;NEW LINE
- MOV AH,2
- INT 21H
- MOV DL,13 ;CARRIAGE RETURN
- MOV AH,2
- INT 21H
- DEC C
- MOV DL,R
- MOV CL,DL
- LOOP TOP
- MOV AH,4CH
- INT 21H
- ENDP
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement