I'm not exactly sure what your are saying, but here is how it works. When you run a program, either a BASIC with prgm, and ASM with asm(, or even an asm with bcall(_executePrgm), it gets copied from where ever it is to $9D95. The program can be in flash, or it can be in ram, either way, space is allocated at $9D95 and the program is copied there. When it is done executing, the OS just deletes that memory and it is is gone, which is why smc doesn't change the program. Also, since memory must be allocated for the program to be run, if you don't have enough ram left, you will get an ERR:Memory.