Hello everyone, I am learning 16-bit 8086 assembly(for DOS). I would like to know how to make/draw/display VGA graphics with code, like making a "picture". I googled a lot, but I couldn't find anything to solve my problem. All I need is a code for 16-bit Assembly that draws/displays some colorless shape. It would be greatly appreciated.

MCGA mode 13h is a 320x200 graphics mode capable of displaying 256 different
colors at a time,
to plot pixels in this mode a byte containing a value between 0-255
is written to video ram at segment address A000, the byte's value represents
the corresponding pixel's color on the screen and the position of the
byte in video ram corresponds to its position on the screen.
To convert an xy coordinate into an offset into 320x200 video ram
do: y*320+x
To go into graphics mode 13h:

mov ax, 13h ; AH=0 AL=13 MCGA 320x200 256 color graphics mode
int 10h

To plot a pixel:

mov ax, row
mov bx, column
mov cx, 320
mul cx
add ax, bx
xchg si, ax
mov bx, 0a000h
mov es, bx
mov word [es:si], 9 ; display bright-blue pixel

Here are some tutorials on graphics programming:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.