1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
function $test() { @start %x =w copy 3 %n =w copy 2 @loop %c =w ceqw %n, 10000 jnz %c, @end, @next @next %t =w copy 3 %x =w add %x, 2 @tloop %s =w mul %t, %t %c =w csgtw %s, %x jnz %c, @prime, @test @test %r =w rem %x, %t jnz %r, @tnext, @loop @tnext %t =w add %t, 2 jmp @tloop @prime %n =w add %n, 1 jmp @loop @end storew %x, $a ret }