CSC231 Schedule 2014

From dftwiki3
Jump to: navigation, search
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



 

Week 1 Sept 4    


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.




 


Week 2 Sept 9, 11    


Topics: nasm, memory, db, data and code, hello world. Lab/Hw Reading
  • Tuesday 9/9

  • Finish the lab
  • Submit to Moodle

  • Assembly:
  • 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

  • Thursday 9/11

Reading:




 


Week 3 Sept 16, 18    


Topics: The Mov Instruction Lab/Hw Reading
  • Tuesday 9/16


  • Thursday 9/18





 

Week 4 Sept 23, 25    


Topics: Arithmetic: c = a+b; cycles and GHz Lab/Hw Reading
  • Tuesday, Sept 23

  • 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;

  • Thursday, Oct. 25
Pentium.gif
MultiCore.jpg

int a;
int b;
int c;

a = 3;
b = 5;
c = a + b;
VideoLogo.png


VideoLogo.png
  • 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.




 

Week 5 Sept 30, Oct 2    


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






 

Week 6 Oct 7, 9    


Topics: PC Demolition Lab, Midterm Lab/Hw Reading
  • Tuesday Oct. 7


  • Thursday Oct. 9

  • 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
  • Tuesday, Oct. 21

  • Quiz of the day: What happens when we run the code section below?
           mov  ecx,0
for:    loop    for
  • Using make, and a Makefiles to assemble programs
  • A review of addressing modes:
  • Introduction to Functions and the Stack.

  • Thursday, Oct 23

  • 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.





 

Week 8 Oct 28, 30    


Topics: Passing Parameters Lab/Hw Reading

Tuesday, Oct. 28


  • Passing Parameters
  • 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
  • Tuesday, Nov 4


  • Thursday, Nov 6

  • Factorial, again! It's that important!
  • Class participation
StepsBack.png
  • A few steps back...
  • Jumps, short and long
  • Flag bits: HINZVC
  • A Program using compare instruction and showing flag settings
  • DO NOT PUT INSTRUCTIONS BETWEEN CMP and J##





 

Week 11 Nov 11, 13    


Topics Signed numbers, 2's complement. Lab/Hw Reading
  • Tuesday, Nov 11

  • signed magnitude
  • 1's complement
  • 2's complement
XkcdCan'tSleep.png
http://xkcd.com/571

  • Thursday, Nov 13

  • 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?
  • The CWDE instruction
  • Exercises





 

Week 12 Nov 18, 20    


Topics: Logic Lab Lab/Hw Reading
  • Tuesday, Nov 18


  • Thursday, Nov 20

 





 

Week 13 Nov 25, Thanksgiving    


Topics Logic Lab #2 Lab/Hw Reading
  • Tuesday, Nov 25


Happy Thanksgiving


 





 

Week 14 Dec 2, 4    


Topics Lab/Hw Reading
  • Tusday 12/2
  • Sequential logic with AND and NOT gates

  • Thursday 12/4





 

Week 15 Dec 9, 11    


Topics Lab/Hw Reading
  • Tuesday, 12/9


  • Thursday, 12/11

  • Last details on Floating-Point format.
  • Release of 1-week take-home final exam.



Links & Resources



...