4 ms·
I agree that passing `ax` and `bx` as inputs is better than setting them in the inline asm, but I don't like the idea of setting registers that shouldn't get ch
by josephcsible 6y ago
I agree that passing `ax` and `bx` as inputs is better than setting them in the inline asm, but I don't like the idea of setting registers that shouldn't get changed as outputs "just in case".
- JoshTriplett 6y agoIt's not a theoretical consideration. It's quite common for BIOS and firmware code to clobber registers that it isn't supposed to; see the code I mentioned in the Linux kernel, which arose through real-world bugs that were incredibly hard to debug.
- josephcsible 6y agoBut where do you draw the line? What if it clobbers the stack pointer?
- JoshTriplett 6y agoThen it won't be able to return at all, and people will notice more quickly.