I was going through some documents and web pages on building a boot loader !
I am new to assembly programming.

I want to know whether I should use NASM or MASM for assembly programming ?

What is the meaning of this code snippet :

.286							   ; CPU type
.model TINY						   ; memory of model
extrn				_BootMain:near	   ; prototype of C func

How do we know the cpu type ?
What is the use of ':near' ?

Please help !

well, the CPU model is what the code is designed to f\run on. i'm assuming you're using an x86-based (intel) system so the code probably uses 286 or higher instructions (e.g. it won't run on an 8086). The :near usually signifies a

jmp near

instruction.. there are already-built bootloaders you can try out if you're desperate. try out the one from MikeOS, it's an open-source project and you're free to distribute it as long as you give credits to the author for the bootloader. Hope this helps!

http://mikeos.berlios.de/

Make sure to come back to DaniWeb with any more questions! we're always here to help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.