This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en:multiasm:piot:chapter_4_4 [2024/09/27 20:19] – created pczekalski | en:multiasm:piot:chapter_4_4 [2025/05/31 06:22] (current) – marcin | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | Data types and encoding | + | ====== |
| + | |||
| + | In assembler, various data types, such as bytes, words, | ||
| + | |||
| + | AVR microcontrollers are classified as 8-bit devices, but the instruction word is 16-bit. | ||
| + | |||
| + | **Data Types in AVR Assembler** | ||
| + | * Single bits: Can be used for logical operations and control, e.g., setting or clearing bits in registers. | ||
| + | * Bytes, 8-bit values: The basic data type in AVR, used to store small integers, ASCII characters, etc. | ||
| + | * Words, 16-bit values: Consist of two bytes, used to store larger integers or memory addresses. | ||
| + | * Double Words, 32-bit values: Consist of four bytes, used to store even larger integers or addresses. | ||
| + | |||
| + | For additional libraries, such as those used in the C language, 64-bit data can be utilized. These data require extra handling. | ||
| + | |||
| + | |||
| + | **Encoding** | ||
| + | * Binary Encoding: Data is stored in binary format, the most fundamental form of data representation in microcontrollers. | ||
| + | * ASCII Encoding: Characters are often stored using ASCII encoding, where a unique 7-bit or 8-bit code represents each character. | ||
| + | * BCD (Binary-Coded Decimal): Sometimes used for applications requiring precise decimal representation, | ||
| + | * Endianness: AVR microcontrollers typically use little-endian format, where the least significant byte is stored at the lowest memory address. | ||