Skip to content

Latest commit

 

History

History

winkler-examples

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Winkler's Modula-2 Examples

Modula-2 project Directory winkler-examples\ contains Modula-2 code examples from the web page Die Programmiersprache Modula-2 which reproduces two articles written by Eckart Winkler (1987 and 1989).

Code Example

This example has the following directory structure :

> tree /f /a . | findstr /v /b [A-Z]
|   build.bat
|   build.sh
|   Makefile
\---src
    \---main
        \---mod
                Code.mod

Command build.bat-verbose clean run generates and executes the Modula-2 program target\Code.exe :

(* tbd *)

Felder Example

This example has the following directory structure :

> tree /f /a . | findstr /v /b [A-Z]
|   build.bat
|   build.sh
|   Makefile
\---src
    \---main
        +---mod
        |       Felder.mod
        \---mod-adw
                Felder.mod

Command build.bat-verbose clean run generates and executes the Modula-2 program target\Felder.exe :

(* tbd *)

Nullstellen Example

This example has the following directory structure :

> tree /f /a . | findstr /v /b [A-Z]
|   build.bat
|   build.sh
|   Makefile
\---src
    \---main
        \---mod
                Nullstellen.mod

Command build.bat-verbose clean run generates and executes the Modula-2 program target\Nullstellen.exe :

(* tbd *)

WuerfelSpiel Example

This example has the following directory structure :

> tree /f /a . | findstr /v /b [A-Z]
|   00download.txt
|   build.bat
|   build.sh
|   Makefile
\---src
    \---main
        \---mod
                WuerfelSpiel.mod

Command build.bat-verbose run fails to compile the Modula-2 source code; both the ADW and the XDS compiler can't find the identifiers SIZE, PROCESS, NEWPROCESS and TRANSFER in the imported module SYSTEM :

> build -verbose clean run
Create XDS project file "target\WuerfelSpiel.prj"
Compile 1 Modula-2 implementation module into directory "target"
O2/M2 development system v2.60 TS  (c) 1991-2011 Excelsior, LLC. (build 07.06.2012)
Make project "F:\winkler-examples\WuerfelSpiel\target\WuerfelSpiel.prj"
XDS Modula-2 v2.40 [x86, v1.50] - build 07.06.2012
Compiling "F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod"

* [F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod 3.31 E020]
* undeclared identifier "SIZE"
FROM SYSTEM IMPORT WORD, ADR, $SIZE, PROCESS, NEWPROCESS, TRANSFER;

* [F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod 3.37 E020]
* undeclared identifier "PROCESS"
FROM SYSTEM IMPORT WORD, ADR, SIZE, $PROCESS, NEWPROCESS, TRANSFER;

* [F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod 3.46 E020]
* undeclared identifier "NEWPROCESS"
FROM SYSTEM IMPORT WORD, ADR, SIZE, PROCESS, $NEWPROCESS, TRANSFER;

* [F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod 3.58 E020]
* undeclared identifier "TRANSFER"
FROM SYSTEM IMPORT WORD, ADR, SIZE, PROCESS, NEWPROCESS, $TRANSFER;

* [F:\winkler-examples\WuerfelSpiel\target\mod\WuerfelSpiel.mod 4.06 F425]
* file open error: "Terminal2.sym" no such file
FROM $Terminal2 IMPORT WriteCard, WriteString, WriteLn, ReadCard;
errors  5, no warnings, lines    4, time  0.01
Error: Failed to compile 1 Modula-2 implementation module into directory "target"

mics/December 2024