Category : C++ Source Code
Archive   : WLIB.ZIP
Filename : WDOS.H

 
Output of file : WDOS.H contained in archive : WLIB.ZIP
#ifndef WDOSIncluded
#define WDOSIncluded

// copyright (c) 1992, 1993 by Paul Wheaton, Banana Programming
// 1916 Brooks #205, Missoula, MT 59801
//
// phone: (406)543-1928
// CompuServe: 72707,207
// Internet: [email protected]
// BBS: (406)543-8234 (The Montana Banana BBS)

#include
#include
#include

typedef char FileNameType[13];

struct DirElementType
{
FileNameType Name;
Moment M;
};

CreateLinkedListClass(Directory,DirElementType);

void LoadDirectory(const char* DirMask,Moment StartMoment,Directory& D);
void LoadDirectory(const char* DirMask,Directory& D);
long DirCount(const char* DirMask); // how many files match dirmask

typedef union
{
REGS R;
Word W[7];
Byte B[8];
} URegsType;

class Registers
{
URegsType UR;
friend void CallBIOS(Byte IntNum, Registers& R);
public:
Registers(Word ax=0,Word bx=0,Word cx=0,Word dx=0)
{AX()=ax;BX()=bx;CX()=cx;DX()=dx;}
Word& AX(){return UR.W[0];}
Word& BX(){return UR.W[1];}
Word& CX(){return UR.W[2];}
Word& DX(){return UR.W[3];}
Word& SI(){return UR.W[4];}
Word& DI(){return UR.W[5];}
Word& Flags(){return UR.W[6];}
Bool CF(){return ((UR.W[6]&1)>0);}
Bool PF(){return ((UR.W[6]&4)>0);}
Bool AF(){return ((UR.W[6]&16)>0);}
Bool ZF(){return ((UR.W[6]&64)>0);}
Bool SF(){return ((UR.W[6]&128)>0);}
Bool TF(){return ((UR.W[6]&256)>0);}
Bool IF(){return ((UR.W[6]&512)>0);}
Bool DF(){return ((UR.W[6]&1024)>0);}
Bool OF(){return ((UR.W[6]&2048)>0);}
Byte& AL(){return UR.B[0];}
Byte& AH(){return UR.B[1];}
Byte& BL(){return UR.B[2];}
Byte& BH(){return UR.B[3];}
Byte& CL(){return UR.B[4];}
Byte& CH(){return UR.B[5];}
Byte& DL(){return UR.B[6];}
Byte& DH(){return UR.B[7];}
#ifdef MAJORBBS
void* operator new(size_t size){return malloc(size);}
void operator delete(void* p) {free(p);}
#endif
};

inline void CallBIOS(Byte IntNum, Registers& R){int86(IntNum,&R.UR.R,&R.UR.R);}

#endif


  3 Responses to “Category : C++ Source Code
Archive   : WLIB.ZIP
Filename : WDOS.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/