Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1126 | savelij | 1 | cpu 1802 |
2 | |||
3 | ; note this initial "dummy set" before defining the |
||
4 | ; macro is necessary since while reading in the macro, |
||
5 | ; the assembler will scan for a ENDM statement and |
||
6 | ; while doing this, will also perform string expression |
||
7 | ; expansion in the instruction field . Not having __COND |
||
8 | ; set at this point of time would result in an error: |
||
9 | |||
10 | __COND set "" |
||
11 | |||
12 | ; Note further that while the BROP argument gets expanded |
||
13 | ; in string constants, no implicit uppercase conversion |
||
14 | ; will take place. Using all-uppercase makes this definition |
||
15 | ; work regardless whether the assembler is in case-sensitive |
||
16 | ; mode or not: |
||
17 | |||
18 | expandop macro BROP,DEST |
||
19 | __COND set substr("BROP",1,strlen("BROP")) |
||
20 | L{__COND} DEST |
||
21 | endm |
||
22 | |||
23 | ; These pairs of statements will result in the same (long) branch: |
||
24 | |||
25 | expandop xbr,1000 |
||
26 | lbr 1000 |
||
27 | expandop xbq,1000 |
||
28 | lbq 1000 |
||
29 | expandop xbz,1000 |
||
30 | lbz 1000 |
||
31 | expandop xbdf,1000 |
||
32 | lbdf 1000 |
||
33 | expandop xbnq,1000 |
||
34 | lbnq 1000 |
||
35 | expandop xbnz,1000 |
||
36 | lbnz 1000 |
||
37 | expandop xbnf,1000 |
||
38 | lbnf 1000 |
||
39 |