CMPS-2240 Lab-11
x86 inline assembly

Gordon Griesel
Department of Computer and Electrical Engineering and Computer Science
California State University, Bakersfield

Your personal computer: PuTTY and Xming.

Introduction

This lab is about writing x86 inline assembly in a C program.
You will start with a working C program.
Then you will convert some code into x86 assembly code.

inline assembly samples <----from our lecture.


Goals:
Refactor C/C++ code using x86 inline assembly. Modify a small assembly program.

Files Needed: circle.c  showdot.s  Makefile

Path to the files: /home/fac/gordon/public_html/2240/code/lab11

Special instructions: Log into the Odin server like this... ssh -YC username@odin Y = pass X11 graphic information to the client C = attempt to compress the data

Getting started:

Do this first...

   1. Do not run umask 027

   2. Run this instead...

      /home/fac/gordon/p/2240/lab-setup.sh

   3. Continue with the lab.


Do your work in your Odin 2240/b folder.

Copy the files into your 2240/b folder.

Build the program with: make

Run the program with: ./a.out

Assignment steps:

1. Draw a dot at the center of the circles by modifying the showdot.s program.
   
   The showDot function accepts 2 arguments indicating the x and y window
   coordinates of the dot (pixel) to be drawn.

2. Draw one or more circles inside the large yellow circle.
   Convert some or all of the Bresenham algorithm to inline assembly.

   Your new circles will be drawn in function inlineBresenhamCircle().

   Look at the notes in the programs for detailed instructions.

   We will get started together.

These files will be collected...

    /2240/b/circle.c
    /2240/b/showdot.s
    /2240/b/Makefile