Read Accumulator Register from C

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

Read Accumulator Register from C

ソリューションへジャンプ
4,173件の閲覧回数
jimw
Contributor II
Is there a simple efficient way to move the contents of Reg A to a variable in C?
 
 
 
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,421件の閲覧回数
jimw
Contributor II
I think I found it.
 
char t;
 __asm {
 sta t
 }
 
compiles as:
 
  TSX
  STA ,X
 
 
 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,421件の閲覧回数
bigmac
Specialist III
Hello JimW,
 
Whenever a function returns a char value, the returned value will be in the accumulator.  So the following seems to work OK.
 
char funcA(void) {
  asm lda TCNTL;   /* Low byte of timer reg */
}
 
 
char value;
 
value = funcA();
 
Regards,
Mac
 
1,422件の閲覧回数
jimw
Contributor II
I think I found it.
 
char t;
 __asm {
 sta t
 }
 
compiles as:
 
  TSX
  STA ,X
 
 
 
0 件の賞賛
返信