Information on Blitz Compiler?
BlitzMax Forums/BlitzMax Programming/Information on Blitz Compiler?
| ||
I'm wondering how exactly the Blitz compiler works. I know that it spits out a .asm file. But where is this compiled? Do we have the compiler source? Is it possible to directly inline assembly in Blitz or do we need to wrap it in C externs? |
| ||
fasm(.exe) compiles asm to "exe". Asm is generated by bcc(.exe) the only (still) proprietary part of BlitzMax (and therefor "closed source"). "Non function"-functions are implemented in some files in Brl.Blitz - like "precompiled" code. bye Ron |
| ||
It's just bmx to asm. Mark made an example compiler in the code archives that I often look at: http://www.blitzbasic.com/codearcs/codearcs.php?code=51 You may have to hit "Download Source Code" because it doesn't always display the full code in the code-area. |
| ||
The compiler is just about the only thing in blitz that's closed source. Everything else is open. You can't do inline assembly, but you can import an assembly language file in fasm syntax and it will get compiled and linked into your program.. example here: http://www.blitzbasic.com/Community/posts.php?topic=98877 |
| ||
There's a section in the Max documentation about using C and asm in your code. |
| ||
I got a question for you guys... if a 3D Engine was made in BlitzMax, could it get compiled to asm and then say, used in C++? Maybe create a wrapper to call the asm commands? Would that work |
| ||
With the right steps, BlitzMax code could be compiled to a DLL so it would be available to any language (on Windows) that can import such a library. http://www.blitzbasic.com/Community/posts.php?topic=50045 http://www.blitzbasic.com/Community/posts.php?topic=66616 http://www.blitzbasic.com/Community/posts.php?topic=90797 http://www.blitzbasic.com/Community/posts.php?topic=63706 This is how Leadwerks 2.0 was made if I'm not mistaken. I'm not sure how you would generate a "Shared Library" for Linux (perhaps GCC) and MacOS (XCode). |
| ||
Forgot all about libraries when I made that post :P thanks Kryzon! |