Lecture8

Lecture8 - Abhishek Bhattacharjee Topics s Introduction to...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Abhishek Bhattacharjee Topics s Introduction to Assembly Programming c x86 assembly Assembly Programming Rutgers University Abhishek Bhattacharjee 2 Programming Meets Hardware High-Level Language Program Assembly Language Program Machine Language Program movl $1, -8(%ebp) movl $2, -12(%ebp) movl-8(%ebp), %eax movl %eax, -16(%ebp) movl-12(%ebp), %eax movl %eax, -8(%ebp) movl-16(%ebp), %eax movl %eax, -12(%ebp) movl-16(%ebp), %eax movl %eax, 12(%esp) movl-12(%ebp), %eax movl %eax, 8(%esp) movl-8(%ebp), %eax movl %eax, 4(%esp) 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 02 00 03 00 01 00 00 00 f0 82 04 08 34 00 00 00 c4 0c 00 00 00 00 00 00 34 00 #include <stdio.h> int main() { int x, y, temp; x=1; y=2; temp =x; x=y; y=temp; printf("%d %d %d\n",x,y,temp); } ISA Compiler Assembler Rutgers University Abhishek Bhattacharjee 3 P6 Decoder/Interpreter Rutgers University Abhishek Bhattacharjee 4 Assembly Programmer’s View Control Logic (OS code & data) Object Code Program Data Addresses Data Instructions Registers ALU CPU Memory Condition Codes PC Rutgers University Abhishek Bhattacharjee 5 Putting It All Together ALU Control Logic Registers Program Counter (PC) 00101100 10001000 11111111 01010101 01010101 11000001 00000000 11111001 11111000 00110000 00000000 00000000 00000000 11000011 00011001 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Memory Addresses Storage CPU Condition Codes Rutgers University Abhishek Bhattacharjee 6 Putting It All Together ALU Control Logic Registers Program Counter (PC) 00101100 10001000 11111111 01010101 01010101 11000001 00000000 11111001 11111000 00110000 00000000 00000000 00000000 11000011 00011001 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Memory Addresses Storage CPU Condition Codes 1 Rutgers University Abhishek Bhattacharjee 7 Putting It All Together ALU Control Logic Registers Program Counter (PC) 00101100 10001000 11111111 01010101 01010101 11000001 00000000 11111001 11111000 00110000 00000000 00000000 00000000 11000011 00011001 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Memory Addresses Storage CPU Condition Codes 1 1 10001000 Rutgers University Abhishek Bhattacharjee 8 Putting It All Together ALU Control Logic Registers Program Counter (PC) 00101100 10001000 11111111 01010101 01010101 11000001 00000000 11111001 11111000 00110000 00000000 00000000 00000000 11000011 00011001 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Memory Addresses Storage CPU Condition Codes 1 1 10001000 + R0 R1 R0: x R1: y Rutgers University Abhishek Bhattacharjee 9 Putting It All Together ALU Control Logic Registers Program Counter (PC) 00101100 10001000 11111111 01010101 01010101 11000001 00000000 11111001 11111000 00110000 00000000 00000000 00000000 11000011 00011001 00000000 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F Memory Addresses Storage CPU Condition Codes 1 1 10001000 + R0 R1 x y R0: x R1: y Rutgers University Abhishek Bhattacharjee 10 Putting It All Together ALU Control Logic...
View Full Document

  • Fall '08
  • Staff
  • Central processing unit, Processor register, Rutgers University, Addressing mode, Abhishek Bhattacharjee, movl movl movl

{[ snackBarMessage ]}

Page1 / 37

Lecture8 - Abhishek Bhattacharjee Topics s Introduction to...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online