Category : Modula II Source Code
Archive   : M2TUTOR.ZIP
Filename : WORDADDR.MOD

 
Output of file : WORDADDR.MOD contained in archive : M2TUTOR.ZIP
(* Chapter 14 - Program 2 *)
MODULE WordAddr;

FROM SYSTEM IMPORT ADR,WORD,ADDRESS;
FROM InOut IMPORT WriteString,WriteCard,WriteLn;

VAR Index : INTEGER;
CardNo : CARDINAL;
Peach : ADDRESS;
MonoVideo[0B000H:0H] : ARRAY[1..4000] OF CHAR;
ColorVideo[0B800H:0H] : ARRAY[1..4000] OF CHAR;

PROCEDURE PrintNumber(DatOut : WORD);
VAR Temp : CARDINAL;
BEGIN
WriteString("The value is ");
Temp := CARDINAL(DatOut);
WriteCard(Temp,4);
WriteLn;
END PrintNumber;

BEGIN
Index := 17;
CardNo := 38;
Peach := ADR(Index); (* Pointer to an INTEGER *)
Peach := ADR(CardNo); (* Pointer to a CARDINAL *)
PrintNumber(Index); (* Called with an INTEGER *)
PrintNumber(CardNo); (* Called with a CARDINAL *)

Peach := 0B000H:1A2H; (* Pointer to Segment:Offset *)

END WordAddr.




(* Result of execution

The value is 17
The value is 38

*)



  3 Responses to “Category : Modula II Source Code
Archive   : M2TUTOR.ZIP
Filename : WORDADDR.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/