use array instead of malloc; fixed SAVE_STACK_POINTER_ASM, RESTORE_STACK_ASM