At 11:02 PM 11/28/2005 -0800, Blair Campbell wrote:

I would personally really appreciate the ASM in FreeDOS HELP being a
test case, as this assembler won't even compile with Arrow Assembler
or the Watcom Assembler (which both use older MASM/TASM syntax,

The only ASM file I found in FreeDOS HELP was conio.asm. It substantially converted with Nomyso 2.0 as-is. There remained three problem areas: local labels in macros, improper bracketing in certain circumstances, and DGROUP group listing.

I fixed the local label in macro situation, and the DGROUP problem. The bracketing was made a bit more robust. In doing so, I discovered an error in the original Nomyso 2.0 for EMM386 which fortunately was minor: the _pause macro which isn't used in normal build had a memory reference error, and the very seldom used SB option code translated one line improperly. Neither problem should affect people who would develop with a translated EMM386, but they're fixed now for next Nomyso.

The bracket problem highlighted one of the fundamental reasons you can never fully automate the translation process for all MASM/TASM source files . With the line:

_ScreenArea     EQU DWord Ptr _ScreenOffset

translated to:

%DEFINE _ScreenArea     DWord [_ScreenOffset]

things will still fail under NASM for lines like:

les di, _ScreenArea

Why? Because NASM won't take a DWORD attribute for a 'les' argument, even though it IS a DWORD being used. In fact, I tried different combinations of DWORD, WORD, NEAR, and FAR, and NASM won't take any of them. I think that's a bug in NASM, but I can't figure out what it really thinks it should take as an attribute, so who knows.

The three people following to this point might wonder why Nomyso doesn't just eliminate the 'DWord' in the $DEFINE statement and eliminate the problem. Well, you can't automatically do that because the DWORD would be necessary in some cases where you might use the %define'd _ScreenArea, such as:

mov eax,_ScreenArea

However, because I am insane, I added the ability to fully automate the conio.asm conversion by adding a -x option to Nomyso, allowing post-processing lines with s// regular expressions. Consequently, with the current (unreleased) Nomyso:

 ./nomyso/pl -x'/(%define\s+.*\s)dword\s+(.*)/$1$2/i' conio.asm nconio.asm

conio.asm is fully translated and NASM ready following the problematic DWord purge by that demented 'x' option. NASM -O99 -f obj nconio.asm is happy.

I can't say whether the translated conio.asm actually works along with all its C source, but it does assemble without errors. If you want the latest Nomyso immediately for converting conio.asm, let me know. Otherwise I'm going to wait and see if the ATAPICD translation needs any non-major changes to Nomyso before releasing a new public version.

This email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
Freedos-user mailing list

Reply via email to