STM8
The STM8 is an 8-bit microcontroller family by STMicroelectronics.[src] The STM8 microcontrollers use an extended variant of the ST7 microcontroller architecture.[src] STM8 microcontrollers are particularly low cost for a full-featured 8-bit microcontroller.[src]
The STM8 is an 8-bit microcontroller family by STMicroelectronics.[src] The STM8 microcontrollers use an extended variant of the ST7 microcontroller architecture.[src] STM8 microcontrollers are particularly low cost for a full-featured 8-bit microcontroller.[src] ==Changes compared to ST7== The STM8 instruction set is mostly a superset of the ST7's, but it is not completely binary compatible.[src] Operations on the X and Y registers are extended to 16 bits.[src] Thus, loads and stores access two bytes of memory rather than one.[src] (Also, the half-carry flag has been changed to reflect the carry from bit 7 to bit 8 of the 16-bit result, rather than the carry from bit 3 to 4.) Interrupts push nine bytes of state instead of five as on the ST7.[src] The multiply instruction stores the 16-bit product in the specified index register (e.g.[src] X), rather than dividing it between X and A.[src] Indirect addressing modes which fetch an 8-bit address from memory (opcodes 92 2x , 92 3x , 92 Bx , 92 6x , 92 Ex , 91 6x , and 91 Ex ) have been deleted; all indirect addressing modes fetch 16-bit addresses.[src] A new prefix byte 72 has been added, and used to encode indirect starting with a 16-bit address.[src] The bit manipulation instructions have been changed to take a 16-bit address and to require the 72 prefix byte.[src] The unprefixed opcodes 0x and 1x they formerly occupied are instead used for stack-pointer relative addressing.[src] Some rarely used branch instructions have had their opcodes changed to require a 90 prefix, and the unprefixed opcodes reassigned to signed branches which depend on the V flag.[src] Load and compare instructions targeting the X register are of little use on the ST7 with addressing modes indexed by the X register.[src] On the STM8, when such operations specify a memory operand indexed by the X register, the register operand is changed to Y.[src] With a 90 prefix, the registers are reversed so the index register is Y and the operand register is X.[src] One major performance difference is that the STM8 fetches 32 bits from ROM per cycle, and many instructions take one cycle to execute.[src] Depending in the instruction length and the number of cycles needed execution from RAM is somewhat slower.[src] The ST7, in contrast, fetches 8 bits per cycle and takes one cycle per instruction byte.[src] ==Instruction set== Most STM8 opcode bytes consist of 1 bit of type (one- or two-operand), three bits of addressing mode, and four bits of opcode.[src] Only 6 addressing modes and 12 one-operand opcodes are assigned, leaving encoding space where other instructions are placed.[src] STM8 instructions consist of an optional prefix byte ( 72 16 , 90 16 , 91 16 , or 92 16 ), an opcode byte, and a few (up to four, but rarely more than two) bytes of operands.[src] Prefix bytes mostly modify the addressing mode used to specify the memory operand, but in some cases, prefixes 72 and 90 change the meaning of the opcode byte completely.[src] Prefix 90 exchanges X and Y in the following instruction.[src] In the table below, these variants are combined on one line by writing "X/Y", which means either "X" or "Y".[src] Prefix 90 is also used in two places to introduce new opcodes: the BCPL and BCCM instructions, and some branch conditions.[src] Prefix 92 converts instructions with an offset operand (addr16,X) to indirect addressing ([addr8],X).[src] The offset is replaced by the 8-bit address of a 16-bit offset value in memory.[src] It is used only for this function.[src] Prefix 91 has both of the preceding effects, converting (addr16,X) addressing modes to ([addr8],Y).[src] Prefix 72 is used in a number of places, in a much less regular pattern.[src] In some cases, it introduces new addressing modes (particularly an ([addr16],X) 16-bit indirect mode), but it also introduces many completely new operations.[src] For CPW and LDW instructions where the operand addressing mode is indexed by X, the STM8 uses the Y register by default instead of X.[src] Applying a 90 prefix exchanges X and Y so the register is X and the addressing mode is indexed by Y.[src] ==References== ==External links== Manufacturer's website on STM8 Comparison of C compilers for STM8 eForth for STM8 Hackaday articles related to STM8 Hackaday projects using STM8[src]
39 sentences · 39 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"STM8." encyclopegia.org, 2026, https://encyclopegia.org/wiki/stm8. Accessed 27 November 2026.
Chicago
"STM8." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/stm8.
APA
encyclopegia.org. (2026). STM8. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/stm8
Accessed November 27, 2026 · CC BY-SA 4.0 · citation page · JSON