24 game/Solve: Difference between revisions
Content added Content deleted
(add task to aarch64 assembly raspberry pi) |
(correct result display for arm assembly raspberry pi) |
||
Line 1,330: | Line 1,330: | ||
mov r9,#1 |
mov r9,#1 |
||
1: |
1: |
||
ldr |
ldr r5,[r6,r9,lsl #2] @ operand 1 |
||
ldr r11,[r7,r9,lsl #2] @ operand 2 |
ldr r11,[r7,r9,lsl #2] @ operand 2 |
||
ldr r12,[r8,r9,lsl #2] @ operator |
ldr r12,[r8,r9,lsl #2] @ operator |
||
Line 1,338: | Line 1,338: | ||
beq 2f |
beq 2f |
||
b 3f |
b 3f |
||
2: @ if division or |
2: @ if division or soustraction |
||
cmp |
cmp r5,r11 @ reverse operand if operand 1 is < operand 2 |
||
movlt r2, |
movlt r2,r5 |
||
movlt |
movlt r5,r11 |
||
movlt r11,r2 |
movlt r11,r2 |
||
3: @ conversion operand 1 = r0 |
3: @ conversion operand 1 = r0 |
||
mov r0,r5 |
|||
mov r1,#10 |
mov r1,#10 |
||
bl division |
bl division |
||
Line 1,372: | Line 1,373: | ||
str r0,[r10,r4] @ conversion sous total |
str r0,[r10,r4] @ conversion sous total |
||
add r4,r4,#1 |
add r4,r4,#1 |
||
cmp |
cmp r12,#'+' |
||
addeq r0,r5,r11 |
|||
cmp |
cmp r12,#'-' |
||
subeq r0,r5,r11 |
|||
cmp |
cmp r12,#'*' |
||
muleq r0,r5,r11 |
|||
moveq r0,#TOTAL @ display total |
|||
cmp r12,#'/' |
|||
udiveq r0,r5,r11 |
|||
mov r1,#10 |
mov r1,#10 |
||
bl division |
bl division |
||
Line 1,449: | Line 1,453: | ||
/***************************************************/ |
/***************************************************/ |
||
.include "../affichage.inc" |
.include "../affichage.inc" |
||
</lang> |
</lang> |
||
{{output}} |
{{output}} |