summaryrefslogtreecommitdiff
path: root/I_anno/Architettura_Elaboratori
diff options
context:
space:
mode:
authorSanto Cariotti <dcariotti24@gmail.com>2020-04-01 23:04:30 +0200
committerSanto Cariotti <dcariotti24@gmail.com>2020-04-01 23:04:30 +0200
commitb7b4a7678c69a4f23dd9bd7ef95613ed23498884 (patch)
tree96273565729ee56a3b2b490eba12f8766fb1ee20 /I_anno/Architettura_Elaboratori
parent31037bbfd50d9f1e04045db056dab8e39261bc11 (diff)
feat: division operation for ASM
Diffstat (limited to 'I_anno/Architettura_Elaboratori')
-rw-r--r--I_anno/Architettura_Elaboratori/division.asm23
1 files changed, 23 insertions, 0 deletions
diff --git a/I_anno/Architettura_Elaboratori/division.asm b/I_anno/Architettura_Elaboratori/division.asm
new file mode 100644
index 0000000..6b9f80a
--- /dev/null
+++ b/I_anno/Architettura_Elaboratori/division.asm
@@ -0,0 +1,23 @@
+op_a dcd 42
+op_b dcd 6
+
+ mov r0, #op_a
+ ldr r1, [r0]
+
+ mov r0, #op_b
+ ldr r2, [r0]
+
+ mov r0, #0
+
+loop
+ cmp r1, r2
+ blt loop_end
+
+ sub r1, r1, r2
+ add r0, r0, #1
+
+ b loop
+
+loop_end
+
+ end