Skip to content
Snippets Groups Projects
Commit 529b9292 authored by iliya's avatar iliya
Browse files

jsp ce que j'ai changé

parent d1a35cfe
No related branches found
No related tags found
No related merge requests found
...@@ -92,8 +92,12 @@ err_ex2: ...@@ -92,8 +92,12 @@ err_ex2:
*****************************************************/ *****************************************************/
.thumb_func .thumb_func
funcexo3: funcexo3:
// push {r4}
// c in r4
// mov r
bx lr
// bx lr
...@@ -105,6 +109,28 @@ funcexo3: ...@@ -105,6 +109,28 @@ funcexo3:
*****************************************************/ *****************************************************/
.thumb_func .thumb_func
funcexo4: funcexo4:
subs r0, #1
bne rcall
mov r0, #1
// add sp, #8
bx lr
rcall:
push {r0, lr}
bl funcexo4
pop {r0, lr}
add r0, r0
bx lr
exit:
pop {r0, lr}
add r0, r0
bx lr
/*funcexo4:
mov r1, r0 mov r1, r0
push {r0, r1, lr} push {r0, r1, lr}
bl lhs_fact bl lhs_fact
...@@ -145,7 +171,7 @@ rcall: ...@@ -145,7 +171,7 @@ rcall:
pop {r0, r1, lr} pop {r0, r1, lr}
add r0, r1 add r0, r1
bx lr bx lr*/
//.weak add_sat //.weak add_sat
......
...@@ -22,9 +22,10 @@ typedef struct { ...@@ -22,9 +22,10 @@ typedef struct {
void funcexo1(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t *); void funcexo1(uint32_t, uint32_t, uint32_t, uint32_t, uint32_t *);
uint32_t funcexo2(uint32_t a, uint32_t b, uint32_t c, uint32_t d); uint32_t funcexo2(uint32_t a, uint32_t b, uint32_t c, uint32_t d);
int funcexo3(numbers_t s); int funcexo3(numbers_t s);
int funcexo4(int n);
/* global variables */ /* global variables */
int exo = 2; // change this number with the exercise number you want to test; int exo = 4; // change this number with the exercise number you want to test;
int main(void) int main(void)
{ {
...@@ -41,13 +42,17 @@ int main(void) ...@@ -41,13 +42,17 @@ int main(void)
res=funcexo2(0x10000, 0x10005, 6,7); // doit retourner 0 res=funcexo2(0x10000, 0x10005, 6,7); // doit retourner 0
res=funcexo2(0xF000, 0x8805, 0x8700,0xF760); // doit retourner 0 res=funcexo2(0xF000, 0x8805, 0x8700,0xF760); // doit retourner 0
break; break;
default: case 3:
s.a=5; s.b=-3; s.c=-1; s.d=10; s.e=3; s.a=5; s.b=-3; s.c=-1; s.d=10; s.e=3;
res_ref=s.a+s.b+s.c+s.d+s.e; res_ref=s.a+s.b+s.c+s.d+s.e;
res=funcexo3(s); res=funcexo3(s);
if (res!=res_ref) if (res!=res_ref)
while(1); // error while(1); // error
break; break;
default:
res=funcexo4(4); // doit retourner 5
res=funcexo4(1); // doit retourner 1
break;
} }
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment