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 !

7 Years
Discussion Span
Last Post by camthalion95

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!


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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.