This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:piot:chapter_4_4 [2024/09/27 23:20] – pczekalski | en:multiasm:piot:chapter_4_4 [2026/03/01 17:46] (current) – ktokarz | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======Data types and encoding====== | + | ====== 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 | ||
| + | In AVR, the data type can be one of the following: | ||
| + | * 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 utilised. These data require extra handling. | ||
| + | |||
| + | |||
| + | ==== Data Encoding ==== | ||
| + | In this subchapter, we present the rules of data encoding in the AVR architecture. | ||
| + | * 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. | ||