Category : Files from Magazines
Archive   : VOL9N1.ZIP
Filename : INIT87.ASM

Output of file : INIT87.ASM contained in archive : VOL9N1.ZIP
title INIT87.ASM Initialize Numeric Coprocessor
page 55,132

; INIT87.ASM Initialize 80x87 Numeric Coprocessor
; Copyright (C) 1989 Ziff Davis Communications
; PC Magazine * Ray Duncan
; Call with: AX = control word for desired rounding
; mode, precision, exception mask
; Returns: (if coprocessor present)
; Z flag = True (1)
; (if coprocessor not found)
; Z flag = False (0)
; Destroys: nothing

_TEXT segment word public 'CODE'

assume cs:_TEXT

public init87
init87 proc near

push bx ; save registers
push ax

mov ax,-1 ; put FFFFH on stack
push ax
mov bx,sp ; make it addressable

fninit ; try to initialize coprocessor
fnstsw ss:[bx] ; try to get status word

pop ax ; if low 8 bits are zero,
or al,al ; coprocessor is present

jnz initx ; jump if no coprocessor

fldcw ss:[bx+2] ; load coprocessor control word

initx: pop ax ; restore registers
pop bx
ret ; and return result in Z flag

init87 endp

_TEXT ends


  3 Responses to “Category : Files from Magazines
Archive   : VOL9N1.ZIP
Filename : INIT87.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: