-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#MERGE: Linear Algebra module mass update (broken) (#112)
- Loading branch information
1 parent
f2a5080
commit 2bd9b74
Showing
95 changed files
with
13,240 additions
and
4,297 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.globl asm_function | ||
asm_function: | ||
// Assembly code to add two integers | ||
// Parameters are passed in registers: a in %edi, b in %esi | ||
// Result is stored in %eax | ||
// Load a into %eax | ||
mov %edi, %eax | ||
|
||
// Add b to %eax | ||
add %esi, %eax | ||
|
||
// Add c to %eax | ||
add %edx, %eax | ||
|
||
// Subtract d from %eax | ||
sub %ecx, %eax | ||
|
||
ret // Return | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <stdio.h> | ||
|
||
// Declare the assembly function as an external function | ||
extern int asm_function(int a, int b, int c, int d); | ||
|
||
int add (int a, int b, int c) { | ||
int d = 2; | ||
|
||
return asm_function(a, b, c, d); | ||
} | ||
|
||
int main() { | ||
int a = 5; | ||
int b = 7; | ||
int c = 10; | ||
//int result = asm_function(5, 7); | ||
int result = add(a, b, c); | ||
printf("Result: %d\n", result); | ||
return 0; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.