Segona part del puzzle
This commit is contained in:
27
aoc_25_1_2/src/right.s
Normal file
27
aoc_25_1_2/src/right.s
Normal file
@@ -0,0 +1,27 @@
|
||||
.global right
|
||||
.type right, "function"
|
||||
.p2align 4
|
||||
|
||||
right:
|
||||
ldr x1, [x0]
|
||||
ldr x2, [x0, #8]
|
||||
ldr x3, [x0, #16]
|
||||
b right1
|
||||
right1:
|
||||
adds x1, x1, #1
|
||||
cmp x1, #99
|
||||
b.gt loop0
|
||||
b rotate
|
||||
loop0:
|
||||
mov x1, xzr
|
||||
add x3, x3, #1
|
||||
b rotate
|
||||
rotate:
|
||||
subs x2, x2, #1
|
||||
b.eq finish
|
||||
b right1
|
||||
finish:
|
||||
str x1, [x0]
|
||||
str x3, [x0, #16]
|
||||
mov x0, xzr
|
||||
ret
|
||||
Reference in New Issue
Block a user