[EMAIL PROTECTED] wrote: > As far as I know BP_LET changes a parameter by copying the value on > the maths stack to the address at byte 4 of the parameter entry on > the Name Table. I had assumed that this 4-byte pointer would be set. > Instead MWDEF seems to be copying both the pointer into the name > table as well as the 8-byte entry from the name table.
Yes, it copies that to ensure that the name table entry is still the same (i.e. it's just used for comparison and as a safety net). Question being, is this check necessary, is there any case where just storing the variable address can corrupt memory because of it being moved or anything? I guess for Turbo the answer is a sound "no", but I'm not so sure about the interpreters. It stores the address of the name table instead if the address of the variable itself because it lets BP_LET do the work (and that code is shared with a lot of other possible variants, so I'd need to extract that code path somehow and make it separate). > I assume that at the time the code you quote is obeyed A3 still > points to the name table entry for the channel parameter, but that > A5 has been set to the address of the window definition (perhaps > plus a constant). Almost, A5 points to an internal variable space, allocated as a thing (the "easymenu01230123" things one can see in the thing list). Ciao, Marcel _______________________________________________ QL-Users Mailing List http://www.q-v-d.demon.co.uk/smsqe.htm