RAM on a small part is often a few kilobytes, so tables that never change belong in flash. On a typical 32-bit Cortex-M part, a file-scope object declared const is placed in flash by the toolchain and read at its address:
const uint8_t lookup[4] = {0, 90, 127, 90};
On a typical 8-bit Harvard part, flash sits in a separate address space, and the compiler may need a special keyword to read it, so check the toolchain manual.
The stack holds the return address, saved registers and local variables of every call still in progress. On a typical small part it shares RAM with your global variables and grows toward them, and by default nothing checks its size: when it grows too far it silently overwrites data. Recursion is risky because its depth can depend on the input, so its worst case is hard to bound. A large local array is risky because the whole array sits on the stack while its function runs. If each call takes c bytes and B bytes are free for the stack, the depth is at most ⌊B/c⌋ calls.
WRAP-AROUND OF UNSIGNED INTEGERS
xstored=xmod2N
Holds when any integer result x is stored in an unsigned type of N bits: the stored value lies from 0 to 2N−1, with no warning. So 3 - 5 stored in a uint8_t gives 254. C first converts uint8_t operands to int (integer promotion), so the sum is formed in int and wraps only when stored. Overflow in signed arithmetic, such as int, is undefined: C gives it no result, so never rely on it.