summaryrefslogtreecommitdiff
path: root/tb/sim/tarea2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tb/sim/tarea2.py')
-rw-r--r--tb/sim/tarea2.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/tb/sim/tarea2.py b/tb/sim/tarea2.py
new file mode 100644
index 0000000..921ea6f
--- /dev/null
+++ b/tb/sim/tarea2.py
@@ -0,0 +1,23 @@
+N = 20
+
+mem_dumps = [range(0x100, 0x108), range(0x200, 0x200 + 4 * N)]
+
+def init():
+ init_reg(r0, N)
+
+def final():
+ a, b, s = 1, 1, 0
+ mem = []
+
+ for _ in range(N):
+ s += a
+ c = a + b
+ mem.append(a)
+ a, b = b, c
+
+ if s > 10000:
+ break
+
+ assert_reg(r5, 0x104)
+ assert_mem(0x100, [s, 0xff if s > 10000 else 0xaa])
+ assert_mem(0x200, mem)