I'm looking at making a hardware debug tool that runs on the bare CPU (x86), 32-bit protected mode and no OS. Due to time constraints, I won't be writing the tool all in x86 assembly. I like the Ada language (but am inexperienced with it) and thought it might be interesting to use Ada rather than C for this project.
With C one can use inline assembly or call subprograms written in assembly to access the BIOS for basic things like keyboard I/O or displaying text on the screen. Does Ada have a similar capability? And if so, does anyone know of any resources or tutorials for calling assembly methods and linking with them?
You can use inline assembly code in Ada. You need to use the System.Machine_Code
package which provides the (overloaded) Asm
function.
The GNAT Reference manual has a section on Machine Code Insertions, and while it's GNAT-specific, one should be able to get a general sense of how it works even if you're using a different compiler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With