Thanks Eliot. Your linked article clears it up: http://www.mirandabanda.org/cogblog/2008/07/22/closures-part-ii-the-bytecodes/
140 10001100 kkkkkkkk jjjjjjjj Push Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
This fetches the local at offset j..j on the stack and push the k..k�th element in it.
The next two store into the k..k�th element of the local at j..j, one
version popping the result off the stack. This is a general convention
in the Smalltalk-80 compiler. These are store and store-pop forms of
almost every store opcode. The store form is used in the stores into
vat and vax in things like
var := vat := vax := expr
whereas the pop form gets used in the store into var.
141 10001101 kkkkkkkk jjjjjjjj Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
142 10001110 kkkkkkkk jjjjjjjj Pop and Store Temp At kkkkkkkk In Temp Vector At: jjjjjjjj
The final bytecode is more interesting.
The wording is unclear to me: "This fetches the local at offset j..j on the stack and push the k..k�th element in it."
Does it mean, get local at index j..j and push onto the stack the k..k'th element in it?
So
109 <8C 00 01> pushTemp: 0 inVectorAt: 1
Get temp at 1 (j..j) and push element at 0 (k..k) ??
97 <8E 00 01> popIntoTemp: 0 inVectorAt: 1
get vector at temp index 1 (j..j) and pop and store stack value into element 0 (k..k) ??
116 <8D 00 01> storeIntoTemp: 0 inVectorAt: 1
I dont understand this one, store what? into element 0 of vector at 1 ??
In the pop variation I can understand where the value is coming from, but not the above
form. Please can you clarify?
Rgs, James.