flat assembler
Message board for the users of flat assembler.

Index > DOS > FPU Interrupt 75h

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 26 Nov 2022, 10:33
I want to test FPU exceptions. The 10h exception works for me. How to make interrupt 75h generated instead of exception 10h?
Code:
        ;
        cli
        in      al,21h
        mov     ah,al
        in      al,$A1
        mov     [PIC],ax
        mov     al,01111001b
        out     21h,al
        mov     al,11001111b
        out     $A1,al
        mov     al,20h
        out     20h,al
        out     $A0,al
        sti
        ;
        mov     eax,cr0
        or      al,CR0_MP
        and     eax,not (CR0_NE+CR0_EM)
        mov     cr0,eax
        ;
        mov     eax,cr4
        and     eax,not (CR4_OSFXSR+CR4_OSXMMEXCPT)
        mov     cr4,eax
        ;
        mov     edx,New
        mov     ecx,cs
        mov     ax,0205h
        mov     bl,75h
        int     31h
        ;
        xor     eax,eax
        out     0xF0,al
        ;
        mov     edx,esp
        push    dword $1332
        fldcw   [esp]
        push    dword 12345678
        push    dword 12345678
        fild    qword [esp]
        fistp   dword [esp]
        fwait
        mov     esp,edx
        ;
        cli
        in      al,21h
        in      al,$A1
        mov     ax,word 0
label PIC word at $-2
        out     21h,al
        out     $A1,al
        mov     al,20h
        out     20h,al
        out     $A0,al
        sti
        ;
        mov     ah,4Ch
        int     21h
        ;
New:    push    eax
        xor     eax,eax
        out     0xF0,al
        mov     al,20h
        out     0xA0,al
        out     0x20,al
        mov     al,'#'
        int     29h
        pop     eax
        iretd    

_________________
smaller is better
Post 26 Nov 2022, 10:33
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 984
Location: Russia
macomics 26 Nov 2022, 16:54
But INT 75h = IRQ 13 = External math coprocessor. Without a separate coprocessor chip, it will not be called. And before switching to protected mode, you reconfigure the PIC to new base vectors. You will receive INT 75h from IRQ 13 only with DOS settings from an external chip.
Post 26 Nov 2022, 16:54
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.