English 中文(简体)
Starting Assembly
原标题:

I m new to assembly language, and would like to learn. I have Vista-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.





相关问题
System Architecture

How do I determine whether the currently running Mac OS X system is of 32bit or 64bit machine?

Starting Assembly

I m new to assembly language, and would like to learn. I have Vista-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, ...

Does a 64-bit CruiseControl.NET exist?

Does a 64-bit CruiseControl.NET exist or do I need to install the 32-bit version? Our CI server is Server2003 64-bit. Currently I have been testing on WinXP Pro and no problems. If I do need to run ...

32bit application access to 64bit registry

I have an OS Shell written in 32bit that is replacing the Explorer.exe of a Vista machine. I run a utility which is also written in 32bit, which allows to switch between the Explorer shell and My ...

热门标签