News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

MASM32 on Linux?

Started by m45m32, August 07, 2006, 10:49:40 AM

Previous topic - Next topic

m45m32


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 ?

hutch--

Not possible as Microsoft do not support Linux. For Linux use GAS, FASM or NASM.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Mincho Georgiev

Quote
Why MASM32 is not available on Linux?

Maybe the proper question here without any offence is 'Why Linux ?'

MusicalMike

Because linux is more stable, and its free at the same time  :P

James Ladd

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.

m45m32

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


hutch--

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.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

James Ladd

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.

drhowarddrfine

James,
Do you have an opinion of FASM on Linux?

James Ladd

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.

drhowarddrfine

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.

JMGK

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!

James Ladd

Maybe someone can clearify, but surely the license doesn't stop you taking the generated obj files
and modifying then to elf format ?