Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
void b_print_string(char *str)
{
asm volatile ("call 0x00100010" : : "S"(str)); // Make sure source register (RSI) has the string address (str)
}
This used to compile properly under Arch Linux with GCC 4.5.0 but trying it today under Ubuntu 10.10 with GCC 4.4.5 doesn't produce the output I'm expecting.
In AT&T syntax a constant value without a $ prefix is treated as a dereferenced pointer. As gerryg400 pointed out you need a "call $0x00100010" instead of a "call 0x00100010".
I didn't try to compile that and I don't know x86(_64)? very well, but I guess your problem could be that the compiler uses 32-bit register when you use 32-bit value, and it thinks the programmer is wise enough to do correct wizardry with inline assembly and doesn't convert your 32-bit to 64-bit which would be correct in this spot.