CSE 30 Midterm Review

Read, sign, and return your CSE30 Integrity of Scholarship Agreement BRING ID. You will be allowed to bring in an 8.5"x11" sheet of paper with one side filled in, handwritten. No calculators/electronic devices. Read Ch. 6 in textbook Review PA0, PA1, and PA2 Review Quizzes 1, 2, and 3 (and Sample Exercises) Compilation processes/phases cc -> cpp -> ccomp -> as -> ld -> exe (a.out) 5 areas of the C Runtime Environment Text, Data, BSS, Heap, Stack Powers of 2 226 = 220 * 26 = 1M * 64 = 64M 8K = 8 * 1K = 23 * 210 = 213 Concepts of classic sequential von Neumann machine (SISD) CPU, memory, I/O, bus[es] basic execution cycle: IF, ID, OF, EX, ST Logical view of CPU CU, Regs, ALU, internal bus[es] Stack Architecture push, pop, operations performed on operands on the stack Accumulator Architecture load, store, operations performed on ACC and operand Load/Store Architecture load, store, operations performed on operands in registers ARM Architecture Data Types byte, halfword, word, single, double Big Endian vs. Little Endian ASCII (vs. EBCDIC) (vs. Unicode) Number Systems Base conversions (binary/octal/decimal/hexadecimal) Integer representations (signed/unsigned) Signed: sign magnitude/1's complement/2's complement BCD Binary addition with 2's complement subtraction as addition overflow detection condition code bits [N Z V C] ARM Architecture Instruction Set Registers standard convention for their use passing paramters and return values special registers (fp, sp, lr, pc) Basic 3 operand instructions op regdest, regsrc1, regsrc2 or immediate constant Control and branch instructions call, bXX instructions which set condition code bits cmp, adds (vs. add) branching logic using cmp branching logic using other ops (like adds) signed branches, unsigned branches, condition code branches while, do-while, for loops if-then, if-then-else statements Bit-wise operations Boolean logic AND, OR, XOR, NOT [C operators (&, |, ^, ~)] NAND, NOR, XNOR Truth tables Logic gates Bit masks, bit operation identities Swap values without a temporary with xor Bit shifts logical vs. arithmetic shift count range rotates Binary addition half adder full adder The Stack memory alignment restrictions for different data types memory alignment of sp std ARM prologue and epilogue location of fp and sp in stack frame allocating space on the stack for local variables negative offset from fp simple primitive data types (char, short, int, long) local variable internal alignment 1-d arrays, 2-d arrays, 3-d arrays storage map equations (a[i], a[i][j], a[i][j][k]) traversing with a ptr vs. array indexing structures structure padding/internal alignment unions load and store instructions to access memory ldrb/ldrsb/ldrh/ldrsh/ldr/ldrd strb/strh/str/strd Subroutines Basics of parameter passing and return value convention ARM architecture features calling conventions passing first 4 args in r0-r3 additional args on top of caller's stack frame return value in r0 Open vs. Closed vs. Leaf Subroutines Rt.-Lt. Rule Operator Precedence Operator Associativity Order of Evaluation of Operands - 4 C operators that guarantee Lt. to Rt. evaluation of their operands (Sequence guarantee points) non-modifiable lval / modifiable lval / rval The 4 C operators that evaluate to a modifiable lval