Hi Kabbin,
> I converted gcc produced *.S files to NASM by att2intel.
> But I found that it can't convert function declaraction or some psudo
> instructions?
> such as :
> .globl function1 (can't convert )
That's surprising. I'd have expected that to convert "easily" to "global function1"...
> or
> .align 16
> (which converted by att2intel to .align 65536,and I wonder is it right?)
I don't think so. I'd expect just "align 16".
> rounding_512 : .fill 4,4,512 (can't convert also!)
> So I rewrite by hand as following:
> rounding_512 : dw 512 512 512 512 512 512 512 512
I'm not familiar with "fill", but something I saw recently suggested that the second parameter was "size"... so you might want "dd" rather than "dw"? If you get unexpected results, try that.
> So, could anyone tell me how to declare a function in nasm? Is it the same way
> as MASM? (PROC and ENDP) Thanks.
You'll have to "%include" a macro file if you want "proc" and "endp". There are several in the "misc/" directory that have it. If you want to export a function from a shared library, "global myfunc:function" (elf only).
Best,
Frank