Multiple Watch Directives
Hello All;
In some earlier versions of the SX assembler one could have more than one WATCH directive referincing the same variable. This was useful to observe simulaneously the value in binary as well as in hex. Sometime during the upgrade process this nice feature has gone away; an error now occurs if two WATCHes reference a same variable.
Is it possible to get this feature restored ????....· Please???
Peter
·
In some earlier versions of the SX assembler one could have more than one WATCH directive referincing the same variable. This was useful to observe simulaneously the value in binary as well as in hex. Sometime during the upgrade process this nice feature has gone away; an error now occurs if two WATCHes reference a same variable.
Is it possible to get this feature restored ????....· Please???
Peter
·
Comments
Hard to say, as this one is definitely a Parallax decision. The way SASM builds its symbol table doesn't lend itself to allowing multiple definitions of the same symbol. While it would be possible (anything is possible in software) to modify SASM to allow multiple symbol definitions for WATCH directives, itt's not an easy task due to the way SASM was originally architected.
Thanks, PeterM
this problem...·· ...I'll have to look into how I did it.
Seem to me that I had made some temporary variables,
referencing the same locations as the real ones that
I wanted to watch twice...
-Dan
·
Peter, by your response, I'm not sure I adequately explained what has gone missing. It is simply watching the same RAM variable name twice or more times simultaneously, not multiple different names for the same RAM location. So I suspect it does not require an assembler change.
This feature existed previously, but just now I can't recall in what version. If it helps, I will try to go though my archives to find out at what point it disappeared.
Example:
watch flagbyte,8,ubin
watch flagbyte,8,uhex
watch flagbyte,8,udec
Hope this makes it clearer.
Thanks,
Peter
Dan's tip is a good workaround, for example:
flagbyte DS 1
flagbyte1 = flagbyte
flagbyte2 = flagbyte
watch flagbyte,8,ubin
watch flagbyte1,8,uhex
watch flagbyte2,8,udec
passes the assembler without error. I did not check it with the debugger but I'm pretty sure that it should work.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I just tried your (now obvious) solution, and the debugger is also happy with that.
Wonder why I hadn't thought of that. I guess I was looking for the feature previously available.
With only slightly more inconvenience, this aliasing idea works, and is an adequate solution.
Thanks for the help.
Peter
Actually, I understood your problem exactly. The problem is that SASM use a binary tree for storing the symbol table. While you can store more than one item with the same name, the problem is when you go looking for it. In order to find an item, you have to start at the root node and then search node to node (using the next node pointers) until you find the item. If you find it, you terminate the search.
If you have more than one item with the same name, it means you always have to search throught the entire tree in case you have more than one item with the same name but a different type. This is much less efficient than stopping the search when you find the item. This is why I said it would require some real work on SASM to allow this feature.
Of course, the alias ability makes it a somewhat moot point.
Thanks, PeterM
Alternatively the hash bin can just point to a bin tree, while this still requires searching the entire tree, the hashing algorithm automatically subdivides the entire tree into N subtrees (N being the number of bins) and that subtree is gauranteed to contain all instances of an identically named symbol,·subdividing the amount of time required to search the tree for all instances by N for only a small fixed cost (the computation time of the hashing algorithm). But like you said this would require modification, and the need for it is somewhat limited. After all, when computing the upperbound of the number of symbols for 4KB of code yeilds a fairly small number, especially when you consider the average program doesn't come close to that upperbound.
These approaches only become nessesary when your number of symbols are in the many thousands, or if your search time has a real-time constraint.
Paul
Post Edited (Paul Baker) : 1/27/2005 5:09:47 PM GMT
Not being a "big systems" or "heavy duty" programmer at heart, I have only the faintest idea of what you two are talking about. And that's a good thing, as I have no real interest in that side of the business. Embedded processors and hardware on the other hand, ........ I can't get enough of them.
So thanks again for your responses, I will leave it alone now that the only slightly less convenient alias approch does what I need.
Peter
a loooooong time ago, when Wordstar was the word processor software on CP/M machines, I wrote a spell checking software with extensive use of hash coding, binay trees (balanced or not), etc. These techniques worked out great speedwise on such machines. clocked at 1 to 4 MHz.
Today, with computers clocked far above UHF TV frequencies, searching a symbol table with just - maybe - several hundred entries for an SX program should not really be a timing concern - even a KISS linear search would do the job fast enough.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I did not see Mary eiter here...
As a matter of fact, my aunt's first name is Mary, and she's only 10 years older than I am - thanks to my grand parents with their "late success". They did not only "create" Mary but Helen as well at the same time, IOW Mary and Helen are twins
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
so you are the "Paul" in this story ???
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G