Cbn new ldr to bank

A low-level programming question!

When a new leader (ldr) is loaded into the bank, it means that a new program or code is being executed from a specific memory location. Here's a breakdown of the process:

  1. Bank selection: The microcontroller (MCU) selects a specific bank of memory, which is a contiguous block of memory addresses. Each bank typically has its own dedicated memory space.
  2. Leader loading: The MCU loads a new leader (ldr) into the selected bank. The leader is a small piece of code that sets up the memory space and prepares it for execution.
  3. Program counter update: The program counter (PC) is updated to point to the starting address of the new leader in the selected bank.
  4. Execution: The MCU starts executing the new leader code, which initializes the memory space, sets up registers, and prepares the MCU for executing the main program.

In some microcontrollers, the leader is also referred to as the "bootloader" or "initialization code." Its primary function is to initialize the MCU's hardware and software components, such as setting up the memory map, configuring peripherals, and initializing the stack.

When a new leader is loaded into the bank, it typically involves the following steps:

After the leader is loaded and executed, the MCU is ready to execute the main program, which is typically stored in a different memory bank or region.