I got this procedure for drawing a rectangle using int 10h/ah=0Ch to draw each pixel:
proc drawRect ;this function gets the coords of the upper left point of the rect and the height and width, as well as the color of it, and draw
mov cx, [n1] ;n1=x, n2=y, n3=width, n4=height, al=color
mov dx, [n2]
add [n3], cx
add [n4], dx
row:
mov dx, [n2]
column:
mov ah, 0Ch ;draws a pixel on the given color and coords, due to the loops.
mov bh, 0
int 10h
inc dx
cmp dx, [n4]
jbe column
inc cx
cmp cx, [n3]
jbe row
ret
endp drawRect
the problem is that it takes too much time to draw, for example, in order to draw a rectangle 500x500 pixels it takes about 1.5 seconds, which is way too long than I expected. Is there any faster way to draw it?