Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
labo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ISC2
pro
labo
Commits
529b9292
Commit
529b9292
authored
1 year ago
by
iliya
Browse files
Options
Downloads
Patches
Plain Diff
jsp ce que j'ai changé
parent
d1a35cfe
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
2-3_asm/src/assembleur.s
+28
-2
28 additions, 2 deletions
2-3_asm/src/assembleur.s
2-3_asm/src/labo2.3_asm.c
+7
-2
7 additions, 2 deletions
2-3_asm/src/labo2.3_asm.c
with
35 additions
and
4 deletions
2-3_asm/src/assembleur.s
+
28
−
2
View file @
529b9292
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
2-3_asm/src/labo2.3_asm.c
+
7
−
2
View file @
529b9292
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment