Mail Archives: djgpp/1996/11/20/23:55:10
In article <Pine DOT LNX DOT 3 DOT 91 DOT 961115151041 DOT 402B-100000 AT hostr DOT bielbit DOT bielsko DOT pl>,
bartosz AT hostr DOT bielbit DOT bielsko DOT pl says...
>I've found that Watcom disassembler (wdisasm) could emit source code in
>INTEL and AT&T like syntax. I haven't checked AT&T syntax because I've
>no gas installed.
The code it produces is actually pretty usable. You'll have to do a few
changes to get it actually compile correctly, but these can be automated with
sed or similar. We actually use this for MIDAS Sound System Linux version
mixing routines. The conversion we used is:
sed -e s/_// -e s/+// -e s/.bss/.lcomm/ -e s/repe/rep\;/ \
dsmmix.wdisasm > dsmmix.S
(you can try to figure out that one yourself :)
Also, I know that one piece of code gets transformed wrong. If you have a
pointer to a function in a variable, and want to call that, the resulting AT&T
assembler code just tries to call the address of the variable. So in effect
call [dword pointer]
gets replaced by
call pointer
(TASM IDEAL mode syntax). I actually don't know how to implement the first one
with AT&T syntax assembler. We ended up changing the code to
mov eax,[pointer]
call eax
Other than that, no major problems, apart from WDISASM being a commercial
program and part of Watcom C.
Petteri
(Disclaimer: "We" refers to myself and Jarno Paananen, not Nokia)
- Raw text -