I'm trying to set the cursor position and color of a specific pattern in assembly; specifically, the pattern is a parallelogram (once again, haha) and its color is red. I have already tried putting only the block of code for coloring at the start of the pattern, but by putting mov ch,100h yields the result that I am not looking for, what it prints are excess characters which destroyed the shape. The problem must be involving the CH register because I've used it for printing the parallelogram. One solution that I could think of is to loop the cursor start position and coloring as it prints the characters and increments the color register along with it. However, since the parallelogram uses the said register, I might have to store it in a variable. I would like to ask for your thoughts about it. I've done this is in a procedural way, and I am rather a new one for screen processing.
This is developed using TASM/TLINK with DOSBOX as an emulator. This specific parallelogram is part of a logo that I am trying to output in assembly.
Here is an excerpt of my code:
; ============================
LPARALLEL PROC
; CLEAR ALL REGISTERS
xor cx,cx
xor bx,bx
xor ax,ax
mov ah,02h
mov bh,00h
mov dh,9
mov dl,41
int 10h
mov ah,09h
mov cx,10
mov bl,74H
mov dx,30h
int 10h
sub INPUTPL,30h
mov cl,INPUTPL
mov bh,INPUTPL
mov bl,0
mov DIA,bh
mov LBLANK,bl
LP_SPACES:
cmp LBLANK,0
JE PRINT_CHL
mov ah,02h
mov dl,20h
int 21h
dec LBLANK
JMP LP_SPACES
PRINT_CHL:
mov ah,02h
mov dl,04h
int 21h
mov ah,02h
mov dl,20h
int 21h
dec DIA
cmp DIA,0
JNE PRINT_CHL
lea dx,LINE
mov ah,09h
int 21h
inc bh
mov DIA,bh
dec DIA
dec bh
inc bl
mov LBLANK,bl
loop LP_SPACES
RET
LPARALLEL ENDP
; ============================
Thank you to those who will take their time to answer this question, sending all good wishes <3