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.

Slides:



Advertisements
Similar presentations
Jump Condition.
Advertisements

Copyright © 2000, Daniel W. Lewis. All Rights Reserved. CHAPTER 5 MIXING C AND ASSEMBLY.
%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.
Web siteWeb site ExamplesExamples Irvine, Kip R. Assembly Language for Intel-Based Computers, Conditional Loop Instructions LOOPZ and LOOPE LOOPNZ.
ACOE2511 Assembly Language Arithmetic and Logic Instructions.
Computer Organization And Assembly Language
Pipeline Enhancements for the Y86 Architecture
Assembly Language for Intel-Based Computers, 4 th Edition Chapter 6: Conditional Processing (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers Chapter 5: Procedures Kip R. Irvine.
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
Assembly Language for Intel-Based Computers
Accessing parameters from the stack and calling functions.
CS2422 Assembly Language and System Programming Conditional Processing Department of Computer Science National Tsing Hua University.
Flow Control Instructions
87 examples. Getting sqrt call readint fstcw control;;;store current control word or control,0800h;set bit 11 clear bit 10 to round up fldcw control;;load.
Conditional Processing If … then … else While … do; Repeat … until.
CS2422 Assembly Language & System Programming October 19, 2006.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
Y86 Processor State Program Registers
Hello ASM World: A Painless and Contextual Introduction to x86 Assembly rogueclown DerbyCon 3.0 September 28, 2013.
Carnegie Mellon Recitation: Bomb Lab 21 Sep 2015 Monil Shah, Shelton D’Souza.
Assembly Programming Practical 3. Jump statements Simplest form of Jump statement Simplest form of Jump statement –“jmp Label” Can be used to end a Loop.
Assembly Language for Intel-Based Computers, 6 th Edition Chapter 6: Conditional Processing (c) Pearson Education, All rights reserved. You may modify.
5. Assembly Language. Basics of AL Program data Pseudo-ops Array Program structures Data, stack, code segments.
1 ICS 51 Introductory Computer Organization Fall 2009.
Decision Structures – Code Generation Lecture 24 Mon, Apr 18, 2005.
26-Nov-15 (1) CSC Computer Organization Lecture 6: Pentium IA-32.
Computer Architecture and Operating Systems CS 3230 :Assembly Section Lecture 5 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
Assembly and Bomb Lab : Introduction to Computer Systems Recitation 4: Monday, Sept. 16, 2013 Marjorie Carlson Section A.
Assembly Language. Symbol Table Variables.DATA var DW 0 sum DD 0 array TIMES 10 DW 0 message DB ’ Welcome ’,0 char1 DB ? Symbol Table Name Offset var.
Compiler Construction Code Generation Activation Records
October 1, 2003Serguei A. Mokhov, 1 SOEN228, Winter 2003 Revision 1.2 Date: October 25, 2003.
Conditional Loop Instructions, Conditional Structures
COMP 2003: Assembly Language and Digital Logic Chapter 2: Flags and Instructions Notes by Neil Dickson.
Assembly 06. Outline cmp (review) Jump commands test mnemonic bt mnemonic Addressing 1.
CSC 221 Computer Organization and Assembly Language Lecture 16: Procedures.
Carnegie Mellon Midterm Review : Introduction to Computer Systems October 15, 2012 Instructor:
CSC 221 Computer Organization and Assembly Language Lecture 20: Conditional and Block Structures.
Jumps, Loops and Branching. Unconditional Jumps Transfer the control flow of the program to a specified instruction, other than the next instruction in.
Assembly Language Wei Gao. Assembler language Instructions.
Assembly Language for Intel-Based Computers, 4 th Edition Lecture 22: Conditional Loops (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers, 4 th Edition Week 10: Conditional Processing Slides modified by Dr. Osama Younes.
Subword Parallellism Graphics and audio applications can take advantage of performing simultaneous operations on short vectors – Example: 128-bit adder:
Assembly Language Addressing Modes. Introduction CISC processors usually supports more addressing modes than RISC processors. –RISC processors use the.
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
CSC 221 Computer Organization and Assembly Language
Recitation 3: Procedures and the Stack
Assembly Language for Intel-Based Computers, 5th Edition
Homework Reading Labs PAL, pp
CSC 221 Computer Organization and Assembly Language
Aaron Miller David Cohen Spring 2011
Assembly IA-32.
Assembly Language Programming Part 2
# 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 =
asum.ys A Y86 Programming Example
Y86 Processor State Program Registers
Computer Organization and Assembly Language
Assembly Language for Intel-Based Computers, 5th Edition
فصل پنجم انشعاب و حلقه.
Using the 80x87 Math Chip in Assembly
Fundamentals of Computer Organisation & Architecture
Homework Reading Machine Projects Labs PAL, pp
Flow Control Instructions
Computer Organization and Assembly Languages Yung-Yu Chuang 2005/12/22
X86 Assembly Review.
Computer Architecture and System Programming Laboratory
Credits and Disclaimers
Computer Architecture and Assembly Language
Presentation transcript:

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.

Floating Point Unit ( FPU ) The top element of the stack is always named as ST(0). For example,.data v1REAL v2REAL8 6.3 v3REAL8 7.9.code finit fld v1 fld v2 fld v3 finit finitfinitfinit fld v1fld v1fld v1fld v1 fld v2fld v2fld v2fld v2 fld v3fld v3fld v3fld v ST(0) ST(1) ST(0) ST(1) ST(2)

Generate a series: 1, 2, 3, 4, …, (1) S n+1 = S n + 1 (2) S 1 = 1 Store the elements in an array. We need to initialize the first element and then apply (1)..data v REAL8100 DUP(?) ONEREAL81.0 numDWORD10.code mov edi, 0 finit fld ONE fst v[edi] mov ecx, num dec ecx cmp ecx, 0;signed jle Ldone L1: finit fld ONE fld v[edi] fadd ST(0), ST(1) add edi, 8 fst v[edi] loop L1 Ldone:

Generate Fibonacci series (numbers) (1) S n+2 = S n+1 + S n (2) S 0 = 1, S 1 = 1 (seed values) Generate the first m numbers.

Generate Fibonacci series (numbers) (1) S n+2 = S n+1 + S n (2) S 0 = 0, S 1 = 1 (seed values) Generate the first m numbers..code SREAL80.0, 1.0, 100 DUP(?) mDWORD10.code mov edi, 2*8 mov esi, 0 mov ecx, m sub ecx, 2 cmp ecx, 0 jle Ldone;signed L1: finit fld S[esi] fld S[esi+8] fadd ST(0), ST(1) fst S[edi] add edi, 8 add esi, 8 loop L1 Ldone:

Conditional jumps cmp eax, a ja L1; eax> a; unsigned comparison jb L1; eax < a jae L1; eax >= a je L1; eax == a jl, jg; signed comparison