The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: MazeGen on December 12, 2005, 08:09:19 PM

Title: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: MazeGen on December 12, 2005, 08:09:19 PM
... so many questions have arised.

Firstly: is there any predefined symbol which could tell me if ML64 is used? I mean something like

IFNDEF __ML_64
mov ecx, offset loop_lbl
ELSE
mov rcx, offset loop_lbl
ENDIF
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: manhattan on December 13, 2005, 03:53:05 AM
You can use

__ML_64 = OPATTR rax

IF __ML_64
mov rcx, offset loop_lbl
ELSE
mov ecx, offset loop_lbl
ENDIF
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: zooba on December 13, 2005, 06:45:54 AM
Presumably you need to set a different instruction set at the top (ie. .386/486/etc.)

This can be retrieved with the @Cpu symbol. (I only have the MSDN documentation to go on so I can't help you out any more than that - try ECHOing it and see what happens)
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: MazeGen on December 13, 2005, 03:03:02 PM
Hi Dr. Manhattan,

I was thinking about similar solution. From your answer I assume there isn't such predefined symbol.

Hi zooba,

did you try it with ML64? I doubt it depends on the processor directive. You can have the lastest Pentium4 without 64-bit extensions. I'd expect that using ML64 I have to compile 64-bit code...
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: Human on December 13, 2005, 03:42:05 PM
you can look inside exe for .386 .486 .586 .mmx strings if any new it will be there
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: AeroASM on December 13, 2005, 04:47:46 PM
those directives are not put into the exe.

which exe anyway?
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: MazeGen on December 13, 2005, 06:52:31 PM
According to msdn (http://msdn2.microsoft.com/en-us/library/xw102cyh.aspx), there is no new processor directive.
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: MazeGen on December 13, 2005, 06:56:35 PM
Ok, next question:

What about RIP-relative addressing? May the coder use this addressing explicitly, or ML64 choose itself between direct addressing and RIP-relative addressing?
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: manhattan on December 14, 2005, 08:25:45 PM
RIP addressing is not supported by ml64. This page has more information: http://www.codegurus.be/codegurus/Programming/riprelativeaddressing_en.htm
Title: Re: I'm forced to think in ML64 assembly with no 64-bit computer...
Post by: MazeGen on December 15, 2005, 10:31:22 AM
Again thanks, Dr. Manhattan :U

I know this pages, but I didn't noticed they got updated  :red