From d2edbc38cac8da52f58c5cd3da6c0c625fa05736 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Sat, 6 Feb 2021 19:56:36 +0100 Subject: conf: rename --- Year_1/Computer_Architecture/division.asm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 Year_1/Computer_Architecture/division.asm (limited to 'Year_1/Computer_Architecture/division.asm') diff --git a/Year_1/Computer_Architecture/division.asm b/Year_1/Computer_Architecture/division.asm new file mode 100644 index 0000000..6b9f80a --- /dev/null +++ b/Year_1/Computer_Architecture/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