CSSE 232 Computer Architecture I
Running a Program
1 / 15
CSSE 232 Computer Architecture I Running a Program 1 / 15 Class - - PowerPoint PPT Presentation
CSSE 232 Computer Architecture I Running a Program 1 / 15 Class Status Reading for today 2.12, 2.13, 2.14, B.1-5 2 / 15 Outline Compilers Assemblers Linkers Loaders 3 / 15 Translation and Startup in C C program
1 / 15
Reading for today
2 / 15
3 / 15
Loader C program Compiler Assembly language program Assembler Object: Machine language module Object: Library routine (machine language) Linker Memory Executable: Machine language program
4 / 15
A program (set of programs) that transforms high level source code written within a programming language (such as C) to assembly
5 / 15
programming language (1952)
was for the Lisp (1962)
another compiler (bootstrapping problem)
6 / 15
Construction!
7 / 15
equivalents (object file)
move $t0, $t1 → add $t0, $zero, $t1 blt $t0, $t1, L → slt $at, $t0, $t1 bne $at, $zero, L
8 / 15
9 / 15
branches and jumps
unresolved references
10 / 15
referenced libraries
11 / 15
1 Read header to determine segment sizes 2 Create virtual address space 3 Copy text and initialized data into memory
4 Set up arguments on stack 5 Initialize registers (including $sp, $fp, $gp) 6 Jump to startup routine
12 / 15
13 / 15
Demo of compiling, assembling, and linking
14 / 15
Project details on website
15 / 15