-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
Inline Assembly? Include .asm? #4444
Comments
I haven't ever seen any official documentation on it, but there is most definitely an |
Yes, there is. You can "foreign import" asm files directly, and the compiler will build them (using
As far as I remember the "linking" part doesn't apply to object files, so it might only work if you're building an executable or a shared object. |
Inline assembly is "planned" but we are not saying what it will be precisely. This is mainly because when people say they want inline assembly, it's not obvious what exactly they really want. I understand people have used inline assembly in other compilers before and the two general approaches are to have a string literal (GCC style) or have actual parsed tokens within an However I am still wondering if people even want actually inline assembly or rather have a pseudo-procedure where its entire body is just assembly instead, but that body still understands basic aspects of the Odin type system. THE FOLLOWING IS PSEUDO-CODE AND NOT A PROPOSAL thingymabob :: asm(x: i32, y: i32) -> (z: f32, w: f32) {
// assembly goes here
// this isn't actually a procedure but when it is called, it will truly inline the code
} There is the other aspect where any use of assembly is done, the file must be guarded with the specific architecture for it to be allowed, e.g. |
Hello,
Is inline assembly planned before 1.0?
Odin looks interesting to me, but I need to be able to write assembly
If not planned, is there a way to load .asm files?
Thanks, and sorry if that's not the right place to ask, there was a "suggest new feature" button for the issue so I figured I'd try
The text was updated successfully, but these errors were encountered: