M32R HEW build MOT file

when i code LDI R0,#H'C0  my HEW will build the data is: F0 00 90 F0 00 C0(but i thinks it must be 60 C0).

and when i code LDI R0, #H'30 my HEW will build the data is correct: 60 30

i readly need use LDI for imm8 with 0xC0 data.

please help me slove this trouble/

  • LDI loads a signed char or signed short. H'C0 is to big for signed char. So it is coded as signed short and cannot be coded with 60 C0.

    Please use
         LDI     R0, #-64

  • In reply to FrankL:

    thanks you for your reply.
    can you explain for me how to make the data 60 C0 with code.

    best regards.
    Le Hai
  • In reply to Le_Hai:

    Please use
    LDI R0, #-64
  • In reply to Le_Hai:

    Did you try Franks suggestion

    LDI R0,#-64

    The immediate value is signed H'C0 is 192 which is too big for a signed 8 bit number. It can only range from -128 to +127

    by using Franks suggestion of #-64 decimal this encodes to C0 as a signed hex number. The number is twos complement.



  • In reply to FrankL:

    thanks you very much. i did it as your advice the data is good.