CMPS-2240 Lab-11
x86 inline assembly

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

To work at home, read this article on PuTTY and Xming.

Krystal's xming/putty tutorial

inline assembly help...
IBM doc
GNU
Brennan's guide
IBM with cmp

Get started... Do your work in Odin directory /2240/b/ Refactor a C++ program using x86 inline assembly. Files Needed: Copy all source files. Maybe like this... $ cp /home/fac/gordon/public_html/2240/code/lab11/* . Special instructions: when logging in to the Odin server... ssh username@odin -YC Y = pass X11 graphic information to the client C = attempt to compress the data Build with make run with ./lab11 You should see this...
Assignment Build the lab11.cpp program with the make command. Look at the program code. 1. Choose some code in the following functions... myBresenhamLine show_Bresenham_circle <----required 2. Refactor the code to use inline assembly. Choose one or more lines of code to convert. Choose a line such as: d = 3 - (rad << 1); d += ((x << 2) + 6); d += (((x - y--) << 2) + 10); int ystep = (y1>y0) ? 1 : -1; int yDiff = abs(y1-y0); Choose an if-statement such as: if (err <= 0) { y += ystep; err += xDiff; }
Additional stuff... Modify the code in your show_p_circle function. Make the function display a cardioid inside your inner circle. It will look something like this... Use any colors and resolution you want. For extra points, write some of your cardioid code with inline assembly.
What to turn in Do your work in Odin directory /2240/b/ Files to be collected: lab11.cpp Makefile