This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to add .s file in IAR workbench 6.4 project?



Hi,

I have a .s file which i wants to add it in my IAR project and use their functions.

while compiling its give error for all immediate data instructions.

code:

 xor.b  CNT1,#0x01,W0
 bra   Z,_RRF_KEY
 
 ; CLRC
 bclr  0x0042, #0

Thanks

  • Akila,

    I believe you need an .s43 file to use assembly with IAR. The following app note may help: www.ti.com/lit/slaa140

    I would check with IAR support however to get a full answer to your inquiry.

    Regards,
    JH
  • Those are not msp430 opcodes, so it will never work.
  • Thanks Tony.

    Then what is the opcodes for msp430. do we have any list or document related to asm opcodes?

     

    Thanks,

    Akila.

  • ADD(.B)  src,dst  src + dst » dst 
    
    ADDC(.B) src,dst  src + dst + C » dst
    
    AND(.B)  src,dst  src .and. dst » dst 
    
    BIC(.B)  src,dst  .not.src .and. dst » dst
    
    BIS(.B)  src,dst  src .or. dst » dst 
    
    BIT(.B)  src,dst  src .and. dst 
    
    CALL     dst PC+2 » stack, dst » PC
    
    CMP(.B)  src,dst  dst - src
    
    DADD(.B) src,dst  src + dst + C » dst (decimal)
    
    JC/JHS   Jump to Label if Carry-bit is set
    
    JEQ/JZ   Jump to Label if Zero-bit is set
    
    JGE      Jump to Label if (N .XOR. V) = 0
    
    JL       Jump to Label if (N .XOR. V) = 1
    
    JMP      Jump to Label unconditionally
    
    JN       Jump to Label if Negative-bit is set
    
    JNC/JLO  Jump to Label if Carry-bit is reset
    
    JNE/JNZ  Jump to Label if Zero-bit is reset
    
    MOV(.B)  src,dst  src » dst
    
    PUSH(.B) src SP - 2 » SP, src » @SP
    
    RETI Return from int TOS » SR, SP + 2 » SP
    
    RRA(.B)  dst  MSB » MSB ....LSB » C
    
    RRC(.B)  dst  C » MSB .........LSB » C
    
    SUB(.B)  src,dst  dst + .not.src + 1 » dst 
    
    SUBC(.B) src,dst  dst + .not.src + C » dst 
    
    SWPB     dst swap bytes - - - -
    
    SXT      dst Bit7 » Bit8 ........ Bit15
    
    XOR(.B)  src,dst  src .xor. dst » dst
    
    
    
    The others are emulated by using #0 as source for example.
    

    http://www.ti.com/sc/docs/products/micro/msp430/userguid/as_5.pdf

**Attention** This is a public forum