asm: updated in format and sum hexified
authorMartin Perner <martin@perner.cc>
Thu, 28 Oct 2010 13:03:34 +0000 (15:03 +0200)
committerMartin Perner <martin@perner.cc>
Thu, 28 Oct 2010 13:03:34 +0000 (15:03 +0200)
3_asmsim/format.txt
3_asmsim/sum.dthex [new file with mode: 0644]

index a0dbde6f761f3efdbca6f0d9ee315812a982468c..69c4298b9b418436e0511109e5591b1370253c6b 100644 (file)
@@ -3,5 +3,6 @@
 
 0/1;addr(als hex);value(word, als hex);code;label;kommentar
 2;kommentar
+3;label(bezieht sich auf die nächste adresse);kommentar
 
 eigenen programmer der dieses format dann per bootloader flasht?
diff --git a/3_asmsim/sum.dthex b/3_asmsim/sum.dthex
new file mode 100644 (file)
index 0000000..31ad135
--- /dev/null
@@ -0,0 +1,18 @@
+3;sum;
+2;r1 = len
+2;r2 = arr
+2;r3 = i
+2;r0 = sum
+2;r4 arr data
+1;00000000;ED000004;ldis r0, 0;;
+1;00000004;E1188000;addi r3, r1, 0;;
+1;00000008;1B000008;retzs-;;check len != 0
+3;loop;
+2;load arr data
+1;0000000C;E7210000;ldw r4, 0(r2);;
+2;sum += arr[i];
+1;00000010;E0012000;add r0, r0, r4;;
+1;00000014;E1110020;addi r2,r2, 4;;
+1;00000018;E1998020;subi r3,r3, 1;;
+1;0000001C;0B7FF801;branchnz+ loop;;
+1;00000020;EB000008;ret;;