summaryrefslogtreecommitdiff
path: root/Year_1/Computer_Architecture/division.asm
blob: 6b9f80a4dfe2f1b1d73d0bddb9bc9a0134f9e1c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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