Skip to content
Snippets Groups Projects
Commit 2c0dbca5 authored by iliya's avatar iliya
Browse files

fix: ex2 working, ex3 next

parent a4b64ecf
No related branches found
No related tags found
No related merge requests found
......@@ -42,20 +42,21 @@ add_err:
.thumb_func
funcexo2:
// r3 index for loop
mov r3, #0
mov r3, #1
cmp r3, r2
blt funcexo2_for_loop
mov r0, #1
bx lr
funcexo2_for_loop:
add r3, #1
ldr r4, [r0], #4
adds r5, r4, r4
adds r4, r4
bhs err
str r1, [r5], #4
str r4, [r1], #4
cmp r3, r2
blt funcexo2_for_loop
blo funcexo2_for_loop
mov r0, #1
bx lr
err:
mov r0, #0
......@@ -63,13 +64,33 @@ err:
.thumb_func
majuscule:
//index while loop
mov r1, #0
debut_while:
ldr r2, [r0], #1
cmp r2, #0
bne funcexo3_while_loop
bx lr
funcexo3_while_loop:
cmp r2, #97
bge second_cond
bx lr
second_cond:
cmp r2, #122
ble if_cond
bx lr
if_cond:
sub r2, #32
str r2, [r0, r1]
add r1, #1
b debut_while
//.weak add_sat
.ltorg
......@@ -25,7 +25,7 @@ uint32_t funcexo2(uint32_t *, uint32_t *, uint32_t);
void majuscule(char *s);
/* global variables */
int exo = 2; // change this number with the exercise number you want to test;
int exo = 3; // change this number with the exercise number you want to test;
int main(void)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment