A method is proposed for virtual enlargement of the stack of a portable data carrier allowing reloading of executable program code. To permit the execution of programs requiring a larger stack than that physically present, the stack is segmented into at least two stack segments and their fill state monitored. When complete occupation of a segment is recognized, the oldest stack segment is swapped out to a further storage medium. The further storage medium is a nonvolatile read-write memory that can be a slower memory compared to the stack. When sufficient memory space is available in the stack again, the swapped out segment is returned. The method includes managing a destination address of each stack segment swapped out to the non-volatile read-write memory in a register in a volatile read-write memory.
Provided are a method, system, and program for allocating call stack frame entries at different memory levels to functions in a program. Functions in a program accessing state information stored in call stack frame entries are processed. Call stack frame entries are allocated to the state information for each function, wherein the call stack frame entries span multiple memory levels, and wherein one function is capable of being allocated stack entries in multiple memory levels.