组合语言作业四.docVIP

  • 1
  • 0
  • 约5.72千字
  • 约 8页
  • 2019-01-11 发布于天津
  • 举报
组合语言作业四.doc

組合語言作業四 專題報告:Using FPU 前言 在微處理器的計算之中,若使用FPU (floating point unit) 指令,相較於普通的指令,一般來說,速度可以快至10 ~ 100倍以上。FPU在486DX以上的機器是和ALU、Control Unit放在同一片Chip之上的;但在8088、286、386、486SX都需要有所謂的x87協同處理器才能處理浮點運算。要詳盡的說明FPU至少需要一本書的內容,本文只對FPU指令做最基本的探討,若要更深入的了解FPU的話,可以參考本文最後的書目。 FPU stack registers 要處理浮點運算,當然需要特別的Register;下圖顯示了FPU的Register set。 FPU DATA REGISTERS TAG 79 78 63 0 1 0 r1 sign exponent Significant r2 r3 r4 r5 r6 r7 r8 15 0 Control Register Status Register Instruction Pointer Data Pointer 其中,最重要的是floating register r1~r8,FPU快速的原因之一是這些register擁有相當大的format (80 bits)。另外,2 bits的TAG有flag的作用,若TAG = 00代表floating registers為valid;TAG = 01代表floating registers contains zero;TAG = 10代表floating registers contains erroneous result;TAG = 11代表floating registers為empty。 Number Format 簡單的說,FPU可以處理相當於C語言中float、double、long、或short等資料型態。底下列出了FPU的各種Format: Data Type BITS Significant Digits Approximate Range (decimal) (decimal) word integer 16 4 -32768 ~ 32768 short integer 32 9 -2*10^9 ~ 2*10^9 long integer 64 18 -9*10^18 ~ 9*10^18 packed decimal 80 18 -99…99 ~ 99…99 (18 digits) short real 32 6-7 1.175*10^-38 ~ 3.403*10^38 long real 64 15-16 2.225*10^308 ~ 1.798*10^308 temporary real 80 19 3.37*10^-4932 ~ 1.19*10^4932 word integer s magnitude 2’s complement 15 0 short integer s magnitude 2’s complement 31 0 long integer s magnitude 2’s complement 63 0 Packed decimal s unused d17~d0 79 72 0 short real s exponent significant 31 23 0 long real s exponent significant 63 52 0 temp real s exponent significant 79 64 0 FPU基本運作 FPU基本上是以一個Stack和外界的memory或register溝通。就如同stack的特性一樣,只有stack的入口可以和外界做load或store的動作。而在st

文档评论(0)

1亿VIP精品文档

相关文档