Re: Assembly Help!!

From: John Williams (jwilliams_at_itee.uq.edu.au)
Date: 07/22/03


Date: Tue, 22 Jul 2003 10:44:04 +1000

Marty wrote:
> 1) It's a MMU page table making code. I don't understand '->' marked
> parts.
> It seems like to me that they're macro commands in macro definition. I
> mean, It seems like using macro command even though PT_ENTRY macro
> definition is not yet finished. and why they need some arguments
> within double quote??? What does that mean???

It's a recursive macro. Here's a simple example:

.MACRO RECURSIVE_TEST value
.if \value
   .long \value
   RECURSIVE_TEST "(\value-1)"
.else
   .long 0x9999
.endif
.ENDM

Write out by hand what will be generated if you call this RECURSIVE_TEST
macro with a value of, say, 4... it will create the following output:

.long 4
.long 3
.long 2
.long 1
.long 0x9999

When you understand why, you'll be able to understand the PT_ENTRY macro.

The quotes are probably just to get around some text substitution rules
in the assember input format.

Cheers,

John



Relevant Pages

  • Re: Makeindex with german Umlaut
    ... Because of _your_ macro definition. ... then the catcode changes don't have an effect. ... Thus you can redefine the active quote in your macro ...
    (comp.text.tex)
  • Re: Symbol macros dont capture their lexical environments?
    ... This returns (:foo:baz). ... not a form that evaluates to the expansion, ... For regular macros, that expansion occurs in the lexical scope of the macro definition. ... You cannot express a computation as part of a symbol macro definition, so whatever is the definition of a symbol macro is not subject to macroexpansion itself. ...
    (comp.lang.lisp)
  • Re: Symbol macros dont capture their lexical environments?
    ... This returns (:foo:baz). ... not a form that evaluates to the expansion, ... whatever is the definition of a symbol macro is ... macro definition, so whatever is the definition of a symbol macro is not ...
    (comp.lang.lisp)
  • Re: Whats this in C?
    ... surrounded by parenthesis. ... Any such function can have its declaration ... masked by a macro definition in its corresponding header. ... Any macro definition of a function can be suppressed locally ...
    (comp.lang.c)
  • Re: meta pre-processor
    ... | operator recognized by the preprocessor; it can occur only in a macro ... at the beginning of a line is a multi-line macro definition, ... The # prefix used for C preprocessor ... configure script from within an empty directory, ...
    (comp.lang.c)