Aside: Ben's undefined C example
C topics to discuss using those examples
- strings (i.e. char* with trailing null to mark end)
- structs, typedef, malloc and how they work together
- casting types : explicit (i.e. ((int) 1.0) or ((float) 23)) or implicit (i.e. "int i=3.2")
- compiling multiple files into one program
chap 2 - continued
Discuss these ideas using the CMU slides or other sources ...
bitwise operators ; logical operators
& bitwise AND x & y treats x as "bit vector"
| bitwise OR x | y
^ bitwise XOR x ^ y
~ bitwise COMPLEMENT ~ x
&& logical AND treats whole thing as "true" or "false"
|| logical OR
! logical NOT
- little vs big endian - see CMU slides
- The text's show_bytes function - see CMU slides & play around with it on different data
- IEEE floating point - see CMU slides (basic idea at least)
exercises in class
- section 2.2.8 ; practice problems 2.25, 2.26
- practice problem 2.43
The assignment for next Tuesday is posted with both some C coding and exercises from the text.
coming soon - machine assembly
- chapter 3
- see the assembly materials on the resources page
- ... as we head towards the bomb lab