From 267749bd4056e346ab990059bf063ccb8e8b081c Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 31 Aug 2014 10:37:04 +0200 Subject: [PATCH] [Reduction] #410: ems_enablepageframe --- libs/master.lib/ems_enablepageframe.asm | 44 +++++++++++++++++++++++++ th04_main.asm | 19 ++--------- th05_main.asm | 19 ++--------- 3 files changed, 50 insertions(+), 32 deletions(-) create mode 100644 libs/master.lib/ems_enablepageframe.asm diff --git a/libs/master.lib/ems_enablepageframe.asm b/libs/master.lib/ems_enablepageframe.asm new file mode 100644 index 00000000..a8dd9488 --- /dev/null +++ b/libs/master.lib/ems_enablepageframe.asm @@ -0,0 +1,44 @@ +; master library - PC98 - MSDOS - EMS +; +; Description: +; NEC EMSドライバのページフレームの用途の制御 +; +; Function/Procedures: +; void ems_enablepageframe( int enable ) ; +; +; Parameters: +; int enable 0=disable(B000h=VRAM), 1=enable(B000=EMS) +; +; Returns: +; none +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; PC-9801 +; +; Requiring Resources: +; CPU: 8086 +; EMS: LIM EMS 4.0 +; +; Notes: +; +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 +; +; Author: +; 恋塚昭彦 +; +; Revision History: +; 92/11/16 Initial + +func EMS_ENABLEPAGEFRAME + mov BX,BP + mov BX,SS:[BX+(RETSIZE)*2] + mov AX,7001h + int 67h + ret 2 +endfunc diff --git a/th04_main.asm b/th04_main.asm index 4dea3c56..1f4e284c 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -1815,8 +1815,7 @@ arg_C = word ptr 12h push ax sub ax, ax push ax - push cs - call near ptr sub_417C + call ems_enablepageframe pop ax mov sp, bp pop bp @@ -1824,18 +1823,7 @@ arg_C = word ptr 12h sub_40F4 endp include libs/master.lib/ems_allocate.asm - -; =============== S U B R O U T I N E ======================================= - - -sub_417C proc far - mov bx, bp - mov bx, ss:[bx+4] - mov ax, 7001h - int 67h ; - LIM EMS - retf 2 -sub_417C endp - +include libs/master.lib/ems_enablepageframe.asm ; =============== S U B R O U T I N E ======================================= @@ -1989,8 +1977,7 @@ arg_C = word ptr 12h push ax sub ax, ax push ax - push cs - call near ptr sub_417C + call ems_enablepageframe pop ax mov sp, bp pop bp diff --git a/th05_main.asm b/th05_main.asm index 12b5f92b..499256c7 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -1301,8 +1301,7 @@ arg_C = word ptr 12h push ax sub ax, ax push ax - push cs - call near ptr sub_3FF2 + call ems_enablepageframe pop ax mov sp, bp pop bp @@ -1310,18 +1309,7 @@ arg_C = word ptr 12h sub_3F6A endp include libs/master.lib/ems_allocate.asm - -; =============== S U B R O U T I N E ======================================= - - -sub_3FF2 proc far - mov bx, bp - mov bx, ss:[bx+4] - mov ax, 7001h - int 67h ; - LIM EMS - retf 2 -sub_3FF2 endp - +include libs/master.lib/ems_enablepageframe.asm ; =============== S U B R O U T I N E ======================================= @@ -1474,8 +1462,7 @@ arg_C = word ptr 12h push ax sub ax, ax push ax - push cs - call near ptr sub_3FF2 + call ems_enablepageframe pop ax mov sp, bp pop bp