From b7b4a7678c69a4f23dd9bd7ef95613ed23498884 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Wed, 1 Apr 2020 23:04:30 +0200 Subject: feat: division operation for ASM --- I_anno/Architettura_Elaboratori/division.asm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 I_anno/Architettura_Elaboratori/division.asm 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 -- cgit v1.2.3-18-g5258