diff --git a/libs/master.lib/ems_setname.asm b/libs/master.lib/ems_setname.asm new file mode 100644 index 00000000..6cb67868 --- /dev/null +++ b/libs/master.lib/ems_setname.asm @@ -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 diff --git a/th04_main.asm b/th04_main.asm index bfe547fa..8efeb4d4 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -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 diff --git a/th05_main.asm b/th05_main.asm index 0cf592a2..38fd0e42 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -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