(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...
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):
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
Analog to above Lucas-Lehmer check also the pendant for Fermat primes:
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).
Only sources, following variants are available (the German M2A version is a little bit more advanced):
back to numbers back to main
comments, questions, suggestions to: firstname.lastname@example.org