When targeting the ATMega328P we have 32 general-purpose Registers,
some of which have special restrictions on which instructions they can be used with.
For this Reason we maintain a Register Allocation Table, so during Assembly Code Generation,
we can make a good choice on which Register to use for a temporary value.
TODO
As an Allocator, the RAT manages 32 Registers. Registers can be allocated / freed in any order. When allocating a Register, it is important to know what it will be used for. Because we only manage 32 Registers, we can keep a lot of metadata, as opposed to e.g. Memory Allocators.
The Stack Pointer needs to be setup before the start of the Program.
That's why i consider it part of the RAT, because it needs to be managed.
And maybe it could be setup in a different place.
Typical AVR Program:
Source: https://www.codeproject.com/Articles/712610/AVR-Assembler
ldi r16, LOW(RAMEND) out spl, r16 ldi r16, HIGH(RAMEND) out sph, r16