6.828: PC Hardware and x86: Frans Kaashoek Kaashoek@mit - Edu
6.828: PC Hardware and x86: Frans Kaashoek Kaashoek@mit - Edu
6.828: PC Hardware and x86: Frans Kaashoek Kaashoek@mit - Edu
Frans Kaashoek
kaashoek@mit.edu
A PC
• PC architecture
• x86 instruction set
Illustrate a few
• gcc calling big CS ideas
conventions
• PC emulation
PC board
Abstract model
Central Main
Input/Output Processing Memory
Unit
instruction 232-1
instruction
instruction
data
data
data 0
Epilogue:
movl %ebp, %esp
popl %ebp
Callee saved
– Note that %ebp isn’t strictly necessary, but we
compile JOS and xv6 this way for convenience of
walking up the stack.
Example
From C to running program
gcc gas
.c .asm .o
loader
memory
ld a.out
gcc gas
.c .asm .o