News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Converting gas code to masm

Started by penguino, August 14, 2014, 10:51:07 AM

Previous topic - Next topic

penguino

Can anybody explain exactly what the following gas macro is doing, so I can convert it to a masm macro?

macro PUSHRSP reg
    lea -4(%ebp),%ebp
    movl \reg,(%ebp)
.emdm

Thanks.

jj2007

The conversion part is easy:

PUSHRSP macro reg
  lea ebp, [ebp-4]
  mov [ebp], reg
ENDM

The question is if it does something useful ::)

penguino

Ahh - thanks. Now I know what it does.

Gunther

Jochen,

Quote from: jj2007 on August 14, 2014, 11:22:50 AM
The conversion part is easy:

PUSHRSP macro reg
  lea ebp, [ebp-4]
  mov [ebp], reg
ENDM

The question is if it does something useful ::)

that should be useful? I've my doubts. Anyway, you're now a specialist for AT&T syntax.  :t

Gunther
You have to know the facts before you can distort them.

Vortex

That AT&T syntax looks always ugly. Not an easily readable notation.

habran

Cod-Father

qWord

Quote from: Vortex on August 15, 2014, 04:04:57 AM
That AT&T syntax looks always ugly. Not an easily readable notation.
not surprisingly for a back-end assembler that was never intended for human usage, even if there are some geniuses who claims the opposite  8)
MREAL macros - when you need floating point arithmetic while assembling!

MichaelW

There is a directive you can use to switch as to the familiar Intel syntax:

.intel_syntax noprefix


In recent times even gcc supports Intel syntax, for inline assembly and the back-end assembler.
Well Microsoft, here's another nice mess you've gotten us into.

Gunther

Michael,

Quote from: MichaelW on August 15, 2014, 08:01:07 PM
There is a directive you can use to switch as to the familiar Intel syntax:

.intel_syntax noprefix


In recent times even gcc supports Intel syntax, for inline assembly and the back-end assembler.

and with that directive, as performs good.

Gunther
You have to know the facts before you can distort them.