This is my datalogging code broken down.
Code: Select all
<-------Standardized ADX Patch Code------->
Subr_StandardizedADX():
8ff8e: 90,a1,00 orb R0,Ra1 R0 |= flag_reg24; // execute removed code which is the raminit
8ff91: ff nop //list of payload operations at 0xFE00
8ff92: 32,10,00 jnb B2,R10,8ff95 if (B2_HSO_IntPend1 = 0) goto 8ff95;
<----Loop Words() til value of 0000is reached---->
Shadow_Words(): // shadow word ram addresses first
8ff95: a2,33,36 ldw R36,[R32++] tmp2l = [temp7l]; // r36 contains RAM address, R32 contains next address
8ff98: 88,36,00 cmpw R0,R36 // end of list check; break to bytes list
8ff9b: df,0a je 8ffa7 if (tmp2l != 0) { // R38= RAM_ADDRESS_VALUE
8ff9d: a2,36,38 ldw R38,[R36] tmp3l = [tmp2l]; // save ram value to shadow address
8ffa0: c3,37,00,c0,38 stw R38,[R36+c000] [tmp2l+c000] = tmp3l; // Loop until end of word list is reached
8ffa5: 27,ec sjmp 8ff93 goto 8ff93; }
8ffa7: 01,30 clrw R30 temp6l = 0;
<----Broke Loop, all byte ram addresses are now shadowed--->
Setup_New_Stack_Byte(): // done once for every stacked byte
8ffa9: 01,40 clrw R40 tmp7l = 0; // r30offset to save to 0x1F_[R30]; doubles as next flag
8ffab: b1,01,42 ldb R42,1 tmp8l = 1; // r40byte thats stacking bit flags // r42 current bit position
8ffae: 10,00 bank 0
8ffb0: a2,33,36 ldw R36,[R32++] tmp2l = [temp7l];
Shadow_Bits(): // stack bits to standardize flag addressing // R36=ram address; R32 == bit position and XX offset (1FXX)
8ffb3: 88,36,00 cmpw R0,R36
8ffb6: df,38 je 8fff0 if (tmp2l = 0) goto 8fff0;
8ffb8: 89,fe,ff,36 cmpw R36,fffe // check if end of list; break to end // fffe value means to skip that bit position
8ffbc: df,26 je 8ffe4 if (tmp2l = fffe) goto 8ffe4;
8ffbe: b2,36,38 ldb R38,[R36] tmp3l = [tmp2l]; // R38= bitmask_ram_value;
8ffc1: 10,00 bank 0
8ffc3: a2,33,34 ldw R34,[R32++] tmp1l = [temp7l]; // R34 = bit position,offset <--- operational code
8ffc6: 99,00,30 cmpb R30,0
8ffc9: df,0b je 8ffd6 if (temp6l = 0) goto 8ffd6;
8ffcb: 98,35,30 cmpb R30,R35 // check if new shadow stack byte
8ffce: df,06 je 8ffd6 if (temp6l = tmp1h) goto 8ffd6;
8ffd0: 69,04,00,32 sb2w R32,4 temp7l -= 4; // if new bitmask address (doesn't match) current then go save current bitmask // go back up th
e operations list to find the shadow address
8ffd4: 20,1a sjmp 8fff0 goto 8fff0;
8ffd6: b0,35,30 ldb R30,R35 temp6l = tmp1h; // end of current bitmask byte, go save current stacked byte
<----New Byte to Stack Bitmasks----> // R30== new shadow address
8ffd9: 70,34,38 an2b R38,R34 tmp3l &= tmp1l; // check if ram bitmask is set
8ffdc: 98,38,00 cmpb R0,R38
8ffdf: df,05 je 8ffe6 if (tmp3l = 0) goto 8ffe6;
8ffe1: 90,42,40 orb R40,R42 tmp7l |= tmp8l; // if ram bit is not jump to skip enabling stacked bit; // enable stacked bitmask
8ffe4: 01,38 clrw R38 tmp3l = 0;
8ffe6: 99,80,42 cmpb R42,80 // clear test flag for next loop; or set unlogged value to 0; or // "skip" // check if at bit7
== last position of stacked byte
8ffe9: df,05 je 8fff0 if (tmp8l = 80) goto 8fff0;
8ffeb: 7d,02,42 ml2b R42,2 tmp8l = tmp8l * 2; // if end go save new stacked byte of bitflags // increment to next bit, bit shift <<
8ffee: 27,be sjmp 8ffae goto 8ffae;
8fff0: 99,00,30 cmpb R30,0 // loop to do next bitmask position check
8fff3: df,08 je 8fffd if (temp6l = 0) goto 8fffd;
8fff5: b1,1f,31 ldb R31,1f temp6h = 1f; // break to end; else check to see if a current bitmask is in progress (next flag) // 0x1F is a
lways the shadows address range
8fff8: c6,30,40 stb R40,[R30] [temp6l] = tmp7l;
<----NOW is LATER, save the new flag value----> // save stacked byte to shadow bitmasked byte
8fffb: 27,aa sjmp 8ffa7 goto 8ffa7;
8fffd: f0 ret return; // reset bitmasks temporary variables to do next stacked byte
And here is my datalogging ops list function in rzasa .
You can open up tunerpro and uncheck the reverse rows box under preferences so you can type it in.
That's how i do it.
It should be pretty straight forward. Post back if you need more clarity.