Skip to content
Tactiverge
Level 4Program correctnessWrite a program

How many zeros?

Four bytes are in memory at 0xF0 to 0xF3. Output how many of them are exactly 0. Keep your program below 0xF0.

Public tests

  • memory 0xF0=0 0xF1=5 0xF2=0 0xF3=9 → 2
  • memory 0xF0=1 0xF1=2 0xF2=3 0xF3=4 → 0
  • memory 0xF0=0 0xF1=0 0xF2=0 0xF3=0 → 4
  • memory 0xF0=255 0xF1=0 0xF2=128 0xF3=1 → 1

Par: 480 cycles in total over these tests. Skills: Z flag, counting.

New to this? Silicon Studio 13: Basic memory

How results are computed: model assumptions.

One instruction per line. Labels end with a colon, comments start with a semicolon. Numbers can be 12, 0x0C or 0b1100.