Category : Pascal Source Code
Archive   : TMULTASK.ZIP
Filename : MTDEMO.PAS

 
Output of file : MTDEMO.PAS contained in archive : TMULTASK.ZIP

{File: MTDEMO.PAS ====================================================

This is the main file for a program that demonstrates the use of most of
the routines in MULTASK.LIB (I have not yet had an opportunity to use
the Semaphore data structure). See MULTASK.LIB for a bit more
documentation. This demo uses direct video memory I/O and is set up for
the standard CGA color card.

- E.T.Burleyson 29 Sept 87

=======================================================================}
Program MultiTaskingDemo;

{$C-} {disable Ctrl-C program abort and Ctrl-S output pause}
{dollarK-} {disable stack/heap collision checking (needed for multitasking?)}

{$I MULTASK.LIB } {multitasking kernel library}

{$I ASCII.LIB} {keyboard key scan values, etc.}

const
ScreenBaseAddress = $B800; {standard start of color video memory;
Monochrome is $B000 }
IDTag : String[80]
= ' MultiTasking Demo program by E.T.Burleyson 28 Sept 87';

type
String40 = String[40];

ShortNoticeBuffer = record
ovd: FifoOverhead; {fifo overhead -- see MULTASK.LIB}
Notice: string40; {pending notice}
Color: byte; {color attribute}
WaitTime: integer; {seconds to leave notice up -- 0=forever}
end; {record}

CharPosition = (Character,Attribute); {index for screen arrays}

Screen1DPtr = ^Screen1DAccessType; {ptr to allow a linear index of
screen character positions}

Screen2DPtr = ^Screen2DAccessType; {ptr to allow a row/col index of
screen character positions}

Screen1DAccessType = record {look at screen as one-dimensional array of
character positions}
Image : Array[1..2000,Character..Attribute] of byte;
end; {Screen1DAccessType}

Screen2DAccessType = record {look at screen as two-dimensional array
(row,col) of character positions}
Image : Array[1..25,1..80,Character..Attribute] of byte;
end; {Screen2DAccessType}

var
StatusLineBuffer: ShortNoticeBuffer; {error/notice area of line 25}

EntryColor: integer; {character attribute for all keyboard input}
StatusLineColor: integer; {character attribute for line 25}
IDLineColor: integer; {character attribute for line 1}
ErrorColor: integer; {char. attr. for error notices on line 25}

PhysicalScreen2D : Screen2DPtr; {memory-mapped screen area}
PhysicalScreen1D : Screen1DPtr; {memory-mapped screen area, too}

{$I STATLINE.PAS } {status line (line 25) routines, including error notices}

{$I INITTERM.PAS } {initialization and termination routines}

{$I KEYINPUT.PAS } {Keyboard input routines}

begin {MultiTaskingDemo}
PhysicalScreen2D:=Ptr(ScreenBaseAddress,0);
PhysicalScreen1D:=Ptr(ScreenBaseAddress,0);
initialize;
Fork;
if ChildProcess then ProcessKeyChar;
Fork;
if ChildProcess then UpdateStatusLine;
ProcessNotice;
end. {MultiTaskingDemo}


  3 Responses to “Category : Pascal Source Code
Archive   : TMULTASK.ZIP
Filename : MTDEMO.PAS

  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/