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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [binutils-2.20.1/] [gas/] [testsuite/] [gas/] [tic54x/] [macro.s] - Diff between revs 205 and 215

Only display areas with differences | Details | Blame | View Log

Rev 205 Rev 215
* Macro test
* Macro test
        .sslist
        .sslist
        .text
        .text
        .global abc, def, ghi, adr
        .global abc, def, ghi, adr
 
 
* Macro library; load and use a macro in macros.lib
* Macro library; load and use a macro in macros.lib
        .mlib "macros.lib"
        .mlib "macros.lib"
 
 
        IN_MLIB abc,def,ghi
        IN_MLIB abc,def,ghi
 
 
add3    .macro  P1,P2,P3,ADDRP
add3    .macro  P1,P2,P3,ADDRP
        ld      P1,a
        ld      P1,a
        add     P2,a
        add     P2,a
        add     P3,a
        add     P3,a
        stl     a,ADDRP
        stl     a,ADDRP
        .endm
        .endm
        add3    abc, def, ghi, adr
        add3    abc, def, ghi, adr
 
 
* Forced substitution within a macro
* Forced substitution within a macro
force   .macro  x
force   .macro  x
        .asg    0, x
        .asg    0, x
        .loop 8
        .loop 8
AUX:x:  .set    x
AUX:x:  .set    x
        .eval   x+1,x
        .eval   x+1,x
        .endloop
        .endloop
        .endm
        .endm
        force
        force
 
 
* Subsripted substitution symbols
* Subsripted substitution symbols
ADDX    .macro  ABC
ADDX    .macro  ABC
        .var    TMP
        .var    TMP
        .asg    :ABC(1):,TMP
        .asg    :ABC(1):,TMP
        .if     $symcmp(TMP,"#") == 0
        .if     $symcmp(TMP,"#") == 0
        ADD     ABC,A
        ADD     ABC,A
        .else
        .else
        .emsg   "Bad macro parameter 'ABC'"
        .emsg   "Bad macro parameter 'ABC'"
        .endif
        .endif
        .endm
        .endm
        ADDX    #100                    ; ADD #100,A
        ADDX    #100                    ; ADD #100,A
        .end
        .end
 
 

powered by: WebSVN 2.1.0

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