Professional Documents
Culture Documents
MACHINE
PROGRAMMING
011000110101
instructions words
instruction set vocabulary
machine language assembly language
MACHINE VS. HUMAN
03 45 08
LANGUAGE add 0x8(%ebp),%eax
2
Code time Compile time Run time
Disassembler
CODE EXAMPLES
gcc –Og –c example.c objdump –d example.o
gcc –Og –S example.c 4
Program Compiler
Hardwar
Architecture
PROGRAM PERFORMANCE e
CHA 5
P
① System’s state
③
② Instructions
CPU can execute
Instruction
Architecture
Set
Architecture
6
x86 MIPS
INSTRUCTION SET
ARCHITECTURES
PowerPC
7
1968 1985 2016
1978 2005
INTEL
Transistor
29K 275K 250M 7.2B
count
Gordon Moore
Co-founder of Intel
CATEGORIES OF REGISTERS
13
IA32 Integer Registers
%rax %eax %ax accumulate
%r8
al
ax
eax
SUB-REGISTER
Same for rbx, rcx, rdx 15
rsi
sil
si
esi
SUB-REGISTER
Same for rdi, rbp, rsp 16
r8
r8b
r8w
r8d
SUB-REGISTER
Same for r9, r10, r11, r12, r13, r14, r15 17
Instruction Set Architecture
Program Performance
Intel x86 Architecture
x86 Registers
SUMMARY
18