64-bit long mode compatability with 32-bit instructions-GAS (Developers)
> Now it seems to work. Do I really need to make branching for 32-bit and
> 64-bit platform? Does it mean that if CPU is in long mode it is not
> compatible with 32b (and 16b) instructions? Then how does 64-bit windows
> run older 32-bit apps without recompiling? I know that it use some WoW64
> layer but I don't know what it is exactly doing. If I would use long mode
> under DOS then do I need to write all in 64-bit asm (otherwise will I got
> invalid opcode exception)?
My understanding (though I have yet to read extensively) is that x86-64 mode is incompatible with all previous modes, at least as implemented by Apple and, Windows. Essentially, this means they operate in Long-mode/64-bit mode. Linux/gcc supports "multilib" as you know, but I would have to venture a guess the ELF header is different or used as a signal to enter "Long mode/compatibility mode.
Complete thread:
- 64-bit long mode compatability with 32-bit instructions-GAS - RayeR, 22.01.2014, 23:44 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- 64-bit long mode compatability with 32-bit instructions-GAS - Rugxulo, 23.01.2014, 01:10
- 64-bit long mode compatability with 32-bit instructions-GAS - Oso2k, 23.01.2014, 01:34
- 64-bit long mode compatability with 32-bit instructions-GAS - RayeR, 23.01.2014, 03:03
- 64-bit long mode compatability with 32-bit instructions-GAS - alexfru, 23.01.2014, 08:34
- 64-bit long mode compatability with 32-bit instructions-GAS - georgpotthast, 23.01.2014, 20:16
- 64-bit long mode compatability with 32-bit instructions-GAS - alexfru, 23.01.2014, 08:34
- 64-bit long mode compatability with 32-bit instructions-GAS - marcov, 23.01.2014, 21:57
Mix view