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
2021-09-29 20:29:13 +02:00

24 lines
275 B
Plaintext

INT tot
INT n
INT j
INT te
IN INT tot numero massimo
SET n 1
:scn
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
JLE scn n tot
END
:scr
#OUT $j$ sas\n
SET j 2
INC n
JMP sieve