Re: QWORD PTR error on Intel Mac




"fiopa" <fiopax@xxxxxxxxx> wrote in message
news:1i0hdlb.uglxxpghmotuN%fiopax@xxxxxxxxxxxx
Hi

I'm porting my application (C/C++ and ASM Intel) to Intel Mac.

Windows version is OK:
...
C code
...
__asm
{
...
FLD QWORD PTR [EDI]
...
}
...

Mac version is OK for all ASM instructions, except QWORD PTR:
...
C code
...
asm
{
...
FLD QWORD PTR [EDI]
...
}
...

If I change from QWORD PTR to DWORD PTR or WORD PTR,
there is no error, but if I use QWORD PTR the compiler error is:
"jam failed with exit code 1"

I've to use a different sintax for QWORD PTR ?


Maybe... You need to state what assembler (or compiler) you're using.

From "Intel Mac", I could assume GAS for GCC (or GCC inline C assembly), but
I don't know for sure.

Anyway, your starting code is MASM syntax:
FLD QWORD PTR [EDI]

This is GAS or AT&T syntax:
fldl (%edi)

Or, for inline "GAS" assembly with parameters:
"fldl (%%edi)\n"

Or, for inline "GAS" assembly without parameters:
"fldl (%edi)\n"

This is NASM syntax:
FLD QWORD [EDI]

Mac version is OK for all ASM instructions, except QWORD PTR:

I doubt that... I suspect GAS or less likely NASM.

For good links on GAS syntax, goto section 5.1:
http://www.frontiernet.net/~fys/osd_faq/index.htm

MASM guide:
http://doc.ddart.net/asm/Microsoft_MASM_Programmers_Guide_v6.1/

NASM manual:
http://home.comcast.net/~fbkotler/nasmdoc1.html


Rod Pemberton


.



Relevant Pages

  • QWORD PTR error on Intel Mac
    ... I'm porting my application (C/C++ and ASM Intel) to Intel Mac. ... FLD QWORD PTR [EDI] ... Mac version is OK for all ASM instructions, except QWORD PTR: ...
    (comp.lang.asm.x86)
  • QWORD PTR error on Intel Mac
    ... I'm porting my application (C/C++ and ASM Intel) to Intel Mac. ... FLD QWORD PTR [EDI] ... Mac version is OK for all ASM instructions, except QWORD PTR: ...
    (alt.lang.asm)
  • Re: WAIT... why?
    ... fmul qword ptr ... fadd qword ptr [edi] ... The "wait" in the code above makes sure edi is not used by the CPU before the FPU has stored the result to this register. ...
    (borland.public.delphi.language.basm)
  • Re: Code Optimization Stack Pointer Manipulation
    ... fmul qword ptr ... fld qword ptr ...
    (borland.public.delphi.language.basm)
  • WAIT... why?
    ... fmul qword ptr ... fadd qword ptr [edi] ... fstp qword ptr [edi] ... mov eax, ...
    (borland.public.delphi.language.basm)