TIMES
and DUP
are assembler specific commands, and as such aren't part of x86 assembly language. Same goes for $
and $$
.
The $
symbol denotes the current address of the statement, and the $$
denotes the address of the beginning of current section. So the lines with DUP
and TIMES
calculate the current address in the section and subtracts it from 510. This effectively just zeroes out the section from the beginning to the current address.
It depends on what you want to write.
If all you want to write is a specific function that will be called from a "driver" program written in C, and if you do not need to perform a system call, then the C compiler you use is much more important than the architecture, because it prescribes how you have to expose your functions.
If you are instead interested in writing full fledged applications in assembly and making use of system calls — or writing device drivers — then the operating system is very relevant as well.
So basically, pick the one you want to write programs for.
In FreeBSD's developers handbook, there is a chapter devoted to assembly programming. It is short and well written, and contains interesting examples, culminating with a simple CGI script(!). You can read it to get a feeling:
http://www.freebsd.org/doc/en/books/developers-handbook/x86.html
P.S.: Assembly is one of the very first languages I learned in the middle of the nineties. I learned it on an MS-DOS 6.22 system, using Isaacson's shareware assembler and Ralf Brown's interrupt list… thanks to Virtual Box you can probably get that feeling again! :-)
Best Answer
For the most part you shouldn't notice any problems at all. Any introductory text will be using very common mnemonics (commands) and macros. Intel tried to introduce a 64-bit processor, IA-64 Itanium, that broke compatibility with the 8086 family of processors. AMD stepped up and designed a 64 bit processor that continued to work with older programming. Obvoiusly, this is what ended up being popular and Intel had to drop IA-64 and make something to work like AMD's.(Duntemann 106-107)
So now both AMD and Intel work from a set of instructions that work almost exactly the same. Little things here and there, but because the market demands it there are little differences to us the programmers. Anything you'll be learning will address when a particular mnemonic came along and which models it begins working on, for all but the latest and most obscure stuff you probably won't need for awhile anyway.
I would highly recommend Jeff Duntemann's Step by Step Assembly language. I learned from this originally 15 years ago. I was going to relearn it, and bought some other book... It just didn't work. So I found that Duntemann had released a new edition in 2009. It does a quick cover of the differences with some aspects of x86_64 but focuses on 32 bit. It really a back to front programming guide with more than just assembly. Editing, good commenting, linking, how the cpu moves data, base number counting, etc.
His website. http://duntemann.com/assembly.html
Amazon link for the book: http://www.amazon.com/Assembly-Language-Step---Step-Programming/dp/0470497025/ref=sr_1_1?ie=UTF8&qid=1367027229&sr=8-1&keywords=jeff+duntemann