Hi Zulfi,
As Martin says, you've got a bit of a "mismatch" there. Nasm will produce several "linkable object" formats. "-f elf" asks for an "Executable Linkable Format" (ELF). The first thing in a ELF object is 7f, 'E', 'L', 'F' - since your error mentions 7f, it doesn't look like it got far. :)
Your linker is expecting an "OMF" (Object Module Format) object, obtained by Nasm's "-f obj" switch.
The code Martin showed you might just work with that linker - try it. If not, you can get Alink here -
http://alink.sf.netWhat you've got there isn't actually a "bios interrupt", but a "Linux interrupt" - "the" Linux interrupt, in fact. Won't work in Windows, and bios interrupts won't work in Linux (without jumping through hoops I haven't figured out yet). The code, the output format, the linker, and the OS all need to match. This is the primary purpose of a "hello world" program - to get the tools working together. It gets easier after that.
Unless I'm mistaken, WinXP still has a "fake dos" subsystem with it. This will allow you to use bios interrupts, and experiment with segmented memory models. If your intention is to learn to write a bootsector, this might be something you want to do. (bonus: Nasm can do .com files without any linker at all!) If the bootsector was a "false trail", you're probably better off to learn Windows programming.
Speaking of "the bootsector", I tried to approve your message to the nasm-users list, but haven't seen it posted. Either I screwed up, or that "drunken GNU" mailman screwed up. Neither of us are infaillable! Could you re-post? Or maybe this is a better place to communicate...
Nice example, Martin. Thanks!
Best,
Frank