I wrote simple debugger script (uVision 2.4) which simulate mapped to XDATA memory space parallel register (mapped to XDATA 0xFF80). The main idea of the following script is like this: rigth after pressing button "Start Monitor" debug function rd0() should start to monitor all read accesses to XDATA address 0xFF80 and substitute result of read access by the current value of RD_VAL. The value of RD_VAL can be controlled by functions setFF() and set00(). Printf in rd0() prints correct value (i.e. the one which was substituted). But actual value of accumulator A is not changed. Does anyone have idea for reason of this? Probably, I missed something?
define int RD_VAL signal void rd0() { while (1) { rwatch(X:0xFF80); A=RD_VAL; printf("%02X\n",A); } } func void setFF() {RD_VAL=0xFF;} func void set00() {RD_VAL=0x00;} RD_VAL=0x00; define button "Start Monitor", "rd0()"; define button "Set to 0xFF ", "setFF()"; define button "Set to 0x00 ", "set00()";