-
Notifications
You must be signed in to change notification settings - Fork 0
Test loops #8
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
Test loops #8
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f77e898
instruction: split arm, riscv opcodes and add registers
Samir-Rashid 98fe35e
translate: add minimal riscv translation map
Samir-Rashid 89f7276
meta: rename `test/` -> `tests/`
Samir-Rashid 1f770cc
merge main
trdavidt e157c93
Merge branch 'main' of github.com:Samir-Rashid/binary-room
trdavidt c0d863b
fibonacci and prime int tests
trdavidt 6e70538
fix: comment instruction `b`ranch formatting hack, fix riscv asm
Samir-Rashid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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
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,65 @@ | ||
|
|
||
| .text | ||
|
|
||
| .global _start | ||
| .global _main | ||
|
|
||
| .balign 4 | ||
| _start: | ||
| bl main | ||
| mov x8, #93 | ||
| svc #0 | ||
|
|
||
| .balign 4 | ||
| _main: | ||
| main: | ||
|
|
||
| sub sp, sp, 64 | ||
| str x29, [sp, 56] | ||
| add x29, sp, 64 | ||
| str xzr, [x29, -64] | ||
| str xzr, [x29, -56] | ||
| str xzr, [x29, -48] | ||
| str xzr, [x29, -40] | ||
| str xzr, [x29, -32] | ||
| mov x5, 1 | ||
| str w5, [x29, -60] | ||
| mov x5, 2 | ||
| str w5, [x29, -20] | ||
| b .L2 | ||
| .L3: | ||
| ldr w5, [x29, -20] | ||
| sub x5, x5, 1 | ||
| sxtw x5, w5 | ||
| lsl x5, x5, 2 | ||
| sub x5, x5, 16 | ||
| add x5, x5, x29 | ||
| ldr x4, [x5, -48] | ||
| ldr x5, [x29, -20] | ||
| sub x5, x5, 2 | ||
| sxtw x5, w5 | ||
| lsl x5, x5, 2 | ||
| sub x5, x5, 16 | ||
| add x5, x5, x29 | ||
| ldr x5, [x5, -48] | ||
| add x5, x4, x5 | ||
| sxtw x4, w5 | ||
| ldr x5, [x29, -20] | ||
| lsl x5, x5, 2 | ||
| sub x5, x5, 16 | ||
| add x5, x5, x29 | ||
| str x4, [x5, -48] | ||
| ldr x5, [x29, -20] | ||
| add x5, x5, 1 | ||
| str w5, [x29, -20] | ||
| .L2: | ||
| ldr x5, [x29, -20] | ||
| sxtw x4, w5 | ||
| mov x5, 9 | ||
| cmp x4, x5 | ||
| ble .L3 | ||
| ldr w5, [x29, -28] | ||
| add x0, x5, 0 | ||
| ldr x29, [sp, 56] | ||
| add sp, sp, 64 | ||
| blr lr |
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.