+++ /dev/null
-Error: Segment _TEXT exceeds 64K\r
-\r
- Start Stop Length Name Class\r
-\r
- 00000H 004F2H 004F3H MEMORY_TEXT CODE\r
- 004F3H 40507H 40015H _TEXT CODE\r
- 504F2H 5057DH 0008CH MEMORY_DATA FAR_DATA\r
- 50580H 50581H 00002H FSBDTR5_FAR FAR_DATA\r
- 50590H 50590H 00000H IOSTSTD5_FAR FAR_DATA\r
- 50590H 505C3H 00034H IOSTSTD6_FAR FAR_DATA\r
- 505D0H 505D0H 00000H IOSTSTD7_FAR FAR_DATA\r
- 505D0H 50601H 00032H IOSTSTD8_FAR FAR_DATA\r
- 50610H 50610H 00000H IOSTSTD9_FAR FAR_DATA\r
- 50610H 50641H 00032H IOSTSTD10_FAR FAR_DATA\r
- 50650H 50650H 00000H IOSTSTD11_FAR FAR_DATA\r
- 50650H 50681H 00032H IOSTSTD12_FAR FAR_DATA\r
- 50690H 50693H 00004H IOSTSTD13_FAR FAR_DATA\r
- 506A0H 506A3H 00004H IOSTSTD14_FAR FAR_DATA\r
- 506B0H 506B3H 00004H IOSTSTD15_FAR FAR_DATA\r
- 506C0H 506C3H 00004H STDTR5_FAR FAR_DATA\r
- 506D0H 506D3H 00004H STDTR6_FAR FAR_DATA\r
- 506E0H 506E3H 00004H STDTR7_FAR FAR_DATA\r
- 506F0H 506F3H 00004H STDTR8_FAR FAR_DATA\r
- 50700H 50701H 00002H STDTR9_FAR FAR_DATA\r
- 50710H 50713H 00004H STSYNC5_FAR FAR_DATA\r
- 50720H 50723H 00004H STSYNC6_FAR FAR_DATA\r
- 50730H 50733H 00004H STSYNC7_FAR FAR_DATA\r
- 50734H 5161BH 00EE8H _DATA DATA\r
- 5161CH 5161DH 00002H _CVTSEG DATA\r
- 5161EH 51623H 00006H _SCNSEG DATA\r
- 51624H 5164DH 0002AH _INIT_ INITDATA\r
- 5164EH 51651H 00004H _BSS BSS\r
- 51652H 5165DH 0000CH _EXIT_ EXITDATA\r
-\r
-\r
* Module: All Modules\r
* Author(s): Chris Somers\r
* Date: December 1, 1992\r
- * Version: V.1.1\r
+ * Version: V.1.1w\r
\r
minor mods by Alex Russell to simplify\r
\r
Must use memory model with FAR code\r
+
+ Open Watcom patch by sparky4~
\r
*/\r
\r
static unsigned int EMMSeg;\r
\r
//forward declarations ---------------------------------\r
-\r
+
static int EMPresent(void);\r
static int EMReady(void);\r
static unsigned int GetEMMSeg(void);\r
static int GetNumPages(int Handle);\r
static int EMStateSave(int Handle);\r
static void EMStateRestore(int Handle);\r
-\r
+
+/********************************************************************/
+
+int\r
+EMVer(void)\r
+{
+ int EMSver;\r
+ _asm
+ {
+ mov ah,0x46\r
+ int 0x67
+ mov EMSver,ax\r
+ }
+ return(EMSver);\r
+}\r
\r
/********************************************************************/\r
int\r
unsigned long\r
EMMCoreLeft(void)\r
{\r
- unsigned Pages;\r
- unsigned long RtnVal = 0UL;\r
-\r
- _asm {\r
- mov ah,0x42 /* get EMM free page count */\r
- int 0x67\r
- or ah,ah\r
- js InternalError /* returns 80, 81, or 84 hex on error */\r
- mov Pages,bx /* number of unallocated 16K pages */
+ unsigned Pages;\r
+ unsigned long RtnVal = 0UL;
+ unsigned short interr=0;\r
+\r
+ _asm {\r
+ mov ah,0x42 /* get EMM free page count */\r
+ int 0x67\r
+ or ah,ah\r
+ js InternalError /* returns 80, 81, or 84 hex on error */\r
+ mov Pages,bx /* number of unallocated 16K pages */
+ jmp End
InternalError:
- ret\r
- }\r
- RtnVal = ((unsigned long)Pages << 14); /* Pages * 16K rtns bytes*/\r
+ mov interr,1
+ End:
+ }
+ if(!interr)
+ RtnVal = ((unsigned long)Pages << 14); /* Pages * 16K rtns bytes*/\r
\r
-//InternalError:\r
- return(RtnVal);\r
+ return(RtnVal);\r
} /* End of EMMCoreLeft() */\r
\r
/********************************************************************/\r
int\r
EMMRealloc(int Handle, int Pages)\r
{\r
- int RtnCode = FALSE;\r
-\r
- if (!EMMSeg || (Pages < 0) || (Pages > 1020)) {\r
- return (FALSE);\r
- }\r
- _asm {\r
- mov ah,0x51 /* change # of pages */\r
- mov bx,Pages\r
- mov dx,Handle\r
- int 0x67\r
- or ah,ah\r
- js NoGo /* returns 80 to 88 hex on error */
+ int RtnCode = FALSE;\r
+\r
+ if (!EMMSeg || (Pages < 0) || (Pages > 1020)) {\r
+ return (FALSE);\r
+ }\r
+ _asm {\r
+ mov ah,0x51 /* change # of pages */\r
+ mov bx,Pages\r
+ mov dx,Handle\r
+ int 0x67\r
+ or ah,ah\r
+ js NoGo /* returns 80 to 88 hex on error */
+ mov RtnCode,TRUE
NoGo:
- ret\r
- }\r
- RtnCode = TRUE;\r
+ }\r
\r
//NoGo:\r
- return(RtnCode);\r
+ return(RtnCode);\r
} /* End of EMMRealloc() */\r
\r
/********************************************************************/\r
\r
static int\r
EMReady(void)\r
-{\r
- _asm {\r
- mov ah,0x40 /* get EM Manager Status */\r
- int 0x67\r
- or ah,ah\r
- jns Ready /* returns 80, 81, or 84 hex on error */
+{
+ int EMSready;\r
+ _asm {\r
+ mov ah,0x40 /* get EM Manager Status */\r
+ int 0x67
+ or ah,ah\r
+ jns Ready /* returns 80, 81, or 84 hex on error */
+ mov EMSready,FALSE
+ jmp End
Ready:
- ret\r
- }\r
- return(FALSE);\r
+ mov EMSready,TRUE
+ End:
+ }\r
+ return(EMSready);\r
\r
//Ready:\r
// return(TRUE);\r
static unsigned int\r
GetEMMSeg(void)\r
{\r
- unsigned int EMSegment;\r
-\r
- _asm {\r
- mov ah,0x41 /* get EMM page frame segment */\r
- int 0x67\r
- or ah,ah\r
- js NotReady /* returns 80, 81, or 84 hex on error */\r
- mov EMSegment,bx
+ unsigned int EMSegment;\r
+\r
+ _asm {\r
+ mov ah,0x41 /* get EMM page frame segment */\r
+ int 0x67\r
+ or ah,ah\r
+ js NotReady /* returns 80, 81, or 84 hex on error */\r
+ mov EMSegment,bx
+ jmp End
NotReady:
- ret\r
- }\r
- return(EMSegment); /*lint !e530 */\r
+ mov EMSegment,NOTREADY
+ End:\r
+ }\r
+ return(EMSegment); /*lint !e530 */\r
\r
//NotReady:\r
// return(NOTREADY);\r
static int\r
GetEMHandle(int NumPages)\r
{\r
- int NewHandle;\r
-\r
- _asm {\r
- mov ah,0x43 /* get handle and allocate EM */\r
- mov bx,NumPages /* number of 16K pages to allocate */\r
- int 0x67\r
- or ah,ah /* returns 80 to 89 hex on error */\r
- js NoHandle\r
- mov NewHandle,dx /* retrieve handle */
+ int NewHandle;\r
+\r
+ _asm {\r
+ mov ah,0x43 /* get handle and allocate EM */\r
+ mov bx,NumPages /* number of 16K pages to allocate */\r
+ int 0x67\r
+ or ah,ah /* returns 80 to 89 hex on error */\r
+ js NoHandle\r
+ mov NewHandle,dx /* retrieve handle */
+ jmp End
NoHandle:
- ret\r
- }\r
- return(NewHandle);\r
+ mov NewHandle,NO_DATA
+ End:\r
+ }\r
+ return(NewHandle);\r
\r
//NoHandle:\r
// return(NO_DATA);\r
static int\r
EMMap(int Handle, int LogPg, int PhyPg)\r
{\r
- int RtnCode = NO_DATA;\r
-\r
- _asm {\r
- mov ax,PhyPg /* physical page: 0 - 3 in AL only */\r
- mov ah,0x44 /* map logical to physical page */\r
- mov bx,LogPg /* logical page: 0 - 1020 */\r
- mov dx,Handle\r
- int 0x67\r
- or ah,ah /* returns 80 to 8B hex on error */\r
- js NoMapping
+ int RtnCode = NO_DATA;\r
+\r
+ _asm {\r
+ mov ax,PhyPg /* physical page: 0 - 3 in AL only */\r
+ mov ah,0x44 /* map logical to physical page */\r
+ mov bx,LogPg /* logical page: 0 - 1020 */\r
+ mov dx,Handle\r
+ int 0x67\r
+ or ah,ah /* returns 80 to 8B hex on error */\r
+ js NoMapping
+ mov RtnCode,SUCCESS
+// jmp End
NoMapping:
- ret\r
- }\r
- RtnCode = SUCCESS;\r
+// End:\r
+ }\r
+// RtnCode = SUCCESS;\r
\r
//NoMapping:\r
- return(RtnCode);\r
+ return(RtnCode);\r
} /* End of EMMap() */\r
\r
/********************************************************************/\r
\r
static int\r
FreeEMHandle(int Handle)\r
-{\r
- _asm {\r
- mov ah,0x45 /* free handle and deallocate EM */\r
- mov dx,Handle\r
- int 0x67\r
- or ah,ah /* returns 80 to 86 hex on error */\r
- js NotFreed
+{
+ int FreeEMShandle;\r
+ _asm {\r
+ mov ah,0x45 /* free handle and deallocate EM */\r
+ mov dx,Handle\r
+ int 0x67\r
+ or ah,ah /* returns 80 to 86 hex on error */\r
+ js NotFreed
+ mov FreeEMShandle,SUCCESS
+ jmp End
NotFreed: /* must retry if unsuccessful */
- ret\r
- }\r
- return(SUCCESS);\r
+ mov FreeEMShandle,NO_DATA
+ End:\r
+ }\r
+ return(FreeEMShandle);\r
\r
//NotFreed: /* must retry if unsuccessful */\r
// return(NO_DATA);\r
static int\r
GetNumPages(int Handle)\r
{\r
- int NumPages = 0;\r
-\r
- _asm {\r
- mov ah,0x4C /* get allocated pages for Handle */\r
- mov dx,Handle\r
- int 0x67\r
- or ah,ah /* returns 80 to 84 hex on error */\r
- js BadHandle\r
- mov NumPages,bx
+ int NumPages = 0;\r
+\r
+ _asm {\r
+ mov ah,0x4C /* get allocated pages for Handle */\r
+ mov dx,Handle\r
+ int 0x67\r
+ or ah,ah /* returns 80 to 84 hex on error */\r
+ js BadHandle\r
+ mov NumPages,bx
+// jmp End
BadHandle:
- ret\r
- }
+// End:\r
+ }
\r
//BadHandle:\r
- return(NumPages);\r
+ return(NumPages);\r
} /* End of GetNumPages() */\r
\r
/********************************************************************/\r
static int\r
EMStateSave(int Handle)\r
{\r
- int RtnCode = NO_MEMORY;\r
- _asm {\r
- mov ah,0x47 /* save page map under Handle */\r
- mov dx,Handle\r
- int 0x67\r
- or ah,ah\r
- js Unsaved /* out of save space error */
+ int RtnCode = NO_MEMORY;\r
+ _asm {\r
+ mov ah,0x47 /* save page map under Handle */\r
+ mov dx,Handle\r
+ int 0x67\r
+ or ah,ah\r
+ js Unsaved /* out of save space error */
+ mov RtnCode,SUCCESS
Unsaved:
- ret\r
- }\r
- RtnCode = SUCCESS;\r
+ }\r
+// RtnCode = SUCCESS;\r
\r
//Unsaved:\r
return(RtnCode);\r