Regarding your latest PDF posted above, could you move the "Make_Labels.AMOS" bubble on page 19 to the left so it doesn't cover up what I presume is LEqu.s?
Thanks: Done
The way I put this stuff together is to "brain dump" the text. Then put the pretty pictures together (I'd never used Visio before but it's so easy. Just like using Lego
). Then finally get the layouts looking right.
The last doc is a bit cut off in the middle. So I'll try and get it documented through to the end of library loads a.s.a.p. It will make a lot more sense then.
I think the code is a hack from the original AMOSPro executable sources as it adds 1 to an Instruction Routine Number but doesn't for a Function Routine Number. Which is what the original jump tables did. The jumps and tokens were embedded in the AMOSPro executable and seem to be laid out as Function jump offset / Instruction jump offset / Token // Function jump offset / Instruction jump offset / Token // etc. Hence the add 1 to an Instruction's Routine Number.
Then it puts it all right for the V2.0 library format (the plus 1 is "corrected") when it goes through the tokens inserting the Parameter Fetch Routines. So the end effect is just the same as for a pre-V2.0 library. The big difference is that there will only be one jump offset word for a token when it's complete. The other word is taken up by that set of parameter flags. So for Reserved Variables (Instruction + Function) the routine addresses
must follow each other in the Addresses Table. The offset will only point to one address in the table. The other address is always assumed to be the next one. That's why the hangover from the original AMOS Pro where it adds 1 to an Instruction's address number.
If you look at the way the +LEqu.s lists the Routine Numbers, you'll see that the ones used for AMOS Basic Instructions are laid out with the function always following the instruction for Reserved Variables. And, luckily for us they stuck to the strong naming convention of L_Inxxx and L_Fnxxx for Instructions and Functions respectively. Eg.:
L_FnHunt: set 574
L_InAReg: set 575 ; Areg() Instruction
L_FnAReg: set 576 ; Areg() Function
L_InDReg: set 577 ; Dreg() Instruction
L_FnDReg: set 578 ; Dreg() Function
L_IReg: set 579But at the stage the docs are up to, that's not shown yet. Apologies if that's just making it more confusing. The next instalment should clear it all up.
Back to the grindstone....