Starting Assembly
I'm new to assembly language, and would like to learn. I have Vis开发者_StackOverflowta-64 (will be upgraded to Windows 7 64), and I will soon be reinstalling 32-bit Linux, but I will end up programming on both systems, probably using NASM. I was wondering if 32-bit assembly programs will compile and run on my system. If not, what are the major differences and limitations, and where can I learn to program on a 64-bit system?
NASM does not have support for 64 bit(or wait, is the support it has added recently?). I recommend YASM, it is extremely similar to NASM but it's more active and I believe supports more platforms.
64bit assembly programming is quite different from 32 bit(assuming your talking x86). All memory accesses are now relative to RIP instead of being absolute(without specific overrides). I would recommend learning 32 bit programming first because there is more documentation out there for it. I do not recommend learning both at the same time!
Also, I think that using Linux would be easier as it's easier to interface with the standard C library(unless you want to be a man and do system calls).
Also, with 64 bit systems, the calling convention is different for windows and linux on 64 bit machines. This is something you must watch when your interfacing with existing libraries.
EDIT: Oh and yes, 64 bit vista will run 32 bit programs just fine(iirc you can detect that you are in 32 bit mode from a 64 bit OS). I would highly recommend just developing in 32 bit on both Linux and Vista, as they have the same calling conventions(iirc) so any code you use to interface with C libraries can be for the most part platform independent
64 bit vista will run 32-bit executables just fine
They should work, but remember that usually assembly code is platform-specific, so assembly code written for Linux won't probably assemble on Windows.
精彩评论