The application discloses a controller, a program execution method and an electronic device, and belongs to the technical field of
integrated circuit design. A first
storage area of the controller is configured to store first instruction codes of an application program, the first instruction codes include at least one target function position, a function at the target function position is a function to be updated, and a
function pointer corresponding to the function to be updated is further configured at the target function position. A processor of the controller is configured to acquire second
machine codes, store the second
machine codes in a second
storage area, and the second
machine codes are results after the function to be updated at the at least one target function position is updated. The first machine codes are executed, and in the case that the first machine codes are executed to the target function position, the second machine codes in the second
storage area matched with the
function pointer are executed according to the
function pointer at the target function position. Therefore, the flexibility of program updating can be improved.