forked from open-education-hub/hardware-software-interface
-
Notifications
You must be signed in to change notification settings - Fork 53
Promote main branch to x86_64 assembly.
#124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
84033b6
infra/actions: Add `x86_64` branch to linters
teodutu 1dfb5c0
labs/lab-02: Add x86_64 version
CristiSima 4751e8b
labs/lab-04: Add x86_64 version
CristianSLazar 6927624
labs/lab-08: Add x86_64 version of lab 8
denismarian1604 4619338
labs/lab-05: Add x86_64 version
mariapana b18a362
labs/lab-06: Add x86_64 version of lab 6
PetruCristian 3eaac8c
labs/lab-11: Adapt to x86_64
razvanvirtan 1cd0396
labs/lab-09: Changed reading materials for x86-64 version
RaduMantu c970485
labs/lab-09: Added reading material for GCC Extended ASM
RaduMantu 8c36d4b
labs/lab-09: Changed export-fix task
RaduMantu 93d0448
labs/lab-09: Changed include-fix task
RaduMantu 213237a
labs/lab-09: Changed max-c-calls task
RaduMantu 13fe8a5
labs/lab-09: Changed stack-frame task
RaduMantu 05fa878
labs/lab-09: Changed regs-preserve task
RaduMantu 1fa3dbc
labs/lab-09: Changed max-assembly-calls task
RaduMantu 7ba8733
labs/lab-09: Added 32-bit version of max-assembly-calls
RaduMantu a6c5cbf
labs/lab-09: Added 32-bit version of max-assembly-calls
RaduMantu 64987a6
labs/lab-07: Add x86_64 version of lab 7
PetruCristian 1c64dba
labs/lab-05: Fix script == check.
teodutu 4a721b1
deployment: Change CI to build the `x86` and `main` branches.
teodutu e19b7c5
labs/lab-0{2,7}: Apply suggestions from @Copilot.
teodutu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ on: | |
| pull_request: | ||
| branches: | ||
| - main | ||
| - x86_64 | ||
|
|
||
| jobs: | ||
| checkpatch: | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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,6 @@ | ||
| { | ||
| "files.associations": { | ||
| "*.c": "c", | ||
| "param.h": "c" | ||
| } | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,6 +3,6 @@ | |
| #ifndef ARRAY_H | ||
| #define ARRAY_H 1 | ||
|
|
||
| extern int v[5]; | ||
| extern int v[6]; | ||
|
|
||
| #endif // ARRAY_H | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ int main(void) | |
| print_chars_ref(); | ||
| print_shorts_ref(); | ||
| print_ints_ref(); | ||
| print_long_longs_ref(); | ||
|
|
||
| return 0; | ||
| } | ||
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,6 +3,6 @@ | |
| #ifndef ARRAY_H | ||
| #define ARRAY_H 1 | ||
|
|
||
| extern int v[5]; | ||
| extern int v[6]; | ||
|
|
||
| #endif // ARRAY_H | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -14,6 +14,7 @@ int main(void) | |
| print_chars(); | ||
| print_shorts(); | ||
| print_ints(); | ||
| print_long_longs(); | ||
|
|
||
| return 0; | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,14 +1,20 @@ | ||
| ; SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| %include "printf32.asm" | ||
| %include "printf64.asm" | ||
|
|
||
| section .text | ||
| global main | ||
| extern printf | ||
|
|
||
| main: | ||
| mov eax, 7 ; load the eax register with the value 7 | ||
| mov ebx, 8 ; load the ebx register with the value 8 | ||
| add eax, ebx ; add the value from ebx to the value from eax | ||
| push rbp | ||
| mov rbp, rsp | ||
|
|
||
| mov rax, 7 ; load the eax register with the value 7 | ||
| mov r8, 8 ; load the ebx register with the value 8 | ||
| add rax, r8 ; add the value from ebx to the value from eax | ||
| ; and store the result in eax | ||
| PRINTF32 `%d\n\x0`, eax ; print the value from the eax register | ||
| PRINTF64 `%d\n\x0`, rax ; print the value from the eax register | ||
|
|
||
| leave | ||
| ret |
This file contains hidden or 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 |
|---|---|---|
| @@ -1,22 +1,26 @@ | ||
| ; SPDX-License-Identifier: BSD-3-Clause | ||
|
|
||
| %include "printf32.asm" | ||
| %include "printf64.asm" | ||
|
|
||
| section .text | ||
| global main | ||
| extern printf | ||
|
|
||
| main: | ||
| mov eax, 4 | ||
| PRINTF32 `%d\n\x0`, eax | ||
| push rbp | ||
| mov rbp, rsp | ||
|
|
||
| mov r9, 4 | ||
| PRINTF64 `%d\n\x0`, r9 | ||
|
|
||
| jump_incoming: | ||
| jmp exit ; unconditional jump to the "exit" label | ||
|
|
||
| mov eax, 7 ; this code is unreachable, therefore not executed | ||
| mov ebx, 8 | ||
| add eax, ebx | ||
| PRINTF32 `%d\n\x0`, eax | ||
| mov r9, 7 ; this code is unreachable, therefore not executed | ||
| mov rbx, 8 | ||
| add r9, rbx | ||
| PRINTF64 `%d\n\x0`, r9 | ||
|
|
||
| exit: | ||
| leave | ||
| ret |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.