ILEGAL OPERAND WHEN INSERT ASM CODE INTO C CODING

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ILEGAL OPERAND WHEN INSERT ASM CODE INTO C CODING

2,479 Views
ganimides
Contributor I
Hi guys!
 
When use the Codewarrior ASM statement inserting this portion below the compiler gives me some error "ilegal operand".
 
 
THis is what I mean:
 
asm  
    {          
        
        
      mov #$00,DDRD    
      mov  #$30,T2SC        
                         
      mov  #$7F,T2MODH
      mov  #$FF,T2MODL      
      mov  #$08,T2SC0       
      mov  #$08,T2SC1       

        lda   #0x00  
        sta   HexDW
       
        lda   #0x00 
        sta   HexDW+1  --->ilegal operand
       
        lda   #0x00  
        sta   HexDW+2  --->ilegal operand
       
        lda   #0x00 
        sta   HexDW+3  --->ilegal operand
       
        lda   #0x00  
        sta   HexDW+4  --->ilegal operand
       
        lda   #0x00 
        sta   HexDW+5  --->ilegal operand
       
  bla bla bla.....
 
How do I fix this problem?.

Cheers.
 
Ganimides 
Labels (1)
0 Kudos
2 Replies

278 Views
CrasyCat
Specialist III
Hello Not sure which CPU you are targeting, but can you try: sta HexDW:1 instead of sta HexDW+1 CrasyCat
0 Kudos

278 Views
jah
Contributor I
try something like:
_asm nop;
0 Kudos