Share via


MIPS Assembler Directive Example

The following code sample shows how to use MIPS assembler directives when you cannot use the assembler macros.

#define ALTERNATE_ENTRY(Name)           \
        .globl  Name;                   \
Name:;

#define LEAF_ENTRY(Name)                \
        .text;                          \
        .globl  Name;                   \
        .ent    Name, 0;                \
Name:;                                  \
        .frame  sp, 0, ra;              \
        .prologue 0;

#define NESTED_ENTRY(Name, fsize, retrg) \
        .text;                          \
        .globl  Name;                   \
        .ent    Name, 0;                \
Name:;                                  \
        .frame  sp, fsize, retrg;

#define ALTERNATE_ENTRY_S(Name)         \
        .globl  Name;                   \
Name:;

#define SYSTEM_ENTRY(Name)              \
        .text;                          \
        .globl  Name;                   \
        .ent    Name, 0;                \
Name:;                                  \
        .frame  sp, 0, ra;              \
        .prologue 0;

#define LEAF_ENTRY_S(Name, Section)     \
        .text   Section;                \
        .globl  Name;                   \
        .ent    Name, 0;                \
Name:;                                  \
        .frame  sp, 0, ra;              \
        .prologue 0;

#define NESTED_ENTRY_S(Name, fsize, retrg, Section) \
        .text   Section;                \
        .globl  Name;                   \
        .ent    Name, 0;                \
Name:;                                  \
        .frame  sp, fsize, retrg;

#define EXCEPTION_HANDLER(Handler)      \
        .edata  1, Handler;

#define PROLOGUE_END .prologue 1;

See Also

MIPS Calling Sequence Specification

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.