So, I am working on graphics in masm 8086, I wrote something that can display a letter ‘D’ on the screen however it is small, I tried to raise size of my array but then I tried setting the coordinates however it kept distorting my ‘D’ and it still wasn’t being drawn properly (largely) so i was wondering if anyone can help me? I am new to graphics, and would appreciate any insight.
`.model small
.stack 0100h
.data
; Define colors
Hert db 04,04,04,04,00,00,00,00,00 ; Define top half of ‘D’
db 04,00,00,00,04,00,00,00,00
db 04,00,00,00,04,00,00,00,00
db 04,00,00,00,04,00,00,00,00
db 04,00,00,00,04,00,00,00,00
db 04,04,04,04,00,00,00,00,00 ; Define bottom half of ‘D’
; Coordinate definitions for drawing
xi dw 0
xf dw 0
yi dw 0
yf dw 0
.code
main proc
; Initialize DS to point to the data segment
mov ax, @data
mov ds, ax
; Set video mode to 320x200, 256 colors
mov al, 13h
mov ah, 00h
int 10H
; Set coordinates for drawing the 'D'
mov si, offset Hert
mov yi, 30
mov yf, 36
mov xi, 30
mov xf, 39
call draw
; Exit program
mov ah, 04ch
int 21h
main endp
; Draw procedure to plot the ‘D’ on screen
draw proc
mov ah, 0ch ; Function to plot pixel
mov dx, yi ; Y coordinate start
y:
mov cx, xi ; X coordinate start
x:
mov al, [si] ; Get pixel color value
int 10h ; Draw pixel
inc si ; Move to next pixel in data
inc cx ; Increment X coordinate
cmp cx, xf ; Check if end of X reached
jb x
inc dx ; Move to next line in Y
cmp dx, yf ; Check if end of Y reached
jb y
ret
draw endp
end
`
I tried tweaking the coordinates but that wasn’t very useful, I also tried to increase the size of my array but to no avail.