asterisks, dollar signs and percent signs!

Anonymous <[email protected]>
Newsgroups gmane.comp.gnu.m4.general
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.