A method and apparatus for native method invocation and changing memory
bank. A method return frame of a smart card stores the status of a native
method invocation, and a memory bank flag points a program counter to a
runtime environment (RE) memory bank or an operating system (OS) memory
bank. First, upon a method invocation, the method return frame is pushed
and set as a native method invocation when the method invocation is the
native method invocation. Then, the memory bank flag points the program
counter to the OS memory bank. Next, the method return frame is popped
after the native method has been executed. Finally, the memory bank flag
is changed to point the program counter to the RE memory bank if the
method return frame is set as the native method invocation.