Does anyone know of a C construct that will generate code similar to that produced with the #pragma DISABLE directive? Specifically I'm looking to get the JBC instruction. I'm trying to emulate the #pragma DISABLE directive for small sections of code within a function. Inline assembly is out since you lose C source level debugging capablility when you compile via the SRC directive. Here's the best I have so far, but I'm (overly) paranoid that the interrupt state could change between the jump and the clear due to a task switch... I'm using Rtx51Tiny:
data BYTE easav; if (EA==0) { easav=0; } else { EA=0; easav=1; }
JB EA,?C0018 CLR A MOV easav?341,A SJMP ?C0019 ?C0018: CLR EA MOV easav?341,#01H ?C0019:
"easave = 0; if (_testbit_(EA)) easave = 1;" Isn't that just a complicated way of saying
ea_save = _testbit_(EA);