links - SysPCA

Info

Hilfsmittel SystemProgramming&ComputerArchitecture

none (except assembly cheatsheet)

Exercises

Vorlesung

timestamp 20250916

  • Look at chapters 1,2,4 in textbook (@2025-09-17) never done, but skimmed through during exam prep
    • big/little endian
    • bitwise operations on words
    • cache architectures
    • virtual memory
    • registers
    • adressing modes
    • instruction formats
    • strong typing
    • design-by-contract
    • object-orientation

timestamp 20250917

C-Workflow

// conditionals
if(statement) else
 
switch(integrer) {
	case const_1: sth; break;
	case const_2: sth; break;
	default; break;
}
// functions
return;
// loops
for(initial; test; increment) statement
while(bool_expression) statement
do statement while (bool_expression)
// jumps
break
continue
goto label
// I/O (not part of C)
printf()
// basic types
// - declatations
// - scopes and static
int
float
bool // (just int)
void
const
enum
 
  • int is always 4bytes/32bits
  • float is always 4bytes/32bits
  • double is always 8bytes/64bits -> all other types are different based on the implementation

  • early termination for || and &&, like in CPP

timestamp 2025-09-23

  • C compiler does not check the array bounds
  • multidimensional array: int mat[3][3]
  • string := array of char’s terminatd with null byte

timestamp 2025-10-01

int *p;                   // p is a pointer to int
int *p[13];               // p is an array[13] of pointers to int
int *(p[13]);             // p is an array[13] of pointers to int
int **p;                  // p is a pointer to a pointer to an int
int (*p)[13];             // p is a pointer to an array[13] of int
int *f();                 // f is a function returning a pointer to int
int (*f)();               // f is a pointer to a function returning int
int (*(*f())[13])();      // f is a function returning a pointer to an array[13] of pointers to functions returning int
int (*(*x[3])())[5];      // x is an array[3] of pointers to functions returning pointers to array[5] of ints

timestamp 2025-10-07

summary of chapter 5: 20251007_SPCA_chapter5_dynamicmemory

timestamp 2025-10-12

Always check the return value of malloc!!

timestamp 2025-10-31