Re: Assembler messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2009-01-28 at 02:55 -0800, cristi marius wrote:

> $ make
> cc -O2   -c -o obsr.o obsr.c
> cc -O2   -c -o ro.o ro.c
> cc -O2   -c -o tag.o tag.c
> as   -o hit.o hit.s
> as   -o hintm1.o hintm1.s
> hintm1.s: Assembler messages:
> hintm1.s:72: Error: suffix or operands invalid for `push'
> hintm1.s:74: Error: suffix or operands invalid for `push'
> hintm1.s:75: Error: suffix or operands invalid for `push'
> hintm1.s:76: Error: suffix or operands invalid for `push'
> hintm1.s:94: Error: suffix or operands invalid for `push'
> hintm1.s:95: Error: suffix or operands invalid for `push'
> hintm1.s:122: Error: suffix or operands invalid for `push'
> hintm1.s:139: Error: suffix or operands invalid for `push'
> hintm1.s:153: Error: suffix or operands invalid for `push'
> hintm1.s:154: Error: suffix or operands invalid for `push'
> hintm1.s:224: Error: suffix or operands invalid for `push'
> hintm1.s:225: Error: suffix or operands invalid for `push'
> hintm1.s:226: Error: suffix or operands invalid for `push'
> hintm1.s:227: Error: suffix or operands invalid for `push'
> hintm1.s:235: Error: suffix or operands invalid for `push'
> hintm1.s:236: Error: suffix or operands invalid for `push'
> hintm1.s:237: Error: suffix or operands invalid for `push'
> hintm1.s:262: Warning: translating to `fld %st(1)'
> hintm1.s:436: Warning: translating to `fld %st(3)'
> hintm1.s:633: Warning: translating to `fld %st(3)'
> hintm1.s:683: Error: suffix or operands invalid for `pop'
> hintm1.s:684: Error: suffix or operands invalid for `pop'
> hintm1.s:685: Error: suffix or operands invalid for `pop'
> hintm1.s:686: Error: suffix or operands invalid for `pop'
> hintm1.s:734: Error: suffix or operands invalid for `pop'
> hintm1.s:735: Error: suffix or operands invalid for `pop'
> hintm1.s:736: Error: suffix or operands invalid for `pop'
> make: *** [hintm1.o] Error 1
> I think the problem is with assembler

It's not the assembler. hintml.s and probably hit.s are written in
32-bit assembly code. 32-bit code pushes and pops the 32-bit portions of
the registers, i.e., something like
       pushl   %ebp
       ....
       popl    %ebp
In 64-bit code the stack cannot be addressed with 32 bits, so the full
64 bits of the register must be pushed/popped:
       pushq   %rbp
       ....
       popq    %rbp

The problems go far beyond this. I'm assuming that hit.s and hintml.s
contain functions that are called from the C++ code, or the other way.
The 64-bit argument passing protocol is completely different. In 64-bit
mode the first six arguments are passed in registers, etc., etc.

If you wish to run the program in 64-bit mode, the assembly language
functions must be rewritten. This all described in the abi available at
http://www.x86-64.org/documentation.html I have just completed an
introductory book on the topic, which I hope to find a publisher for
soon.

Bob Plantz



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux