16-bit x86 assembly program that plots geometric primitives on screen in video mode 13h.
The project was a part of Systems Programming module.
Each stage was built on top of the previous one. Therefore, a gradual improvement can be seen.
- Bresenham's line drawing algorithm
- Plotting pixels with int 10h,
- coordinates passed using labels and registers.
- Bresenham's line drawing algorithm
- Coordinates passed using stack frame,
- preserving registers' values.
- Bresenham's circle drawing algorithm,
- rectangle drawing algorithm,
- Variables stored using stack frame.
- Bresenham's circle drawing algorithm,
- rectangle drawing algorithm,
- Vitruvian Man,
- ellipse drawing algorithm,
- Plotting pixels by storing bytes directly in VRAM (stosb).
- Circle animation.
- Isosceles triangle.
- Obtuse triangle.
- Using int 15h for delay to achieve animation.
Stage 4++ contains additional features that could not fit in Stage 4 due to the 3.5KB binary size limitation.
- Vitruvian Man,
- load and display a bitmap,
- ellipse,
- animation,
- triangle,
- text in graphics mode,
- mouse interaction,
- custom colour palette.
-
Install Cygwin.
When you get to the 'Select Packages' screen, click on the small icon to the right of 'Devel'. The 'txst' to the right of it should change to 'Install' instead of 'Default'. You can now continue with the rest of the installation process, accepting the rest of the defaults.
Note that Cygwin will take a long time to install, possibly well over an hour, since it pulls all of the tools down over the Internet.
-
Install ImDisk.
-
Install Bochs 2.6.9.
-
In Cygwin, navigate to the project directory and compile with
make
.To access a drive with its letter, use
cd /cygdrive/[drive-letter]
. -
In Bochs, load the
bochsrc.bxrc
file and start the virtual machine.bochsrc.bxrc
is essentially a configuration for the virtual machine, which also points to the correct disk image.
If you intend to use make run
, you need to set the right path in the makefile
.
When you fail to load a bitmap and decide to create your own picture: