Professional Documents
Culture Documents
CS 354 - Machine Organization Monday, October 24, 2016
CS 354 - Machine Organization Monday, October 24, 2016
Last Time
Cache Parameters and Performance
Coding for Caches
Memory Mountain
Today
Assembly Language Intro
C, Assembly & Machine Code
ISAs
Compiling Steps
Registers
Next Time
Read: B&O 3 Intro, 3.4
Operands and Data Movement Instructions
Assembly
Machine Code
Intel
Assembly Suffix
byte
word
double word
double word
---double word
single precision
double prec
extended prec
Size in Bytes
ISAs
Moores Law
IA-32
x86-64
Compiling Steps
Compiler
Optimizing compilers
1. Preprocessor
2. Compiler
3. Assembler
4. Linker
Compiling Example
C Function
Assembly
int accum = 0;
int sum(int x, int y)
{
AT&T
sum:
pushl %epb
55
movl %esp, %ebp
89
movl 12(%ebp), %eax
8b
addl 8(%ebp), %eax
03
addl %eax, accum
01
popl %ebp
5D
ret
C3
Intel
sum:
push ebp
mov ebp, esp
edx, DWORD PTR [ebp+12]
add eax, DWORD PTR [ebp+8]
add eax, accum
pop ebp
ret
int t = x + y;
accum += t;
return t;
}
mov
Machine
e5
45 0C
45 08
05 -- -- -- --
Registers
What?
Program Counter
General Registers
bit 31
15
87