64K RAM SYSTEM 38911 BYTES OF STUFF I MADE

ASM Graphics Example

This project was another coursework given by uni, the aim was to write a handful of functions in assembly to draw shapes into video memory.

These we're split into steps, with the first 3 being to:

  1. Draw lines onto the screen using the bresenham line drawing algorithm. 
  2. Use the stack to store variables being passed into the function.
  3. Manipulate video memory directly instead of using the bios interrupt.

You can see my generated image here:

Lines drawn using the Bresenham algorithm.
Lines drawn using the Bresenham algorithm.

Step 4 required me to add a function that would draw circles, and another to draw filled rectangles.

I started on the filled rectangle and did some research into bit manipulation instructions since we were not allowed to just loop x and y coordinates, i solved this by using the "rep" and "storeb" instructions to draw a line before moving to the next line.

For the circle drawing function i used the bresenham circle drawing algorithm, you can see the results here:

Circle drawing algorithm and Filled rect example.
Circle drawing algorithm and Filled rect example.

The final step was to implement a polygon drawing function. For this i added a handful of helper functions that would create a custom array "type" variable in memory that could be stepped through and give the coordinates to draw lines between. These arrays would have a header and footer bytes for error checking and had a function for populating it.

You can see the final image generated here:

Output showing all steps in action.
Output showing all steps in action.

If you would like to see the code for this project let me know in an email.

Tech Used
Info

Date Written:
11/2022