|
From: Maarten B. <sou...@ds...> - 2025-01-22 16:04:49
|
Philipp Klaus Krause wrote on 2025-01-19 11:42: > The z80 port puts __nonbanked functions into _HOME instead of _CODE. > > Does anyone know why? Looking at svn blame, none of the SDCC devs that > implemented this is still active. > > Philipp I assume that the idea is that any function that is explicitly __nonbanked should be placed in a common bank that is always present. This is exactly what _HOME is for IMHO. The _HOME segment should never be switched out of focus. Everything that is not explicitly __nonbanked should be placed in _CODE under simple non-banking circumstances. But when bank switching is automated (e.g. HUGE memory model) they should be placed in banks and called through a trampoline. In an ideal situation the linker will choose the bank and divide everything from _CODE over the available banks. Note that this can also include library functions and even support routines. The fact that the linker currently cannot perform this task is no reason IMHO to divert from this idea. Maarten |