[Reduction] #414: ems_setname

This commit is contained in:
nmlgc 2014-08-31 10:58:51 +02:00
parent 3660316127
commit 2c16f56bb1
3 changed files with 65 additions and 46 deletions

View File

@ -0,0 +1,61 @@
; master library - PC98 - MSDOS - EMS
;
; Description:
; EMSメモリハンドルに名前をつける
;
; Function/Procedures:
; int ems_setname( unsigned handle, const char * hname );
;
; Parameters:
; unsigned handle EMSハンドル
; char * hname 8bytes,余っている場合は'¥0'で埋めること
;
; Returns:
; 0 ........... success
; 80h〜89h .... failure(EMS エラーコード)
;
; 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
; 92/11/18 bugfix ( thanks, Mikio! )
func EMS_SETNAME
push SI
mov SI,SP
_push DS
; 引数
@@handle = (RETSIZE+1+DATASIZE)*2
@@hname = (RETSIZE+1)*2
mov DX,SS:[SI+@@handle]
_lds SI,SS:[SI+@@hname]
mov AX,5301h ; function: Set Handle Name
int 67h ; call EMM
mov AL,AH
xor AH,AH
_pop DS
pop SI
ret (1+DATASIZE)*2
endfunc

View File

@ -1826,28 +1826,7 @@ include libs/master.lib/ems_enablepageframe.asm
include libs/master.lib/ems_exist.asm
include libs/master.lib/ems_free.asm
include libs/master.lib/ems_movememoryregion.asm
; =============== S U B R O U T I N E =======================================
sub_41DC proc far
push si
mov si, sp
push ds
mov dx, ss:[si+0Ah]
lds si, ss:[si+6]
mov ax, 5301h
int 67h ; - LIM EMS 4.0 - GET/SET HANDLE NAME
; AL = 00h get handle name / 01h set handle name,
; DS:SI -> 8-byte handle name, DX = handle
; Return: AH = status
mov al, ah
xor ah, ah
pop ds
pop si
retf 6
sub_41DC endp
include libs/master.lib/ems_setname.asm
; =============== S U B R O U T I N E =======================================
@ -5768,7 +5747,7 @@ loc_B4AF:
push ax
push ds
push offset aGensoems ; "GENSOEMS"
call sub_41DC
call ems_setname
push 1Fh
push large [off_213DA]
push 0

View File

@ -1312,28 +1312,7 @@ include libs/master.lib/ems_enablepageframe.asm
include libs/master.lib/ems_exist.asm
include libs/master.lib/ems_free.asm
include libs/master.lib/ems_movememoryregion.asm
; =============== S U B R O U T I N E =======================================
sub_4052 proc far
push si
mov si, sp
push ds
mov dx, ss:[si+0Ah]
lds si, ss:[si+6]
mov ax, 5301h
int 67h ; - LIM EMS 4.0 - GET/SET HANDLE NAME
; AL = 00h get handle name / 01h set handle name,
; DS:SI -> 8-byte handle name, DX = handle
; Return: AH = status
mov al, ah
xor ah, ah
pop ds
pop si
retf 6
sub_4052 endp
include libs/master.lib/ems_setname.asm
; =============== S U B R O U T I N E =======================================
@ -5893,7 +5872,7 @@ loc_B84E:
push ax
push ds
push offset aKaikiems ; "KAIKIEMS"
call sub_4052
call ems_setname
push 1Fh
push large [off_20A80]
push 0