• AVR Freaks

Hot![ATTINY1614 XC8] asm("LDS") converted to LDS / SBC

Author
Aeronautics
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/01/19 08:04:03
  • Location: 0
  • Status: offline
2020/10/20 04:43:45 (permalink)
5 (1)

[ATTINY1614 XC8] asm("LDS") converted to LDS / SBC

Hi. I need extremely fast interrupt execution, so I've decided to rewrite some snippet of my C code into ASM to reduce registers usage and PUSH / POP instructions amount.
I want to read TCB0.CCMP register (TCB0 : 0x0A40 + CCMP : 0x0C-0x0D):
    asm("LDS R24, 0x0A4C");
    asm("LDS R25, 0x0A4D");

As it occurs, under disassembly listing these lines are converted into:
    225: asm("LDS R24, 0x0A4C");
0126 9180 LDS R24, 0x00
0127 0A4C SBC R4, R28
    226: asm("LDS R25, 0x0A4D");
0128 9190 LDS R25, 0x00
0129 0A4D SBC R4, R29

Why such conversion happened?
#1

1 Reply Related Threads

    andersm
    Super Member
    • Total Posts : 2848
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: [ATTINY1614 XC8] asm("LDS") converted to LDS / SBC 2020/10/20 10:21:34 (permalink)
    +2 (2)
    Looks like a bug in the disassembler. The SBC is just the second half of the 32-bit opcode decoded as an instruction (look at the hex values).
    post edited by andersm - 2020/10/20 13:36:04
    #2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5