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.

Using the ZC bit of MSP430X prefix words in MSP430-GCC 4_02_00_00 assembler

I had hoped that the latest version finally supports setting the zc field of msp430x instructions in assembler

(or maybe it does but it's just not documented). For example, I like to add two registers decimally using

DADDX but without using the carry. While we can write this:

clrc
daddx.b  R4, R5

which resembles to: 0xc312 (clrc), 0x1840 0xa445 (dadd...), we could also simply use 0x1940 0xa445

which would be the same daddx but ignoring the carry. But I have no idea how to express this in assembly

language...

  • The assembler has no instruction for this because TI did not define one.

    You could insert the value directly:

    .word 0x1940, 0xa445
  • Clemens Ladisch said:

    The assembler has no instruction for this because TI did not define one.

    So TI should go ahead and define it. Or did they invent that feature just because they

    had a spare bit available in the prefix word and didn't want to use it seriously? BTW,

    the naken disassembler translates it to

    rptc #1 daddx.b r4, r5
    vs.
    rptz #1 daddx.b r4, r5

    but this is probably their invention....

    You could insert the value directly:

    .word 0x1940, 0xa445


    Well, 40 years ago I did this. Maybe I should have mentioned that I don't want to fall back

    to programming habits from the 70's...

  • I don't want to fall back to programming habits from the 70's...

    Use a macro. Or fix the assembler (it's open source).

  • Clemens Ladisch said:

    I don't want to fall back to programming habits from the 70's...

    Use a macro. Or fix the assembler (it's open source).

    Funky suggestion. How to fix the assembler if there is "no instruction for this because TI did not define one"?

    Invent my own syntax? I even might patch gas (I did it already to make it compatible to the old asm430.exe

    w.r.t. local lables and .newblock) but first TI has to define the syntax...

  • Maybe s.o. from TI can chime in here and make some official statement how the syntax should look like?
    Or s.o. knows how it is handled in code composter or else?
  • Pushing this up. Hopefully TI will comment on it finally.

**Attention** This is a public forum