TDE - Why does my WATCH window not track my FILE REGISTERS correctly?

Submitted by: TechTools

a) SPASM and pre-5.1 versions of CVASM16 do not encode enough information for TDE to determine which register bank the variables are supposed to be in. TDE mistakenly assumes register bank 0. The WATCH window will actually show the contents of the variable’s offset within bank 0. The solution is to use TDE version 3.1 or later and CVASM16 version 5.1 or later.

NOTE: CVASM16 (5.8) is fully compatible with the Parallax PASM and SPASM assemblers. Also note that this issue involves ONLY the watch window, not the SPECIAL register window.

b) Some register bits are automatically cleared when certain registers are read. In particular, the SPI receive full and PSP full bits are cleared when their corresponding DATA registers are read. The emulator READS these registers each time the file register window and/or special register window are refreshed. Of course this happens when the emulator breaks, is halted, steps or animates. They are also refreshed when any register is modified. The ACT of READING these registers to display them clears the bits of interest. You should close the special register and file register windows while stepping through this type of code. Another option is to avoid stepping through the code (run full speed to a breakpoint following the code. Another approach is to have the code itself copy the status register to another file register location, and then place a watch on that location.

c) Note that many of the chips with A/D converters default at power-up with port A configured as ANALOG INPUTS. This causes these pins to always read as 0. Mathias properly emulates this behavior. You must disable A/D before you can use PortA for Digital I/O.

d) If you have Version 5.1 or later of CVASM16, and you are working with code that was created under an earlier version, verify the ORG statements for your variables. The current assembler will accept the old relative addressing format used by the older versions, but you will not eliminate the issues mentioned in a) until you start using absolute addressing for the file registers. For example, variables declared at address A0h WERE ORGed at 20h (offset 20 in some bank) in older releases. NOW, you should ORG it at A0h (the absolute address).