![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
Access to the following ressources:
| Work with:
|
| It's a binary file designed for Extended Basic that you load this way:
Or 12 times faster with the FastLoader provided:
The compiler is now in memory! You just have to fill DATA line containing:
| Prepare your work on a PC:
|
MLC.ZIP | Content:
|
Content:
|
Here is a little vidéo that shows the sequence Edition, Compilation and program test. For the edition, you can use the editor you want, for me it's QuickEditor 3.5. For testing, I use Classic99, a very good emulator with a Debugger. |
100 CALL CLEAR
$MLC F 110 10 3000
310 CALL LINK("ERATHO",C)
320 PRINT C;" prime numbers"::PRINT "from 2 to 32767."
330 END
$ERATHO
DIMSET 2 32767 A ; a is a set with elements from 2 to 32767
SETFILL A ; all elements in A
LET B 2 ; first element to find
DO
SETFINDNEXT A B ; start looking for an element in A starting from B
WHILE= ; if found, then B=element number, and B is PRIME
LET C B ; take the prime number
DO
ADD C B ; computes 2*B, 3*B, 4*B, etc...
WHILE>
ELEMENT- A C ; and remove this list from A
LOOP
INC B ; see if there is another prime number after B
LOOP
SETCARD A C ; computes cardinal of set A
PUTPARAM 1 C ; and return the cardinal
$$
$END
| Notes:
|
100 CALL CLEAR
110 DIM IO(3)
120 CALL INIT::PRINT "LOADING COMPILER..."::CALL LOAD("DSK1.NEWFLO")::CALL LINK("NEWFLO")
130 IO(1)=3000::CALL LINK("COMPIL",IO(),S$(),C$())::If IO(1) THEN PRINT "Error ";IO(1)::END
140 PRINT "COMPILATION OK!"
310 CALL LINK("ERATHO",C)
320 PRINT C;" prime numbers"::PRINT "from 2 to 32767."
330 END
3000 DATA P
3010 DATA ERATHO
3020 DATA "FD2.32767A FOA =B2 LA FFAB _B !=B =CB LC +CB _D !>D F-AC BC LD IB BA LB FCAC P1C"
3030 DATA ""3040 DATA ""
| Notes:
|