0

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.

Edited by hunhistory: n/a

2
Contributors
1
Reply
3
Views
7 Years
Discussion Span
Last Post by NotNull
0

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:
http://www.bestebooksworld.com/showeBook.asp?link=1251
http://cd.textfiles.com/blackphilesii/PHILES/CODING/GRAPHICS/FILES.BBS
www.algonet.se/~synchron/pheaven2/www/area16.htm

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.