Level 4Computational efficiencyWrite a program
Sum the block
Four bytes are already in memory at 0xF0, 0xF1, 0xF2 and 0xF3 (the grader puts them there). Output their sum, wrapped to 8 bits. Keep your program below 0xF0. Par is tight: think about which instructions you really need.
Public tests
- memory 0xF0=1 0xF1=2 0xF2=3 0xF3=4 → 10
- memory 0xF0=0 0xF1=0 0xF2=0 0xF3=0 → 0
- memory 0xF0=100 0xF1=100 0xF2=50 0xF3=10 → 4
Par: 129 cycles in total over these tests. Skills: direct addressing, unrolling.
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.