martyn_hill wrote:On a side note, I've already found at least one duplication of routine (ID: 204 - "RETRY_HERE") that appears twice in my disassembly (so far), only with very slightly different offsets for the BCC and LEA instructions (due to position-dependence)
The bcc's are the same, both $6404. The LEA's are pointing to different addresses.
I think I came across the same routine appearing twice in a program once before. Both doing the same job. Can't off hand remember what I did about it.
I'm getting a little confused, Earlier you were talking about routines ending in the form JMP $00(a6,d0.L), but the sample you just supplied ends in JMP -$7C90(a6)?
JMP -$7C90(a6) is the format I have seen in all the compiled programs I have looked except FTCII. And I thought yours was doing the same as FTCII.
If you don't have a RETRY_HERE command in your source program, I would be surprised if the routine appeared in the executable code. I have not seen it in any of the test programs I have written without it.
RETRY_HERE is something I have only just come across when I was trying to find out which Turbo Toolkit commands were being handled by the compiled program internally, or were being called externally, such as things like PAUSE and OPEN. Although the RETRY_HERE routine is in the TCLibrary2_lib, I'm pretty sure that the decompiler program I up loaded here doe's not know about it .
In fact when I was trying to use WHEN_ERROR (or whatever it is in Turbo) in a test program. I could not get it to compile without error. It would fail on the END_WHEN (can't remember the error).
You may have figured this out already.
The A5 register is a pointer to the current position in the 'coded' SuperBASIC program. A1 is a pointer to a stack (the maths stack in QDOS). A4 I think is a pointer of some sort to the variables(not quite worked that one out). A6 is a fixed position in memory that just about everything revolves around. I think A6 is chosen so that you can swing plus and minus 32K from it, and can have jobs up to 64K in size.
I'm about 5% the way through the 200-odd code IDs
I don't know what technique you are using for identifying the routines, But if you look at the section on hand decompiling at the back of the DisCharge Manual, You know what the original code was, so you can quickly identify routines, or make an educated guess as to what they may be. It also helps you understand the structure of the 'coded' SuperBASIC.