m4-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

asterisks, dollar signs and percent signs!


From: Anonymous
Subject: asterisks, dollar signs and percent signs!
Date: Tue, 01 May 2012 21:57:34 +0200

Hello, I am trying to use m4 to write assembly language macros.

My first effort is almost working but I can't get the last part to work.

Here is what I have so far.

define(entry,`
       .section .text,"ax"
       .align 4

       .globl main
       .type main,@function
       .align 16
main:
        enter `$'0x10,`$'0
        pushl %ebx
        pushl %esi
        pushl %edi'
      )dnl

define(exit,`
        popl %edi
        popl %esi
        popl %ebx
        
        leave
        ret'
      )dnl


        entry

        call printf

        exit

This works as desired except I want to change the macro names to $entry and
$exit. I can't figure out how to quote the names or what I am doing wrong,
it produces no output or produces wrong output and loops depending on
what I try. I would like to be able to create a $main macro but main: is a
text token in the definition and I also have problems with that. I looked
over the manual and I obviously missed something. Thanks for any help and
sorry if this is a stupid question.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]