perhaps this is a question that has already been answered. I am trying to create a parallelogram pattern in assembly with hearts, it works but sadly whenever I try to add the spaces between the characters; most of them disappear. I'm thinking that it's because of the CL register or maybe I have overlooked some parts. I have tried different trials and errors to get the expected output. Unfortunately, I am still a beginner in this push-and-pop method so please bear with the comments. Also, this was a code for a right triangle that I've tweaked to become a parallelogram.
I emulated this using TASM-TLINK on DOSBOX.
Here's the code below:
.MODEL TINY
.386
.DATA
.CODE
ORG 100H
BEGIN:
MOV BL,4
MOV CL,4
; * * * *
; * * * *
; * * * * ; THE EXPECTED PATTERN
; * * * *
;PUSH BX
L1:
PUSH CX
MOV AH,2
MOV DL,20H ;INCREMENT SPACES
;SPACE:
;MOV AH,02
;MOV DL,20H
;INT 21H
;LOOP SPACE
;POP CX
L2:
INT 21H
LOOP L2
MOV CL,BL
DEC CL
MOV AH,2 ; PRINT THE CHARACTERS
MOV DL,03H
INT 21H
;MOV AH,02
;MOV DL,20H
;INT 21H
L3:
INT 21H
LOOP L3
MOV AH,2 ; GENERATE NEW LINES
MOV DL,10
INT 21H
MOV DL,13
INT 21H
DEC BH ; DECREMENT BH REGISTER TO TRIM PARALLELOGRAM
;INC BH?
POP CX
;PUSH BX
LOOP L1
EXIT:
MOV AH,4CH
INT 21H
INT 20H
END BEGIN
Thank you to anyone who takes the time to answer this. All good wishes!