I've been studying Demo 5 a lot, and I was thinking we could implement <tt>puts()</tt> using inline assembly.
At the beginning of <tt>kmain()</tt>, there would be asm that defines the <tt>Print</tt> macro for printing the string.
Then there would be the <tt>puts()</tt> function itself. It would go something like this:
Code: Select all
inline unsigned char _cdecl puts (unsigned char str)
{
_asm {
msg db str,13,10,0
mov si, msg
call Print
}
EDIT: Wait, that'd only work for real mode....