$CPU 8086 ' make compatible with XT systems $LIB ALL OFF ' turn off all PowerBASIC libraries $ERROR ALL OFF ' turn off all PowerBASIC error checking $OPTIMIZE SIZE ' optimize for smaller code $COMPILE UNIT ' compile to a UNIT (.PBU) '$COMPILE EXE ' compile to a UNIT (.PBU) DEFINT A-Z ' Required for all numeric functions, forces PB to not ' include floating point in UNIT (makes it smaller) $CODE SEG "MLIB11" '/*------------------------------------------------------------------*/ FUNCTION ISSHARE() PUBLIC AS INTEGER T = SHARE IF T = -1 THEN FUNCTION = 1 ELSE FUNCTION = T END FUNCTION '/*------------------------------------------------------------------*/ ' IsShareLoaded - Returns true (1) if SHARE.EXE is loaded in memory. ' FUNCTION SHARE() AS INTEGER ! push DS ; save DS for PowerBASIC ! mov AX, &H1000 ; is SHARE.EXE installed? ! int &H2F ; call DOS multiplexor ! xor BX, BX ; assume not installed ! cmp AL, &HFF ; does AL = FF? ! jne ShareDone ; no, exit ! dec BX ; yes, return -1 ShareDone: ! mov FUNCTION, BX ; return result ! pop DS ; restore DS END FUNCTION '/*------------------------------------------------------------------*/ ' T = ISSHARE ' IF T = 0 THEN PRINT "SHARE IS NOT LOADED" ' IF T = 1 THEN PRINT "SHARE IS LOADED" ' INPUT Z '/*------------------------------------------------------------------*/