Software mainly for MOTOROLA Platforms and the high-level Programming Language Modula-2

(last update 30. Aug 1999, see below: Goldbach with English comment)
I hope, that anybody will get something useful out of here. For experienced programmers it should be no problem, to transfer the readable code of Modula-2 to other languages and to adapt some minor differences, which are platform and/or implementation dependent, but the assembler code is not easy to transport to other processors. This is true, despite the better readability and more logical instructions, compared with the Intel platform for example.

The designations are: C (ANSI-C), M2 (Modula-2), M2A (M2Amiga Modula-2, latest version) MCA (Motorola Assembler), 20 (Motorola 68020 and higher (works also on 68030, 68040 and 68060)), XX (all Motorola processors from 68000 on, but without the 68008), ex = executable.

Remark: I underestimated the needed time for completing this page, so please be a little patient...

Mersenne Primes

Now all (original) M2A/20 and a executable M2A/00 version as program sources and executables are available; it contains the famous Lucas-Lehmer-Test as well as a short test division routine (two different program modules, M2 / MCA):

Lucas-Lehmer sources   The Lucas-Lehmer Test(German texts)

M2A 20 ex (German)    M2A 00 ex (German)

But I have to warn you: the assembler part (hold also true for the Fermat program below) is highly optimized in respect of data register usage of the Motorola 68020 and higher, therefore I would have to write an extra description of the somewhat complicated code, if somebody wants to understand it (mail see at bottom). Any execution times predicted are valid for a 40 MHz Motorola 68030, any other machine has another time functions of course!

Fermat Primes

Analog to above Lucas-Lehmer check also the pendant for Fermat primes:

Fermat source M2A 20   Fermat number check M2A 20 source (German)

M2A 20 ex (German)      M2A 00 ex (German)

Goldbach Conjecture

At now one ZIP of English and one of German text versions of checking programs available, the first checks up to numbers of 10,000,000, the second can check ranges of 10,000,000 numbers with an upper limit of 1,000,000,000 (time limit chosen, at principle up to above 2,000,000,000 or more precisely 2,147,483,647 possible).

Two Goldbach program sources in M2 

Two Goldbach program sources in M2 (in German texts)

Golomb Rulers

Only sources, following variants are available (the German M2A version is a little bit more advanced):

C (English)     C (German)     M2A[XX easy to substitute] (German, ZIP)


back to numbers    back to main

comments, questions, suggestions to: