Jump to content

New to Assembly

- - - - -

  • Please log in to reply
4 replies to this topic

#1
EdSquareCat

EdSquareCat

    Newbie

  • Members
  • PipPip
  • 12 posts
I'm new to assembly language, and would like to learn. I have Vista-64 (will be upgraded to Windows 7), and was wondering if 32-bit assembly programs will compile and run on my system. If not, what are the major differences, and where can I learn to program on a 64-bit system? I will soon be reinstalling 32-bit Linux, but I will end up programming on both systems. Which assembler should I use?

#2
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
Depends on the processor. Processors using Intel64 (aka IA-32e) architecture will choke on IA-32 programs, but processors with x86-64 architecture are more or less fully backwards compatible. There are only a few differences, i.e. you can't use inc or dec because those instructions have been remapped to the REX prefixes. A good place to start learning programming would be The Art of Assembly Language. There are versions for both Linux and Windows, as well as a generic version. For a soft conceptual introduction, you can also read my assembly tutorial series in the Assembly Tutorials section. (It's still a work in progress.)

As far as assemblers, I would recommend NASM, as it's portable and will work on Windows and Linux.

Edited by dargueta, 16 November 2009 - 05:07 PM.
Added links

sudo rm -rf /

#3
EdSquareCat

EdSquareCat

    Newbie

  • Members
  • PipPip
  • 12 posts
Thank you. I think I'll go with NASM or YASM. What are reasons to choose NASM over YASM or vice versa? I understand that they are very similar; I see very little difference between them.

#4
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,705 posts
  • Programming Language:C, Java, C++, PHP, Python, Perl, Assembly, Bash, Others
  • Learning:JavaScript
I've never used YASM, but there's a comparison between NASM and YASM on Wikipedia that you might want to look at.
sudo rm -rf /

#5
foxmuldr

foxmuldr

    Newbie

  • Members
  • Pip
  • 5 posts

dargueta said:

you can't use inc or dec because those instructions have been remapped to the REX prefixes.

Those instructions still work, just not specific encodings (upper-nibble on gp registers). The ones that were remapped were the single-byte versions for ah, bh, ch and dh. Single-byte encodings for al, bl, cl and dl still work, as do all 16-bit, 32-bit and memory versions (except 8-bit).

- Rick C. Hodgin

Edited by foxmuldr, 10 December 2009 - 09:11 PM.
expanded explanation





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users