OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [testsuite/] [gas/] [tic54x/] [macro.s] - Blame information for rev 856

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 132 jeremybenn
* Macro test
2
        .sslist
3
        .text
4
        .global abc, def, ghi, adr
5
 
6
* Macro library; load and use a macro in macros.lib
7
        .mlib "macros.lib"
8
 
9
        IN_MLIB abc,def,ghi
10
 
11
add3    .macro  P1,P2,P3,ADDRP
12
        ld      P1,a
13
        add     P2,a
14
        add     P3,a
15
        stl     a,ADDRP
16
        .endm
17
        add3    abc, def, ghi, adr
18
 
19
* Forced substitution within a macro
20
force   .macro  x
21
        .asg    0, x
22
        .loop 8
23
AUX:x:  .set    x
24
        .eval   x+1,x
25
        .endloop
26
        .endm
27
        force
28
 
29
* Subsripted substitution symbols
30
ADDX    .macro  ABC
31
        .var    TMP
32
        .asg    :ABC(1):,TMP
33
        .if     $symcmp(TMP,"#") == 0
34
        ADD     ABC,A
35
        .else
36
        .emsg   "Bad macro parameter 'ABC'"
37
        .endif
38
        .endm
39
        ADDX    #100                    ; ADD #100,A
40
        .end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.