Registermaschine/Alle Primzahlen/Druckt/Aufgabe/Lösung

Aus Wikiversity
Zur Navigation springen Zur Suche springen

Load #10 Store 5 Load #91 Store 6 Load #2 Store 1

Again: Load #2 Store 2 Load #0 Store 3 Store 4

Next: Load 1 Div 2 Store 3 Load 1 Sub #1 Div 2 Store 4 Load 3 Sub 4 JNZero Check2 JZero Prep

Prep: Load 2 Add #1 Store 2 Goto Next

Check2: Load 1 Sub 2 JZero True JNZero False

True: Load 1 Store *5 Load 5 Add #1 Store 5 Load 1 Add #1 Store 1 Load 6 Sub 5 JZero End JNZero Again

False: Load 1 Add #1 Store 1 Goto Again

End: END