diff --git a/libs/master.lib/dos_free.asm b/libs/master.lib/dos_free.asm new file mode 100644 index 00000000..46762958 --- /dev/null +++ b/libs/master.lib/dos_free.asm @@ -0,0 +1,52 @@ +; master library - MSDOS +; +; Description: +; メインメモリブロックの開放 +; +; Function/Procedures: +; void mem_free( unsigned seg ) ; +; void dos_free( unsigned seg ) ; ※この二つは同じものです +; +; Parameters: +; unsigned seg DOSメモリブロックのセグメント +; +; Returns: +; None +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; MS-DOS +; +; Requiring Resources: +; CPU: 8086 +; DOS: 2.0 or later +; +; Notes: +; AX以外の全レジスタを保存します +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 +; +; Author: +; 恋塚昭彦 +; +; Revision History: +; 93/ 1/31 Initial dosfree.asm(from memalloc.asm) +; 93/ 3/29 があんbugfix + + public DOS_FREE +func MEM_FREE +DOS_FREE label CALLMODEL + push BP + push ES + mov BP,SP + mov ES,[BP+(RETSIZE+2)*2] ; seg + mov AH,49h + int 21h + pop ES + pop BP + ret 2 +endfunc diff --git a/th01_op.asm b/th01_op.asm index 3058a32f..2d9f238c 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -1875,27 +1875,7 @@ include libs/master.lib/file_read.asm include libs/master.lib/file_close.asm include libs/master.lib/file_ropen.asm include libs/master.lib/file_seek.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_1186 proc far - -arg_0 = word ptr 8 - - push bp - push es - mov bp, sp - mov es, [bp+arg_0] - mov ah, 49h - int 21h ; DOS - 2+ - FREE MEMORY - ; ES = segment address of area to be freed - pop es - pop bp - retf 2 -sub_1186 endp - +include libs/master.lib/dos_free.asm ; =============== S U B R O U T I N E ======================================= @@ -15992,7 +15972,7 @@ sub_E3C5 proc far or si, si jz short loc_E3E2 push si - call sub_1186 + call dos_free loc_E3E2: pop si diff --git a/th01_reiiden.asm b/th01_reiiden.asm index 62b4e2ef..9bfa2271 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -1999,27 +1999,7 @@ include libs/master.lib/file_ropen.asm include libs/master.lib/file_write.asm include libs/master.lib/file_create.asm include libs/master.lib/file_seek.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_12D2 proc far - -arg_0 = word ptr 8 - - push bp - push es - mov bp, sp - mov es, [bp+arg_0] - mov ah, 49h - int 21h ; DOS - 2+ - FREE MEMORY - ; ES = segment address of area to be freed - pop es - pop bp - retf 2 -sub_12D2 endp - +include libs/master.lib/dos_free.asm include libs/master.lib/dos_axdx.asm ; =============== S U B R O U T I N E ======================================= @@ -23586,9 +23566,7 @@ sub_11718 proc far or si, si jz short loc_11735 push si - -loc_11730: - call sub_12D2 + call dos_free loc_11735: pop si