macros for get and set the SR register

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

macros for get and set the SR register

ソリューションへジャンプ
1,696件の閲覧回数
c393
Contributor II
Is there a standard macro for get and set of the SR register?
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
727件の閲覧回数
RichTestardi
Senior Contributor II

I don't know if there is anything standard, but this is what I use (for coldfire V2):

 

uint16
get_sr(void)
{
    uint16 csr;
    asm {
        move.w     sr,d0
        move.w     d0,csr
    }
    return csr;
}

 

void
set_sr(uint16 csr)
{
    asm {
        move.w     csr,d0
        move.w     d0,sr
    }
}

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
728件の閲覧回数
RichTestardi
Senior Contributor II

I don't know if there is anything standard, but this is what I use (for coldfire V2):

 

uint16
get_sr(void)
{
    uint16 csr;
    asm {
        move.w     sr,d0
        move.w     d0,csr
    }
    return csr;
}

 

void
set_sr(uint16 csr)
{
    asm {
        move.w     csr,d0
        move.w     d0,sr
    }
}

0 件の賞賛
返信