2007 CS 301 - Assembly Language
|Meets MWF 3:30-4:30 PM
Room 106 Chapman Building
University of Alaska Fairbanks
3.0 Credits, Fall 2007
Prerequisite: CS 201 (Programming)
|Instructor: Dr. O. Lawlor|
Office: 210C Chapman
Office Hours: 11:15-noon TR (plus!)
- Final exam and overall course grades are posted on NetRun. I have chosen not to use +/- grades this semester. I was pretty happy about the final--you guys really have learned assembly! A few notes:
- Three fingers represent eight values (2 cubed), but only if you remember that all-fingers-down is a value (zero).
- Loading a float from memory onto the floating-point register stack is just fld DWORD [a]. Very few folks remembered this!
- SSE stands for "Streaming SIMD (Single Instruction Multiple Data) Extensions", but what SSE *is* is just a set of instructions for operating on 4 floats at once.
- The biggest "ordinary" float is 2^127*1.999999..., or almost exactly 2^128. If you square this, a float can't store the square, so it stores "inf" ("infinity"). If you subtract *this* from itself, you're asking about infinity-infinity, so the hardware gives up and stores "nan" (Not-A-Number). Try it out!.
- The best way in assembly to allocate an array to return is on the heap, with "malloc". If you allocate space on the stack, and then return it, somebody's very likely to reuse that stack space, overwriting your values.
- x86_64: Cheat Sheet.
- x86: Cheat Sheet. The Intel Software
Developer's Manuals are incredibly long, boring, and complete--they
give all the nitty-gritty details. Volume
1 lists the processor registers in Section 3.4.1.
lists all the x86 instructions in Section 3.2. Volume 3 gives the performance monitoring registers. There's also a good Pentium 4 Microarchitecture Whitepaper from the Intel Tehnology Journal. For Linux, the System V ABI gives the calling convention on page 39. Also see the Intel hall of
fame for historical info.
- PowerPC: Cheat Sheet.
- Free C/C++ compilers:
- On Windows, Microsoft Visual C++ is the standard compiler.
The Chapman lab has Visual C++ 2003. Visual C++ 2005 "Express Edition" is
free for download
directly from Microsoft (400MB), or you can use this local CD copy (400MB), and I did
promise four folks CD-Rs in class on Monday! (This only gets you standard C++;
to write Windows code you also need the platform
- Code::blocks is a free,
downloadable Windows IDE based on gcc.
- For Mac OS X machines, Apple's Xcode is the
usual IDE. It's free from Apple.
- For Linux or other UNIX machines, you should either already have gcc/g++ installed, or else it should be easy to
install from your distribution.
O. Lawlor, firstname.lastname@example.org
Up to: Class Site, CS, UAF