This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
microgentambly/examples/primes.mga

24 lines
275 B
Plaintext
Raw Normal View History

INT tot
INT n
INT j
INT te
2021-09-29 18:48:54 +02:00
IN INT tot numero massimo
SET n 1
:scn
2021-09-29 20:29:13 +02:00
SET j 2
OUT $n$\n
:sieve
MOD n j te
#OUT \n- $te$ -\n
JME scr j n
INC j 1
JM sieve te 0
INC n
2021-09-29 18:48:54 +02:00
JLE scn n tot
2021-09-29 20:29:13 +02:00
END
:scr
#OUT $j$ sas\n
SET j 2
INC n
JMP sieve