Addressing arrays __asm lda array[1];

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

Addressing arrays __asm lda array[1];

ソリューションへジャンプ
3,465件の閲覧回数
CarlFST60L_2nd
Contributor I
Should be a simple one ( i think)



static char Array[10];

void main(void){
__asm lda  Array[1];      //Cannot get this one line to work? error C18123
}



ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,550件の閲覧回数
bigmac
Specialist III
Hello,
 
I am not sure of the device you are targeting - I assume it might be the HC(S)08.
 
Within your CW installation, there should be a manual for the compiler, e.g Compiler_HC08.pdf.  Within this manual there likely to be a section headed "High Level Inline Assembler".  Also may be of interest, within the section "ANSI-C Frontend", a sub-section headed "Defining C Macros containing HLI assembler code".
 
Regards,
Mac
 

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
1,550件の閲覧回数
bigmac
Specialist III
Hello and welcome to the forum.
 
For inline assembly use the instruction should take the following form:
 
__asm lda  Array:1;
 
However, within a "normal" assembly program, the equivalent instruction would be -
 
  lda  Array+1
 
Regards,
Mac
 
0 件の賞賛
返信
1,550件の閲覧回数
CarlFST60L_2nd
Contributor I
Thanks, will try that. (I think i did try that, i tried many things, most obviously Array+1 with diffrent brackets).

Can I ask where specifically in the help files that was, or how it was interprated from the help files?




Message Edited by CarlFST60L_2nd on 2007-07-09 03:03 AM
0 件の賞賛
返信
1,551件の閲覧回数
bigmac
Specialist III
Hello,
 
I am not sure of the device you are targeting - I assume it might be the HC(S)08.
 
Within your CW installation, there should be a manual for the compiler, e.g Compiler_HC08.pdf.  Within this manual there likely to be a section headed "High Level Inline Assembler".  Also may be of interest, within the section "ANSI-C Frontend", a sub-section headed "Defining C Macros containing HLI assembler code".
 
Regards,
Mac
 
0 件の賞賛
返信
1,550件の閲覧回数
CarlFST60L_2nd
Contributor I
Thanks, that worked!

I guess the answer is in this?

(Copied directly from the Codewarrior help files on inline assembly)

http://rafb.net/p/0bPzPO30.html

Factor        = ( Expression ) | Factor {: Factor|MSB)}

?


0 件の賞賛
返信