source: trunk/minix/lib/ack/i386/em/em_fef4.s@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 13 years ago

Minix 3.1.2a

File size: 827 bytes
Line 
1.sect .text; .sect .rom; .sect .data; .sect .bss
2.define .fef4
3
4 .sect .text
5.fef4:
6 ! this could be simpler, if only the
7 ! fxtract instruction was emulated properly
8 mov bx,sp
9 mov ax,8(bx)
10 and ax,0x7f800000
11 je 1f ! zero exponent
12 shr ax,23
13 sub ax,126
14 mov cx,ax ! exponent in cx
15 mov ax,8(bx)
16 and ax,0x807fffff
17 or ax,0x3f000000 ! load -1 exponent
18 mov bx,4(bx)
19 mov 4(bx),ax
20 mov (bx),cx
21 ret
221: ! we get here on zero exp
23 mov ax,8(bx)
24 and ax,0x007fffff
25 jne 1f ! zero result
26 mov bx,4(bx)
27 mov (bx),ax
28 mov 4(bx),ax
29 ret
301: ! otherwise unnormalized number
31 mov cx,8(bx)
32 and cx,0x807fffff
33 mov dx,cx
34 and cx,0x80000000
35 mov ax,-125
362:
37 test dx,0x800000
38 jne 1f
39 dec ax
40 shl dx,1
41 or dx,cx
42 jmp 2b
431:
44 mov bx,4(bx)
45 mov (bx),ax
46 and dx,0x807fffff
47 or dx,0x3f000000 ! load -1 exponent
48 mov 4(bx),dx
49 ret
Note: See TracBrowser for help on using the repository browser.