home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FreeWare Collection 3
/
FreeSoftwareCollection3pd199x-jp.img
/
pao
/
ms_dos
/
wild
/
src
/
int24.asm
< prev
next >
Wrap
Assembly Source File
|
1980-01-02
|
4KB
|
176 lines
;==============================================================================
; << MASM V5.1 >> for FM TOWNS
;==============================================================================
page 60,132
name INT24
title INT24 Proc
;==============================================================================
; 致命的エラーハンドリング
;
; CREATE : 1990.12.17
; FINISH : 1990.12.17 V0.50
;
; MSC 用 関数(スモールモデル)
; INT24_init(void) ;
; INT24_release(void) ;
;
; < HISTORY >
; 1990.12.17 : CREATE
;
; All Rights Reserved, Copyright (C) Y.Hirata 1990.
;
; Programed by Y.Hirata ( NIFTY-ID : NAB03321 )
;==============================================================================
;
.MODEL SMALL,C ;
;
;
;********************************************
; データ領域
;********************************************
.DATA ;
;
public INT24errno ;
INT24errno dw ? ; 致命的エラーコード
;
ErrorBlock struc ; 致命的エラー情報
extcode dw ? ; 拡張エラーコード
class db ? ; エラークラス
action db ? ; エラー対処
locus db ? ; エラー発生場所
ErrorBlock ends ;
;
public INT24err ;
INT24err ErrorBlock <> ; 致命的エラー情報格納領域
;
Regs_CX dw ? ; レジスタ退避用
Regs_DX dw ? ; レジスタ退避用
Regs_SI dw ? ; レジスタ退避用
Regs_DI dw ? ; レジスタ退避用
Regs_BP dw ? ; レジスタ退避用
Regs_DS dw ? ; レジスタ退避用
Regs_ES dw ? ; レジスタ退避用
;
;********************************************
; コード領域
;********************************************
.CODE ;
;
COPYRIGHT db 0Dh
db ' ',0Dh,0Ah,07h
db 0Dh,0Ah,' '
db 'INT24 ハンドラー V0.50 1990-12-17',0Dh,0Ah
db 0Dh,0Ah,' '
db 'Copyright (C) Y.Hirata 1990.'
db 0Dh,0Ah,0Dh,0Ah,1Ah
;
TITLE_name db 'INT24 handring'
TITLE_len EQU $-TITLE_name
;
;********************************************
; 定数定義
;********************************************
;
TRUE EQU 1
FALSE EQU 0
;
ZERO EQU 0
;
;********************************************
; データ領域
;********************************************
vct_24h dd far ; 致命的エラー割り込みベクタ
;
;********************************************
; 致命的エラー ハンドラ
;********************************************
int24_abort proc far ;
push ds ;
;
mov ax,@data ; load ds
mov ds,ax ;
mov ax,di ;
and ax,00FFh ; 下位バイトのみ
mov INT24errno,ax ;
;
mov Regs_CX,cx ; レジスタ 退避
mov Regs_DX,dx ;
mov Regs_SI,si ;
mov Regs_DI,di ;
mov Regs_BP,bp ;
mov Regs_DS,ds ;
mov Regs_ES,es ;
;
mov ah,59h ;
mov bx,ZERO ;
int 21h ; 拡張エラーコードの取得
;
mov es,Regs_ES ; レジスタ 復元
mov ds,Regs_DS ;
;
mov dx,bx ;
mov bx,offset INT24err ; 致命的エラー情報格納領域 : [BX]
mov [bx].extcode,ax ; 拡張エラーコード
mov [bx].class,dh ; エラークラス
mov [bx].action,dl ; 可能な対処
mov [bx].locus,ch ; エラー発生場所
;
mov bp,Regs_BP ; レジスタ 復元
mov di,Regs_DI ;
mov si,Regs_SI ;
mov dx,Regs_DX ;
mov cx,Regs_CX ;
;
pop ds ;
mov ax,0003h ; システムコール失敗でリターン
iret ;
int24_abort endp ;
;
;********************************************
; 致命的エラー ハンドラのセット
;********************************************
INT24_init proc ;
push es ;
push ds ;
push dx ;
push bx ;
push cs ;
pop ds ; ds = cs
;
mov ax,3524h ;
int 21h ;
mov WORD ptr cs:vct_24h,bx ;
mov WORD ptr cs:vct_24h+2,es ;
;
mov dx,offset cs:int24_abort ; 致命的エラー ハンドラのベクタセット
mov ax,2524h ;
int 21h ;
;
pop bx ;
pop dx ;
pop ds ;
pop es ;
ret ;
INT24_init endp ;
;
;********************************************
; 致命的エラー ハンドラのリセット
;********************************************
INT24_release proc ;
push ds ;
push dx ;
push cs ;
pop ds ; ds = cs
;
lds dx,DWORD ptr cs:vct_24h ;
mov ax,2524h ;
int 21h ;
;
pop dx ;
pop ds ;
ret ;
INT24_release endp ;
;
end