Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : DOSLOCK.MOD

 
Output of file : DOSLOCK.MOD contained in archive : TASKING.ZIP
IMPLEMENTATION MODULE DOSlock;

FROM SYSTEM IMPORT SETREG, GETREG, AX, BX, ES, SWI, ADDRESS;
FROM Locks IMPORT LockType, Unlock, Lock;

VAR
criticalSectionPtr: POINTER TO CARDINAL;
aux: ADDRESS;
lock: LockType;

PROCEDURE LockDOS;
BEGIN
Lock(lock);
IF criticalSectionPtr^ # 0 THEN HALT END;
END LockDOS;

PROCEDURE UnlockDOS;
BEGIN
IF criticalSectionPtr^ # 0 THEN HALT END;
Unlock(lock);
END UnlockDOS;

BEGIN
Unlock(lock);
SETREG(AX, 3400H); (* undocumented dos call from page 15-11 of Logitech v2 *)
SWI(21H);
GETREG(ES, aux.SEGMENT);
GETREG(BX, aux.OFFSET);
criticalSectionPtr := aux;
END DOSlock.


  3 Responses to “Category : Modula II Source Code
Archive   : TASKING.ZIP
Filename : DOSLOCK.MOD

  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/