Use r10 to point to locals/heap.
Use free_ram instead of ram_start.