I'll confirm Ivan's comments on back switching and virtual memory. I programmed IBM PC/XTs that used bank switching.
With virtual memory, the application program's view of memory is one continuous address space and the program need not concern itself with loading or enabling various parts of itself. All modern general-purpose computers use virtual memory.
With bank switching, the program needs to manage the bank switching hardware when it needs to call different parts of itself.
[This description assumes an architecture where the programs run from RAM.]
The normal bank switching scheme only affects a portion of RAM so the low RAM always contains the same program code. The parts of the program that occupy the switchable banks are called overlays, and the portion of the program that does the required bank switching is called the overlay manager. The overlay manager must reside in the low RAM.
When a routine in an overlay needs to be called, the overlay manager must handle the call.
push args
call fun
becomes
push args
call overlay(fun, bank-number)
The structure of the program's executable is then something like this
overlay# address
0 0000h code that's always present
1 8000h code for overlay 1
2 8000h code for overlay 2
etc.
The assembler needs to know where the code is supposed to go, so it needs some meta-commands like ".bank #".
The software tools to automatically analyze programs to optimize overlays are very complex. Early overlay systems required programmers to tell the linker where to put various object files.
(Now you know why overlays went the way of the Dodo!)
--Mark