Date: Thursday, April 13, 1995 From: jamesu@kelvin.mentorg.com Re: Re: Card slot #2 memory question! I would guess that Program2 is the "unsafe" one because the GOSBVL =PUSH# may cause a garbage collection when making room for the number to be pushed, causing the RTN to the Program2 CODE object possibly to RTN to nowhere! Looking at =PUSH#ALOOP, we see essentially the same thing: =PUSH#ALOOP R0=A GOSUBL =PUSH# A=DAT0 A D0=D0+ 5 PC=(A) with one important difference, the GOSUBL =PUSH# is called from ROM, which can never move from its location due to a GC occurring. Mika, I thought there was a different way, involving a GOVLNG =DOBINT (or other data prolog), which would avoid GC when executing from RAM. Finally note that GC may arise from pretty harmless looking calls and thus the programmer may simply have overlooked it. Just compare the two programs below and see if you have understood from above which one may cause a crash and why (although the chances are small). ( Program1: negate # ) ( Program 2: negate # ) CODE CODE GOSBVL =POP# GOSBVL =POP# GOSBVL =SAVPTR GOSBVL =SAVPTR A=-A A A=-A A GOVLNG =PUSH#ALOOP R0=A ENDCODE GOSBVL =PUSH# LOOP ENDCODE