Partager via


ARM Assembler Directive Example

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

MACRO
START_REGION $NameBegin
LCLS TempName
TempName SETS VBar:CC:"$NameBegin":CC:Vbar
EXPORT $TempName[DATA]
$TempName
MEND

MACRO
END_REGION $NameEnd
LCLS TempName
TempName SETS VBar:CC:"$NameEnd":CC:Vbar
EXPORT $TempName[DATA]
$TempName
MEND

MACRO
NESTED_ENTRY $Name
FuncName SETS VBar:CC:"$Name":CC:Vbar
PrologName SETS VBar:CC:"$Name":CC:"_Prolog":CC:Vbar
FuncEndName SETS VBar:CC:"$Name":CC:"_end":CC:Vbar
LCLS ExceptBit
IF HaveExceptHandler
ExceptBit SETS "0x80000000"
ELSE
ExceptBit SETS "0"
ENDIF

AREA |.pdata|,PDATA
DCD $FuncName
DCD (($PrologName-$FuncName)/4) :OR: ((($FuncEndName-$FuncName)/4):SHL:8) :OR: 0x40000000 :OR: $ExceptBit

AREA reaName,CODE
ALIGN 4
EXPORT $FuncName
IF HaveExceptHandler
DCD $ExceptHandler
DCD $ExceptData
HaveExceptHandler SETL {FALSE}
ENDIF
$FuncName
ROUT
MEND

MACRO
PROLOG_END
$PrologName
MEND

MACRO
LEAF_ENTRY $Name
FuncName SETS VBar:CC:"$Name":CC:Vbar
PrologName SETS "Invalid Prolog"
FuncEndName SETS VBar:CC:"$Name":CC:"_end":CC:Vbar
ALIGN 4
EXPORT $FuncName
$FuncName
ROUT
MEND

MACRO
ALTERNATE_ENTRY $Name
LCLS TempName
TempName SETS VBar:CC:"$Name":CC:Vbar
EXPORT $TempName
$TempName
MEND

MACRO
ENTRY_END $Name
$FuncEndName MEND

MACRO
EXCEPTION_HANDLER $Handler
ExceptHandler SETS VBar:CC:"$Handler":CC:Vbar
ExceptData SETS "0"
HaveExceptHandler SETL {TRUE}
MEND

MACRO
EXCEPTION_HANDLER_DATA $Handler, $HandlerData
ExceptHandler SETS VBar:CC:"$Handler":CC:Vbar
ExceptData SETS VBar:CC:"$HandlerData":CC:Vbar
HaveExceptHandler SETL {TRUE}
MEND

See Also

ARM Calling Sequence Specification

 Last updated on Thursday, April 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.