flat assembler
Message board for the users of flat assembler.

Index > Main > 32- and 64bit interopability

Author
Thread Post new topic Reply to topic
godomega



Joined: 21 Jun 2005
Posts: 8
godomega 12 Mar 2010, 20:57
I've been taking myself some interest in x86 assembly and just exploring myself the world of 64 bit programs.
I'm very interested how the boundaries between 64 bit 32 bit applications are defined.
How different are the instruction sets (the resulting opcodes) between these two?
And take if a 32 bit process is run by windows 7 (64 bit) Would it be theoretically possible to inline 64 bit code as the processor supports it?
Not as in would any assembler allow it but take it as if it's done from a hex-editor.

Thanks in advance.
Post 12 Mar 2010, 20:57
View user's profile Send private message Reply with quote
kohlrak



Joined: 21 Jul 2006
Posts: 1421
Location: Uncle Sam's Pad
kohlrak 12 Mar 2010, 21:15
The simple explanation is, 32bit code is run in a sort of compatibility mode. Some instructions (pushd for example) don't work in 64bit mode. Check the fasm manual for the details of removed instructions. The main difference is that now addresses must be 64bit instead of 32bit, and you have more registers to play with. Also, register calling convention is becoming popular again and some are preserved in the ABI.
Post 12 Mar 2010, 21:15
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 12 Mar 2010, 21:55
godomega,

Intel/AMD manuals may be not an easy reading, but they're thorough. 64-bit instructions look like their 32-bit counterparts with various REX prefixes, and in legacy/compatibility modes they can't be encoded (REX prefix becomes inc/dec opcode).
Post 12 Mar 2010, 21:55
View user's profile Send private message Reply with quote
a115433



Joined: 05 Mar 2010
Posts: 144
a115433 12 Mar 2010, 22:57
uhmmm
64 bit mode is also as fucked up as the rest of architecture.

you just have to learn it.
it will be easier than learning protected mode, since its only extension, and many things work like before but are extended.
Post 12 Mar 2010, 22:57
View user's profile Send private message Reply with quote
godomega



Joined: 21 Jun 2005
Posts: 8
godomega 12 Mar 2010, 23:06
Ok thanks baldr that was the information I needed to hear Wink.
Post 12 Mar 2010, 23:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.