[Reduction] #483: dos_free

OK. I'm going to spend one day on TH01 alone, and if that doesn't end up
shredding the code significantly, I'm not going to cover that game.
This commit is contained in:
nmlgc 2014-09-07 15:21:23 +02:00
parent 23a3a4116a
commit 61a0a024e2
3 changed files with 56 additions and 46 deletions

View File

@ -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

View File

@ -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

View File

@ -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