(C)stachan 08.02.2024

Task 2 :: increment

Schreiben Sie folgendes Programm mit Endlosschleife:

  1. Speichern Sie die Zahl 7 im Register b1 und geben Sie den Text: “Wert vorher:” und den Inhalt von b1 im Debugger aus.
  2. Danach inkrementieren Sie die Zahl 4 Mal (keine Ausgabe).
  3. Dann geben Sie den Text “Wert nachher:” sowie den Inhalt von b1 im Debugger aus.
  4. Wenn Ihr Programm in jeder Runde dasselbe Endergebnis ausgibt, dann lassen Sie am Ende die gelbe Lampe für 0,9s leuchten.
  5. Haben Sie Ihr Programm als Zähler angelegt, dann lassen Sie stattdessen die rote Lampe leuchten.

Probieren Sie Ihr Programm im Debugger Step by Step aus und beobachten Sie, wie sich der Wert in Register b1 verändert.


Write the following program with an infinite loop:

  1. save the number 7 in register b1 and output the text: ‘Value before:’ and the content of b1 in the debugger.
  2. then increment the number 4 times (no output).
  3. then output the text ‘Value after:’ and the contents of b1 in the debugger.
  4. if your programme outputs the same final result in every round, then leave the yellow lamp lit for 0.9s at the end.
  5. if you have set up your programme as a counter, leave the red light on instead.

Try out your program in the debugger step by step and observe how the value in register b3 changes.