%rax %eax %rbx %ebx %rdx %edx %rcx %ecx %rsi %esi %rdi %edi %rbp %ebp %rsp %esp %r8 %r8d %r9 %r9d %r11 %r11d %r10 %r10d %r12 %r12d %r13 %r13d.

Slides:



Advertisements
Similar presentations
Floating Point Unit. Floating Point Unit ( FPU ) There are eight registers, namely ST(0), ST(1), ST(2), …, ST(7). They are maintained as a stack.
Advertisements

University of Washington Procedures and Stacks II The Hardware/Software Interface CSE351 Winter 2013.
Machine/Assembler Language Putting It All Together Noah Mendelsohn Tufts University Web:
Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 5 MIXING C AND ASSEMBLY.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Machine-Level Programming III: Procedures Sept. 17, 2007 IA32 stack discipline Register saving conventions Creating pointers to local variablesx86-64 Argument.
Flow Control Instructions
Machine-Level Programming III: Procedures Sept. 15, 2006 IA32 stack discipline Register saving conventions Creating pointers to local variablesx86-64 Argument.
Recitation: Bomb Lab June 5, 2015 Dipayan Bhattacharya.
64-Bit Architectures Topics 64-bit data New registers and instructions Calling conventions CS 105 “Tour of the Black Holes of Computing!”
INSTRUCTION SET AND ASSEMBLY LANGUAGE PROGRAMMING
Machine-Level Programming: X86-64 Topics Registers Stack Function Calls Local Storage X86-64.ppt CS 105 Tour of Black Holes of Computing.
Carnegie Mellon Recitation: Bomb Lab 21 Sep 2015 Monil Shah, Shelton D’Souza.
Carnegie Mellon 1 Odds and Ends Intro to x86-64 Memory Layout.
Assembly and Bomb Lab : Introduction to Computer Systems Recitation 4: Monday, Sept. 16, 2013 Marjorie Carlson Section A.
AMD64/EM64T – Dyninst & ParadynMarch 17, 2005 The AMD64/EM64T Port of Dyninst and Paradyn Greg Quinn Ray Chen
1 Carnegie Mellon Assembly and Bomb Lab : Introduction to Computer Systems Recitation 4, Sept. 17, 2012.
Chapter 2 Parts of a Computer System. 2.1 PC Hardware: Memory.
X86_64 programming Tutorial #1 CPSC 261. X86_64 An extension of the IA32 (often called x86 – originated in the Intel 8086 processor) instruction set to.
COMP 2003: Assembly Language and Digital Logic Chapter 2: Flags and Instructions Notes by Neil Dickson.
Microprocessors CSE- 341 Dr. Jia Uddin Assistant Professor, CSE, BRAC University Dr. Jia Uddin, CSE, BRAC University.
Introduction to Computer Systems Topics: Assembly Stack discipline Structs/alignment Caching CS 213 S ’12 rec8.pdf “The Class That Gives CMU Its.
Precept 7: Introduction to IA-32 Assembly Language Programming
CPSC 121: Models of Computation
CSC 221 Computer Organization and Assembly Language
Assembly function call convention
Samira Khan University of Virginia Feb 2, 2017
Instruction Set Architecture
Credits and Disclaimers
Credits and Disclaimers
Homework Reading Labs PAL, pp
CSC 221 Computer Organization and Assembly Language
Aaron Miller David Cohen Spring 2011
Assembly IA-32.
Assembly Programming III CSE 410 Winter 2017
Assembly Programming III CSE 351 Spring 2017
# include < stdio.h > v oid main(void) { long NUM1[5]; long SUM; long N; NUM1[0] = 17; NUM1[1] = 3; NUM1[2] =  51; NUM1[3] = 242; NUM1[4] = 113; SUM =
Machine-Level Programming II: Arithmetic & Control
Machine-Level Programming II: Control
Computer Architecture adapted by Jason Fritts then by David Ferry
x86 Programming II CSE 351 Autumn 2016
x86-64 Programming II CSE 351 Autumn 2017
Y86 Processor State Program Registers
Computer Organization and Assembly Language
x86-64 Programming II CSE 351 Winter 2018
Assembly Programming III CSE 351 Spring 2017
Assembly Language: IA-32 Instructions
Instructor: David Ferry
Homework Reading Machine Projects Labs PAL, pp
Machine Level Representation of Programs (IV)
Carnegie Mellon Ithaca College
x86-64 Programming II CSE 351 Summer 2018
x86-64 Programming III CSE 351 Autumn 2018
x86-64 Programming II CSE 351 Autumn 2018
X86 Assembly Review.
Machine-Level Representation of Programs (x86-64)
Machine-Level Programming II: Basics Comp 21000: Introduction to Computer Organization & Systems Instructor: John Barr * Modified slides from the book.
Carnegie Mellon Ithaca College
x86-64 Programming II CSE 351 Winter 2019
Carnegie Mellon Ithaca College
CS201- Lecture 8 IA32 Flow Control
x86-64 Programming III CSE 351 Winter 2019
The von Neumann Machine
Credits and Disclaimers
Credits and Disclaimers
Credits and Disclaimers
Visual Studio x64 C Compiler function entrance code
Computer Architecture and Assembly Language
Computer Architecture and System Programming Laboratory
Presentation transcript:

%rax %eax %rbx %ebx %rdx %edx %rcx %ecx %rsi %esi %rdi %edi %rbp %ebp %rsp %esp %r8 %r8d %r9 %r9d %r11 %r11d %r10 %r10d %r12 %r12d %r13 %r13d %r15 %r15d %r14 %r14d Return Arg 4 Arg 3 Arg 2 Arg 1 Stack ptr Arg 5 Arg 6

TypeSyntaxExampleNotes Constants Start with $ $-42 $0x15213b Don’t mix up decimal and hex Registers Start with % %esi %rax Can store values or addresses Memory Locations Parentheses around a register or an addressing mode (%rbx) 0x1c(%rax) 0x4(%rcx, %rdi, 0x1) Parentheses dereference. Look up addressing modes!

cmpl %r9, %r10 jg If %r10 > %r9, then jump to

InstructionEffectInstructionEffect jmp Always jump ja Jump if above (unsigned >) je/jz Jump if eq / zero jae Jump if above / equal jne/jnz Jump if !eq / !zero jb Jump if below (unsigned <) jg Jump if greater jbe Jump if below / equal jge Jump if greater / eq js Jump if sign bit is 1 (neg) jl Jump if less jns Jump if sign bit is 0 (pos) jle Jump if less / eq

If, jump to addr 0xdeadbeef If, jump to addr 0x15213b If, jump to.

If %r12 >= 0x15213, jump to 0xdeadbeef

If the unsigned value of %rdi is at or above the unsigned value of %rax, jump to 0x15213b.

If %r8 & %r8 is not zero, jump to the address stored in %rsi.