This is a bit of a problem, which doesn't have an easy solution.
Why -
Basically, there's no way for SAD to know what an argument is used for. So '9a4' might be an address, but it might be just a plain value, or an index into an array, as I think it is here, from code at 0e5f3 onwards. Sometimes those values are actually "flags (say bit 7) + value (B0-6)" . But it's worse than just that...it gets more complicated because banks are 'nailed on' and not integrated into opcodes. So it's HORRID!! to sort out, and need user commands.
In a single bank like A9L, if you declare a symbol at 9a4, then it can be checked against an argument value, and assumed it's an address, so the symbol name will get printed. But it still might be wrong. It's a best GUESS.
In a multibank, data is normally in Bank 1 (BUT NOT ALWAYS!) so 9a4 could be 109a4 (ie. in Bank 1), but in the case shown here it is seems NOT to be a simple address, so what to do ??? If I just force a bank 1 to be added to all argument values above 0x3ff, that can't be right...
The SYM command forces all 'bankless' addresses above 0x3ff (i.e. the registers) to be bank1, so the name will get saved as 109a4, because for a symbol it IS an address. But this will never match any argument value with a 'bare' 9a4.
And frankly I don't know how to solve that.
You can set the argument with a command to be an address and to look for a name, it will then match the sym, but it will still have to be a user command.
But here, I'm not convinced that's correct in the first place ?
NB. looking at that code again, my comments, but this is all guesswork
Code: Select all
0e5f3: a2,2a,46 ldw R46,[R2a] R46 = [R2a]; # get argument (the '9a4')
0e5f6: 3f,46,06 jb B7,R46,0e5ff if (B7_R46 = 0) { # if negative ?? or a flag to do rounding ? but bit is set for '9a4' so skips it
0e5f9: 91,80,46 orb R46,80 R46 |= 80; # this kind of thing is often used for rounding up (or down)
0e5fc: c2,2a,46 stw R46,[R2a] [R2a] = R46; } # store modified value back
0e5ff: 49,00,09,2a,46 sb3w R46,R2a,900 R46 = R2a - 900; # '9a4' jumps here, so R46 = a4
0e604: 65,e6,6b,46 ad2w R46,6be6 R46 += 6be6; #6be6 + a4 = 758a
0e608: a2,46,26 ldw R26,[R46] R26 = [R46]; # this must be an address so R26 = [1758a] (= 'b2')
What's around that address ? A list of values, may be error codes? No obvious pattern, so don't know.
If you look further down at 0e62d onwards, there are blocks of code which say if (R2c = 8, if R2c = 5) which is second argument,
so that looks like subroutine is doing some kind of ' perform action <arg 2> with value of <arg 1>' and <arg1> may have extra flags, or may be signed?
Hope that helps.