TA Hours | WHITE
Back to CSC231 Main Page
Prof and TAs
Dominique Thiébaut email
Dept. Computer Science
Ford Hall, 356.
Telephone: 3854
Office hours: M4:30-5:30, T4-5, W1-4.
|
|
To see when and where TAs are available this week, click here.
Weekly Schedule
Topics: Introduction, First Program, Skeleton Program
|
Lab/Hw
|
Reading
|
|
|
- Reading
- Chapter 1 in the Art of Assembly.
- Also Chapter 3, Sections 0 to 3.1.2.
- Sections 1.3.1, 1.3.2, 1.3.3, 1.3.4, and 1.3.5 in Carter's PC Assembly Language. Note, Carter uses 1A92h to represent a hexadecimal number. I prefer 0x1A92.
|
Topics: nasm, memory, db, data and code, hello world.
|
Lab/Hw
|
Reading
|
- Finish the lab
- Submit to Moodle
-
- Review nasm, ld
- Understanding how data fits in memory: printing strings defined by db
- Size of a program: data + code
size helloWorld2
text data bss dec hex filename
34 14 0 48 30 helloWorld2
- Listing of the assembly and its code:
nasm -f elf -l helloWorld2.lst helloWorld2.asm
ls
...
helloWorld2.lst
...
- Observe output of nasm -l (helloWorld2.lst)
- Another way to look at the executable file with hexdump
hexdump -v -C helloWorld2
00000000 7f 45 4c 46 01 01 01 00 ...
...
000002b0 74 61 00 5f 65 6e 64 00 |ta._end.|
000002b8
- Observe the output of hexdump command
|
- Lab #2, due 9/16/14 @ 9:00 a.m.
|
Reading:
|
Topics: The Mov Instruction
|
Lab/Hw
|
Reading
|
|
|
|
Topics: Arithmetic: c = a+b; cycles and GHz
|
Lab/Hw
|
Reading
|
- Alternatives to Beowulf2
- Recommendations: use only instructions seen in class!
- Review: ADD instruction. Others: SUB, INC, DEC. Skip MUL and DIV for right now.
- A quick introduction to calling functions: call and ret
- Printing decimal numbers in assembly
- A first look at what is behind code like this:
int a;
int b;
int c;
a = 3;
b = 5;
c = a + b;
- "Compile" the following statements to assembly:
int a;
int b;
int c;
int d;
a = 3;
b = 5;
c = a*2 + b;
d = (a + b + 10 + 2*c ) * 2 - 20;
int a;
int b;
int c;
a = 3;
b = 5;
c = a + b;
|
|
- Section 4.1 of Paul Carter's ebook presents indirect addressing. Read this first. Read also Section 5.1.3 about more sophisticated indirect addressing modes.
- Addressing modes are covered in Chapter 4 of The Art of Assembly. We won't cover "Displacement Only Addressing" modes (Section 4.6.2.1). Mentally replace 16-bit registers by 32-bit registers when reading this section of Randy Hyde's Art of Assembly. In other words, replace bx by ebx, ax by eax, and so on.
- Logical Operations on Bits (should be a review). Sections 1.5 and 1.6. in Randy Hyde's Art of Assembly.
- The Logical Instructions (AND, OR, NOT, XOR) are covered in Section 6.6.1 of Randy Hyde's Art of Assembly.
- The Loop instruction in Randy Hyde's Art of Assembly.
|
Topics: Logical instructions, addressing modes
|
Lab/Hw
|
Reading
|
Tuesday, Sept 30th
- inherent
- register
- immediate
- direct
- indirect/based/indexed
- indirect with displacement
- base-indexed
- base-indexed with displacement
Thursday, Oct. 2nd
|
|
|
Topics: PC Demolition Lab, Midterm
|
Lab/Hw
|
Reading
|
|
- No homework assignments this week.
|
|
Week 7 Fall Break, Oct 16=Midterm Exam (in class, on paper, closed books, closed computers)
|
|
|
Topics: Functions and the stack
|
Lab/Hw
|
Reading
|
- Quiz of the day: What happens when we run the code section below?
-
- Using make, and a Makefiles to assemble programs
- A review of addressing modes:
- Introduction to Functions and the Stack.
-
- Back to functions and the use of the stack
- Pushing and Popping: when we pop from the stack, the operand is the destination of what's on top of the stack.
- Passing Parameters to a Function
- Passing parameters via registers
|
|
- Procedures and Functions. They are basically the same. Procedure is often used to refer to a function that does not return anything.
- Push and Pop instructions.
- Call and Ret instruction.
- Functions and the topics associated with passing parameters are covered in Carter's Manual on Assembly Language, in Chapter 4, titled Subprograms.
|
Topics: Passing Parameters
|
Lab/Hw
|
Reading
|
Tuesday, Oct. 28
-
- Passing parameters via the stack: we need a new register: EBP!
- Passing by value
- Class Notes (pdf)
- Passing by reference
- Function returning values
- sumProc1.asm: Pass through registers
- sumProc2.asm: Pass by value
Thursday, Oct. 30
- Look at Homework 5
- Continue with the passing of parameters
|
|
- Procedures and Functions. They are basically the same. Procedure is often used to refer to a function that does not return anything.
- Push and Pop instructions.
- Call and Ret instruction.
- Functions and the topics associated with passing parameters are covered in Carter's Manual on Assembly Language, in Chapter 4, titled Subprograms.
|
Week 9 Nov. 4, 6 (Othelia Cromwell)
|
|
|
Topics: Conditional Jumps, Recursion with Factorial
|
Lab/Hw
|
Reading
|
- Factorial, again! It's that important!
- Class participation
-
- Jumps, short and long
- Flag bits: HINZVC
- A Program using compare instruction and showing flag settings
- DO NOT PUT INSTRUCTIONS BETWEEN CMP and J##
|
|
|
Topics Signed numbers, 2's complement.
|
Lab/Hw
|
Reading
|
-
- signed magnitude
- 1's complement
- 2's complement
http://xkcd.com/571
- Continuation of Exercises from last lecture.
- The range of unsigned and signed ints, as byte, words, double words, 64-bit words. See this Microsoft page on C++ for actual ranges
- The NEG and NOT instructions.
- What is the 32-bit equivalent of a 16-bit 2's complement number? What is the rule for bit-extending numbers in 2's complement?
|
|
|
Topics: Logic Lab
|
Lab/Hw
|
Reading
|
|
|
|
Week 13 Nov 25, Thanksgiving
|
|
|
Topics Logic Lab #2
|
Lab/Hw
|
Reading
|
Happy Thanksgiving
|
|
|
Topics
|
Lab/Hw
|
Reading
|
- Sequential logic with AND and NOT gates
|
|
|
Topics
|
Lab/Hw
|
Reading
|
- Last details on Floating-Point format.
- Release of 1-week take-home final exam.
|
|
|
Links & Resources
...