diff options
Diffstat (limited to 'Year_1/Computer_Architecture/division.asm')
-rw-r--r-- | Year_1/Computer_Architecture/division.asm | 23 |
1 files changed, 23 insertions, 0 deletions
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 |