Jump to content

GAS AT&T non-constant expresssion

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
cvfirefox

cvfirefox

    Newbie

  • Members
  • Pip
  • 5 posts
Does anyone knows how to solve the error I've encountered?

This is the codes I'll have to assemble it into .o


	# Copyright 1998-2004 - Just For Fun Software, Inc., all rights reserved

	# Author:  George Woltman

	# Email: woltman@alum.mit.edu

	#


	# ********************************************************

	# ********************************************************

	# ********************  FFT MACROS  **********************

	# ********************************************************

	# ********************************************************


	## Perform a 32-element FFT.


	.macro fft32

	.local b1b, c1b


	## Do a forward FFT only


	.if      type EQ 1

		call    x32_fft

		jmp     xmiddle_1

        .endif


	## Do a squaring


	.if      type EQ 2

		call    x32_fft

		call    xmiddle_2

	##      jmp     x32_finish_unfft

	.endif


	## Do a multiply


	.if      type EQ 3

		call    x32_fft

		call    xmiddle_3

		jmp     x32_finish_unfft

	.endif


	## Do a multiply with pre-FFTed inputs


	.if      type EQ 4

		call    xmiddle_4

		jmp     x32_finish_unfft

	.endif


	## Do FFT levels 1,2,3

	## Values 0-31 is real data.

	##

	## On input the 32-byte cache lines hold these data values:

	##      0       16      1       17

	##      2       ...

	##      ...     ...

	##      14      ...

	## On output the 32-byte cache lines hold these data values:

	##      0       4       1       5

	##      2       ...

	##      8       ...

	##      ...


	## Do 4 eight_reals_first_fft macros

	##      distance between fft data elements is 4


	.if      type EQ 1

	x32_fft: 

	        copy_7_words

		subl    %eax,%eax

	b1b: disp eight_reals_first_fft, 4*dist1, 8*dist1, 8

		leal    dist1(%esi),%esi        ## Next source pointer

		addb    $256/4, %al             ## Test loop counter

		jnc     b1b                     ## Iterate if necessary

		leal    esi-4*dist1,%esi        ## Restore source pointer


	## End common FFT code


		ret

	.endif


	## Do inverse FFT levels 1,2,3

	## On input the 32-byte cache lines hold these data values:

	##      0       4       1       5

	##      2       ...

	##      8       ...

	##      ...

	## On output the 32-byte cache lines hold these data values:

	##      0       16      1       17

	##      2       ...

	##      ...     ...

	##      14      ...


	## Do 4 eight_reals_last_unfft macros

	##      distance between fft data elements is 4


	.if      type EQ 2

	x32_finish_unfft: 

	c1b: disp eight_reals_last_unfft, 8, 4*dist1, 8*dist1

		leal    dist1(%esi),%esi        ## Next source pointer

		addb    $256/4, %al             ## Test loop counter

		jnc     c1b                     ## Iterate if necessary

		leal    esi-4*dist1,%esi        ## Restore source pointer

        fft_3_ret

        .endif

        .endm

    

        fft32

	.end


and this is the error I got when I assembled it.

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'

test5.mac:106: Error: non-constant expression in ".if" statement

test5.mac:106: Error: junk at end of line, first unrecognized character is `E'


Anyone knows how to solve this problem?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What language is this?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
cvfirefox

cvfirefox

    Newbie

  • Members
  • Pip
  • 5 posts
This is linux gnu assembler AT&T syntax, assembly language

#4
ThemePark

ThemePark

    Programmer

  • Members
  • PipPipPipPip
  • 124 posts
I don't know anything about that particular language, but since there are 6 errors and 6 EQ, my guess is that EQ needs to be lowercase, which makes sense considering everything else in the program is as well.

#5
cvfirefox

cvfirefox

    Newbie

  • Members
  • Pip
  • 5 posts

ThemePark said:

I don't know anything about that particular language, but since there are 6 errors and 6 EQ, my guess is that EQ needs to be lowercase, which makes sense considering everything else in the program is as well.


Hi ThemePark, I've tried to change the EQ and lowercase but the problem still the same.