RealArithmetic - Real Arithmetic Real Arithmetic 11.1 Chapter Eleven Chapter Overview This chapter discusses the implementation of oating point

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

View Full Document Right Arrow Icon
Real Arithmetic Beta Draft - Do not distribute © 2001, By Randall Hyde Page 611 Real Arithmetic Chapter Eleven 11.1 Chapter Overview This chapter discusses the implementation of fl oating point arithmetic computation in assembly lan - guage. By the conclusion of this chapter you should be able to translate arithmetic e xpressions and assign - ment statements in v olving fl oating point operands from high le v el languages lik e P ascal and C/C++ into 80x86 assembly language. 11.2 Floating Point Arithmetic When the 8086 CPU fi rst appeared in the late 1970’ s, semiconductor technology w as not to the point where Intel could put fl oating point instructions directly on the 8086 CPU. Therefore, the y de vised a scheme whereby the y could use a second chip to perform the fl oating point calculations – the fl oating point unit (or FPU) 1 . The y released their original fl oating point chip, the 8087, in 1980. This particular FPU w ork ed with the 8086, 8088, 80186, and 80188 CPUs. When Intel introduced the 80286 CPU, the y released a redesigned 80287 FPU chip to accompan y it. Although the 80287 w as compatible with the 80386 CPU, Intel designed a better FPU, the 80387, for use in 80386 systems. The 80486 CPU w as the fi rst Intel CPU to include an on-chip fl oating point unit. Shortly after the release of the 80486, Intel introduced the 80486sx CPU that w as an 80486 without the b uilt-in FPU. T o get fl oating point capabilities on this chip, you had to add an 80487 chip, although the 80487 w as really nothing more than a full-blo wn 80486 which took o v er for the “sx” chip in the system. Intel’ s Pentium chips pro vide a high-performance fl oating point unit directly on the CPU. There is no (Intel) fl oating point coprocessor a v ailable for the Pentium chip. Collecti v ely , we will refer to all these chips as the 80x87 FPU. Gi v en the obsolescence of the 8086, 80286, 8087, 80287, 80387, and 80487 chips, this te xt will concentrate on the Pentium and later chips. There are some dif ferences between the Pentium fl oating point units and the earlier FPUs. If you need to write code that will e x ecute on those earlier machines, you should consult the appropriate Intel documentation for those de vices. 11.2.1 FPU Registers The 80x86 FPUs add 13 re gisters to the 80x86 and later processors: eight fl oating point data re gisters, a control re gister , a status re gister , a tag re gister , an instruction pointer , and a data pointer . The data re gisters are similar to the 80x86’ s general purpose re gister set insof ar as all fl oating point calculations tak e place in these re gisters. The control re gister contains bits that let you decide ho w the FPU handles certain de generate cases lik e rounding of inaccurate computations, it contains bits that control precision, and so on. The status re gister is similar to the 80x86’ s fl ags re gister; it contains the condition code bits and se v eral other fl oating point fl ags that describe the state of the FPU. The tag re gister contains se v eral groups of bits that determine the state of the v alue in each of the eight general purpose re gisters.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/08/2011 for the course CS 101 taught by Professor Jitenderkumarchhabra during the Summer '11 term at National Institute of Technology, Calicut.

Page1 / 36

RealArithmetic - Real Arithmetic Real Arithmetic 11.1 Chapter Eleven Chapter Overview This chapter discusses the implementation of oating point

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

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