The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: m45m32 on August 07, 2006, 10:49:40 AM

Title: MASM32 on Linux?
Post by: m45m32 on August 07, 2006, 10:49:40 AM

Why MASM32 is not available on Linux?

I am currently running MASM32 using "wine" on Linux.

I would be nice to have a Linux version of MASM32.

What you guys think ?
Title: Re: MASM32 on Linux?
Post by: hutch-- on August 07, 2006, 11:46:10 AM
Not possible as Microsoft do not support Linux. For Linux use GAS, FASM or NASM.
Title: Re: MASM32 on Linux?
Post by: Mincho Georgiev on August 07, 2006, 11:48:22 AM
Quote
Why MASM32 is not available on Linux?

Maybe the proper question here without any offence is 'Why Linux ?'
Title: Re: MASM32 on Linux?
Post by: MusicalMike on August 24, 2006, 07:30:39 PM
Because linux is more stable, and its free at the same time  :P
Title: Re: MASM32 on Linux?
Post by: James Ladd on August 24, 2006, 10:35:43 PM
Im using GAS on Linux and I like it, although im not the best assembler guy.

m45m32 - Please let me know how you have gone with using wine and masm as thats interesting.
You could use masm and the binutils tools to convert to linux format. However, maybe just using Gnu Assembler on both platforms is
easier in the long run. It's what I do.

If you use the intel syntax then things are easier. See this snippet

#cpuid.s Sample program to extract the processor Vendor ID
.intel_syntax noprefix

.global _start

.data
output:
        .ascii "The processor Vendor ID is 'xxxxxxxxxxxx'\n"
.text

_start:
        nop
        mov eax, 0
        cpuid
        mov edi, offset output
        mov [edi + 28], ebx
        mov [edi + 32], edx
        mov [edi + 36], ecx
        mov eax, 4
        mov ebx, 1
        mov ecx, offset output
        mov edx, 42
        int 0x80
        mov eax, 1
        mov ebx, 0
        int 0x80


Which is for linux btw, but a small set of macros can make it cross platform.
Title: MASM32 on Linux? also a Reply to for James Ladd?
Post by: m45m32 on August 28, 2006, 01:06:01 PM
Thanks for you help, James I really appreciate that you are using GAS.
Mr. Hutch has disappointed me not allowing me to write non-windows software
with MASM32.
Somehow he is also bounded by Microsoft Policies.
I have absolutely quit using MASM from now on.
I prefer using NASM instead of GAS.

As for the interest of James in knowing how to run MASM32 using wine....

Here is a shell script i used to run:

#!/bin/bash

#Name: mkit

wine ml.exe -- /c /coff /I <include path> source.asm
wine objcopy.exe -- -O elf32-i386 source.obj source.o
gcc source.o -o source

Title: Re: MASM32 on Linux?
Post by: hutch-- on August 28, 2006, 01:20:40 PM
m45m32,

Its an ownership issue, Microsoft OWN MASM and do not licence the free versions for use on any other platform. You have other choices and GAS is a very good one and it is licenced under the GPL system.
Title: Re: MASM32 on Linux?
Post by: James Ladd on August 28, 2006, 11:44:57 PM
m45m32,

Please don't blame Hutch as it's out of his hands. I'm sure that if it was possible to support linux then he would.

Your approach to using wine is interesting. I take it that you are just writing for linux?
If your writing for more than one platform then I still think Gnu Assembler (GAS) is a great choice.

Have you look at more assemblers than NASM ?  eg: FASM, YASM etc.

Rgs, James.
Title: Re: MASM32 on Linux?
Post by: drhowarddrfine on August 29, 2006, 12:39:52 AM
James,
Do you have an opinion of FASM on Linux?
Title: Re: MASM32 on Linux?
Post by: James Ladd on August 29, 2006, 03:57:40 AM
I did spend some time looking at FASM and seeing what sort of help was out there for it.
I coded a simple hello world in linux and win32 but had a few issues trying to make
sharable libraries (DLL's) on linux. Most likely my problem and not FASM's.

I was impressed with the assembler but disappointed in the documentation and lack of
help in the forums. Since I couldn't find a lot of help I turned to GAS.

There is so much information on the net for GAS and the support for intel syntax makes it
a really good tool to use. I can post code here and use examples from here with a little bit
of tweaking. Using cygwin under windows means I have almost 100% the same development
environment on both platforms. For example, I use DDD on both platforms for debugging.
(I'd be happy to know of an alternative too)

BTW - NASM was in the same boat as FASM for me.

I hope this helps.

Rgs, James.
Title: Re: MASM32 on Linux?
Post by: drhowarddrfine on August 29, 2006, 04:08:26 AM
There is another debugger for asm that some prefer but I've forgotten what it is right now.  I've been tinkering with GAS but haven't done anything but look around.  I really don't have a problem with the syntax.  It's perfectly understandable to me.
Title: Re: MASM32 on Linux?
Post by: JMGK on August 29, 2006, 02:08:57 PM
hi,

i coded, once, a small linker that would accept coff&omf obj files and output a linux elf executables.

i used it to be able to develop for linux using msvc and tasm

i even posted it to the board(or was win32asm board?), but now cant find it

jmgk

ps: maybe somebody saved it, and can post a link there

pps: as hutch say, by using masm for linux coding, you´re breaking the license... beware!
Title: Re: MASM32 on Linux?
Post by: James Ladd on August 30, 2006, 05:28:49 AM
Maybe someone can clearify, but surely the license doesn't stop you taking the generated obj files
and modifying then to elf format ?