assemblyavrinstruction-set

AVR Instruction Sets and "missing" instructions by device


I'm trying to build a table of "missing" AVR instructions by device.

For want of any available documentation, I've been comparing the source-code of avra, gavrasm and avrlass and I don't seem to be able to find any concensus.

For example, the ATtiny2313, according to the avra source lacks MUL, EIJMP, EICALL, JMP, ELPM, and ESPM.

But according to gavrasm, it doesn't have MUL, FMUL, EIJMP, EICALL, JMP, CALL, ELPM, ELPM/Z, SPM/Z, DES, XCH, LAS, LAC, LAT.

(avrlass is an outlier here because it expects the user to specify which of the AVR, AVRe, AVRe+, AVRrc, AVRxm, or AVRxt instruction sets are being used)

Does anyone know where I can find a (preferably, machine readable) "single source of truth"?

Ideally, I'd like a table of instruction set by device, and a table of which instructions are supported or missing in each instruction set.

Although bearing in mind Atmel/Microchip's "love" for such things, I expect there to be several situations where "device X supports instruction set Y EXCEPT (insert peculiar corner case here)".

I've also downloaded the (ATDF) XML specs from https://packs.download.microchip.com/ but these don't seem to include instruction set.


Solution

  • The answer is not that simple. A part of it can be found in compiler sources like avr-gcc, though that's not from first principles, of course...

    avr-mcus.def summarizes properties of the AVR devices as recognized by stock avr-gcc. Columns of interest are the 2nd which is the core familiy, and the 3rd column that describes some ISA properties that are more fine grained.

    avr-devices.cc provides details on the core families.

    For example, when avr-devices.cc has the MUL flag set, then the core (and hence all devices that belong to it) support MUL, MULS, MULSU, FMUL, FMULS, FMULSU. In avr-gcc lingo, that's the case for the cores avr4/5/51/6 and avrxmega2/3/4/5/6/7.

    The read-modify-write instructions XCH, LAS, LAC, LAT are supported when AVR_ISA_RMW is set.

    EIJMP and EICALL are supported when the flash size exceeds 128 KiB, i.e. when the device has a 3-byte PC (avr6 and avrxmega6/7).

    JMP and CALL are supported when the flash size exceeds 8 KiB, but there are exceptions ATmega808 and ATmega809 that support these instructions even though the flash size is 8 KiB.

    Support for ELPM and ELPMx can be found in avr-devices.cc, with the exception of at least AT43USB320. That device supports external flash > 64 KiB but as far as I know does not support ELPM. The data sheets don't provide enough information.

    For DES and SPM I don't know. DES is only supported by a handfull of devices.