Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!harvard!seismo!mcvax!cernvax!ethz!claudio From: claudio@ethz.UUCP (Claudio Nieder) Newsgroups: net.micro.amiga,net.lang.mod2 Subject: Single Pass Modula-2 Compiler (short tutorial) Message-ID: <332@ethz.UUCP> Date: Mon, 12-May-86 20:47:04 EDT Article-I.D.: ethz.332 Posted: Mon May 12 20:47:04 1986 Date-Received: Thu, 15-May-86 05:48:28 EDT Reply-To: claudio@ethz.UUCP (Claudio Nieder) Organization: CS Department, ETH Zuerich, Switzerland Lines: 60 Xref: linus net.micro.amiga:6841 net.lang.mod2:459 Single Pass Modula-2 Compiler Tutorial (12-may-86/kussi) ====================================== The group headed by N. Wirth is currently working on Modula-2 Systems for MC68000 and NS32032 Processors. In this work the MacMETH System for MacIntosh has been developed. This system consists of a single pass compiler, a symbolic debugger and an editor. We claudio, jr, red & kussi are students of computer science and Amiga owners. The first thought after receiving our self-imported machines was to port the compiler to the Amiga. After some discussions with the people who developed the Mac System, we got the object code of a pre-release of the compiler running on the Mac and a cross compiler for Lilith. The compiler generates a generic code format containing linking information that needs a special loader to run. Within a month we wrote our loader (ALoad) in C on the Amiga and the system interface modules using the cross compiler. This work is now distributed in the public domain and we hope that many people learn to love Modula-2. All languages change from time to time, N. Wirth changes his Modula very often and the version supported by this compiler isn't very compatible to the first revision of Modula-2: Our compiler supports: - Standard Functions: ABS, CAP, CHR, FLOAT, FLOATD, HIGH, ODD, ORD, TRUNC, TRUNCD, DEC, EXCL, HALT, INC, INCL, MAX, MIN, SIZE, VAL; - SYSTEM TYPEs & PROCEDUREs: ADDRESS, BYTE, WORD, ADR, SHORT, LONG, SHIFT, TSIZE, INLINE, REG, SETREG; Declaration must preceed use, so FORWARD is implemented. PROCEDURE a(...); FORWARD; BUG in AMIGADos.MOD =================== Sorry, in the implementation of AMIGADos is a bug. (at least one!) PROCEDURE Lock(name: ... IF accessWrite THEN reg.d[2]:=-1D (* instead of -2D *) ELSE reg.d[2]:=-2D (* instead of -1D *) END Replace the two absolute values to have a correct working Lock. NOTE: Do not compile AMIGADos.DEF! This would result in incompatible module importation. Have fun, and send us your questions kussi/claudio/jr/red