08.11.2014 Views

RealView Compilation Tools アセンブラガイド - ARM Information Center

RealView Compilation Tools アセンブラガイド - ARM Information Center

RealView Compilation Tools アセンブラガイド - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ディレクティブリファレンス<br />

; code<br />

MEND<br />

; end macro definition<br />

; macro invocation<br />

abc xmac subr1,de ; invoke macro<br />

; code ; this is what is<br />

abcloop1 ; code ; is produced when<br />

; code ; the xmac macro is<br />

BGE abcloop1 ; expanded<br />

abcloop2 ; code<br />

BL subr1<br />

BGT abcloop2<br />

; code<br />

ADR de<br />

; code<br />

マク ロを 使 用 したアセンブ リ 時 の 診 断 を 以 下 に 示 し ます。<br />

MACRO<br />

; Macro definition<br />

diagnose $param1="default" ; This macro produces<br />

INFO 0,"$param1" ; assembly-time diagnostics<br />

MEND<br />

; (on second assembly pass)<br />

; macro expansion<br />

diagnose<br />

; Prints blank line at assembly-time<br />

diagnose "hello" ; Prints "hello" at assembly-time<br />

diagnose |<br />

; Prints "default" at assembly-time<br />

条 件 付 き マ ク ロの 例<br />

AREA codx, CODE, READONLY<br />

; macro definition<br />

MACRO<br />

Return$cond<br />

[ {ARCHITECTURE} "4"<br />

BX$cond lr<br />

|<br />

MOV$cond pc,lr<br />

]<br />

MEND<br />

; macro invocation<br />

fun<br />

PROC<br />

CMP<br />

MOVEQ<br />

ReturnEQ<br />

MOV<br />

Return<br />

r0,#0<br />

r0,#1<br />

r0,#0<br />

<strong>ARM</strong> DUI 0204IJ Copyright © 2002-2008 <strong>ARM</strong> Limited. All rights reserved. 7-39<br />

Non-Confidential

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!