Skip to content
Snippets Groups Projects
Commit 12d48aea authored by iliya's avatar iliya
Browse files

feat: ex2 labo3 finished

parent 8229509b
Branches
No related tags found
No related merge requests found
......@@ -55,7 +55,7 @@
<tool id="com.crt.advproject.link.exe.debug.742972049" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">
<option id="com.crt.advproject.link.arch.1188867588" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.link.thumb.1248295488" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.script.1785160227" name="Linker script" superClass="com.crt.advproject.link.script" value="labo2_3_asm_Debug.ld" valueType="string"/>
<option id="com.crt.advproject.link.script.1785160227" name="Linker script" superClass="com.crt.advproject.link.script" value="2-3_asm_Debug.ld" valueType="string"/>
<option id="com.crt.advproject.link.manage.994083104" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
<option id="gnu.c.link.option.nostdlibs.1585246591" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.other.2121008218" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
......@@ -139,7 +139,7 @@
<tool id="com.crt.advproject.link.exe.release.1012924607" name="MCU Linker" superClass="com.crt.advproject.link.exe.release">
<option id="com.crt.advproject.link.arch.287050390" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>
<option id="com.crt.advproject.link.thumb.1115921405" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>
<option id="com.crt.advproject.link.script.754134938" name="Linker script" superClass="com.crt.advproject.link.script" value="labo2_3_asm_Release.ld" valueType="string"/>
<option id="com.crt.advproject.link.script.754134938" name="Linker script" superClass="com.crt.advproject.link.script" value="2-3_asm_Release.ld" valueType="string"/>
<option id="com.crt.advproject.link.manage.1283042874" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>
<option id="gnu.c.link.option.nostdlibs.2116952709" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.c.link.option.other.2082339787" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">
......
......@@ -29,7 +29,7 @@ funcexo1:
eor r0, r2
eor r0, r3
str r0, [r4]
pop {r4}
pop {r4} // restitution du registre
bx lr
......@@ -58,8 +58,27 @@ mult32:
*****************************************************/
.thumb_func
funcexo2:
push {r4, r5, lr} // sauvegarde du registre
bl mult32
cmp r1, #1
beq err_ex2
mov r4, r0
mov r0, r2
mov r1, r3
bl mult32
cmp r1, #1
beq err_ex2
mov r5, r0
adds r4, r5
bhi err_ex2
mov r0, r4
pop {r4, r5, lr} // restitution du registre
bx lr
bx lr
err_ex2:
pop {r4, r5, lr} // restitution du registre
mov r0, #0
bx lr
/*****************************************************
......
......@@ -24,7 +24,7 @@ uint32_t funcexo2(uint32_t a, uint32_t b, uint32_t c, uint32_t d);
int funcexo3(numbers_t s);
/* global variables */
int exo = 1; // change this number with the exercise number you want to test;
int exo = 2; // 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