Convert kernel library asm s to c#857
Open
uyjulian wants to merge 1 commit into
Open
Conversation
Member
|
I'm fine with this, @rickgaiser ? |
rickgaiser
reviewed
May 25, 2026
Member
rickgaiser
left a comment
There was a problem hiding this comment.
I'm all for moving thing away from assembly and towards more readable 'C' code, but a large part of this PR just places complete assembly functions inside C and that makes no sense to me.
Comment on lines
+19
to
+27
| "\t" ".globl UModeCallbackDispatcher" "\n" | ||
| "\t" ".ent UModeCallbackDispatcher" "\n" | ||
| "\t" "UModeCallbackDispatcher:" "\n" | ||
| "\t" "\t" "lui $sp, 0x0008" "\n" | ||
| "\t" "\t" "jalr $v1" "\n" | ||
| "\t" "\t" "addiu $sp, $sp, 0x1fc0" "\n" | ||
| "\t" "\t" "addiu $v1, $zero, -8" "\n" | ||
| "\t" "\t" "syscall" "\n" | ||
| "\t" ".end UModeCallbackDispatcher" "\n" |
Comment on lines
-15
to
-23
| .globl UModeCallbackDispatcher | ||
| .ent UModeCallbackDispatcher | ||
| UModeCallbackDispatcher: | ||
| lui $sp, 0x0008 | ||
| jalr $v1 | ||
| addiu $sp, $sp, 0x1fc0 | ||
| addiu $v1, $zero, -8 | ||
| syscall | ||
| .end UModeCallbackDispatcher |
Member
Author
|
The C version looks better to my eyes since it actually has syntax highlighting. (If there is a syntax plugin for mips asm+C preprocessor that would be nice) I also separated each function into its own asm block for improved readability / separation, and added The C version can also participate in rearrangement and dropping of code (without needing |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Makes it easier to read, especially with all the C preprocessor macros