Ajout des travaux effectuer
This commit is contained in:
10
23SCR/SCR019-ARM/SCR019.txt
Normal file
10
23SCR/SCR019-ARM/SCR019.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
I/
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
II/
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
III/
|
||||
BIN
23SCR/SCR019-ARM/mult-bin-loop.o
Normal file
BIN
23SCR/SCR019-ARM/mult-bin-loop.o
Normal file
Binary file not shown.
30
23SCR/SCR019-ARM/mult-bin-loop.s
Normal file
30
23SCR/SCR019-ARM/mult-bin-loop.s
Normal file
@@ -0,0 +1,30 @@
|
||||
.equ SYS_EXIT,93
|
||||
.data
|
||||
int1: .word 0xa2
|
||||
int2: .word 0xb
|
||||
.text
|
||||
.globl _start
|
||||
_start:
|
||||
|
||||
adr x5,int1
|
||||
ldr w1,[x5]
|
||||
uxtw x1,w1 // int1 is in x1
|
||||
|
||||
adr x6,int2
|
||||
ldr w2,[x6]
|
||||
uxtw x2, w2// int2 is in x2
|
||||
|
||||
mov x0,#0 // result is in x0
|
||||
|
||||
loop:
|
||||
cbz x2,exit
|
||||
tbz x2,#0,next
|
||||
add x0,x0,x2
|
||||
next:
|
||||
lsl x1,x1,#1
|
||||
lsr x2,x2,#1
|
||||
b loop
|
||||
exit: mov x0,#0
|
||||
mov w8,#SYS_EXIT
|
||||
svc #0x0
|
||||
.end
|
||||
18
23SCR/SCR019-ARM/small-loop.s
Normal file
18
23SCR/SCR019-ARM/small-loop.s
Normal file
@@ -0,0 +1,18 @@
|
||||
.equ SYS_EXIT,93
|
||||
.data
|
||||
int: .word 12
|
||||
.text
|
||||
.globl _start
|
||||
_start: adr x5, int
|
||||
ldr w0,[25]
|
||||
mov w1,#1
|
||||
mov w2,#0
|
||||
kfc : cmp w1,w0
|
||||
b.gt suite
|
||||
add w2,w2,w1
|
||||
add w1,w1,#1
|
||||
b kfc
|
||||
suite : mov x0,x2
|
||||
mov w8,#SYS_EXIT
|
||||
svc #0
|
||||
.end
|
||||
Reference in New Issue
Block a user