Assuming it works (not tested yet), this is insane:
And no, @nsaspook, there is no way to write this in C that will work.
God, the hoops I have to jump through.
Ironic: I cannot write naturally in the target MCUs natural language.
C:
asm("BANKSEL _ws_red");
asm("bcf" ___mkstr(BANKMASK(INTCON0)) "," ___mkstr(_INTCON0_GIE_POSITION) ",0");
asm("bsf" ___mkstr(BANKMASK(LATD)) ",3,0");
asm("rlcf _ws_blue,1,1");
asm("rlcf _ws_red,1,1");
asm("rlcf _ws_green,1,1");
asm("bc $+6");
asm("bcf" ___mkstr(BANKMASK(LATD)) ",3,0");
asm("bra $+6");
asm("bra $+2");
asm("bra $-6");
asm("btfss" ___mkstr(BANKMASK(STATUS)) "," ___mkstr(_STATUS_C_POSITION) ",0");
asm("bcf _ws_blue,1,1");
asm("btfsc" ___mkstr(BANKMASK(STATUS)) "," ___mkstr(_STATUS_C_POSITION) ",0");
asm("bsf _ws_blue,1,1");
asm("decfsz _ws_bitcnt,1,1");
asm("bra $-28");
asm("bsf" ___mkstr(BANKMASK(INTCON0)) "," ___mkstr(_INTCON0_GIE_POSITION) ",0");
God, the hoops I have to jump through.
Ironic: I cannot write naturally in the target MCUs natural language.
Last edited:



