[net.micro.amiga] Single Pass Modula-2 Compiler

claudio@ethz.UUCP (Claudio Nieder) (04/25/86)

We received some mail with questions about the public domain modula
compiler. Following the answers to the most frequently asked questions:

>   .. can we have the source .. where can we get the source ..

We didn't have the source of the modula compiler! 
The compiler is a generic 68000 compiler. It produces an objectfile
with a propretary format. To port this compiler to the Amiga, we
had to write a loader, which loads the objectfiles into memory,
translates some addresses and jumps into the program. This loader
was written in C. Additionally we had to write some machine
dependent modules needed by the compiler (FileSystem, Terminal ...).
This was done using a cross compiler.
The source of the compiler can be obtained through Modula Corporation.

>  .. What system stuff does it support? Windows, mouse, menus etc. ..

Yes, but you have to program it. We wrote a Module AMIGADos which
gives access to the AMIGADos functions. In a similiar way you can
handle Intuition routines. Feel free to post YOUR implementation of
Amiga specific modules, so others can use it.

>  .. How should I make the $15 payment ? ..

Please transfer $15 to the account

	Rene Degen
	10 - 995.307.0

	Swiss Bank Corporation
	CH - 4002  Basel, Switzerland

claudio@ethz.UUCP (Claudio Nieder) (05/02/86)

It seems that a lot of people didn't read our last posting as we receive
a lot of questions concerning points we answered in that posting.
So here it is again:

We received some mail with questions about the public domain modula
compiler. Following the answers to the most frequently asked questions:

>   .. can we have the source .. where can we get the source ..

We didn't have the source of the modula compiler! 
The compiler is a generic 68000 compiler. It produces an objectfile
with a propretary format. To port this compiler to the Amiga, we
had to write a loader, which loads the objectfiles into memory,
translates some addresses and jumps into the program. This loader
was written in C. Additionally we had to write some machine
dependent modules needed by the compiler (FileSystem, Terminal ...).
This was done using a cross compiler.
The source of the compiler can be obtained through Modula Corporation.

>  .. What system stuff does it support? Windows, mouse, menus etc. ..

Yes, but you have to program it. We wrote a Module AMIGADos which
gives access to the AMIGADos functions. In a similiar way you can
handle Intuition routines. Feel free to post YOUR implementation of
Amiga specific modules, so others can use it.

>  .. How should I make the $15 payment ? ..

Please transfer $15 to the account

	Rene Degen
	10 - 995.307.0

	Swiss Bank Corporation
	CH - 4002  Basel, Switzerland

claudio@ethz.UUCP (Claudio Nieder) (05/13/86)

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