Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
04/25/07 14:04
Read: times


 
#137928 - or rather try this highly pathological C code :^)
Responding to: ???'s previous message
/* some highly pathological C code following now */
#include <at89x52.h>
#define M0(x) static unsigned char counter##x
#define M1(x) do{if(!--counter##x){P1_##x=!P1_##x;counter##x=1+0x##x;}}while(0)
#define M2(x) M##x(0);M##x(1);M##x(2);M##x(3)
void my_irq_bitwise3(void) __interrupt(1){M2(0);M2(1);}



but it compiles to something you might like:


_my_irq_bitwise3:
        push    acc
        djnz    _my_irq_bitwise3_counter0_1_1,00104$
        cpl     _P1_0
        mov     _my_irq_bitwise3_counter0_1_1,#0x01
00104$:
        djnz    _my_irq_bitwise3_counter1_1_1,00109$
        cpl     _P1_1
        mov     _my_irq_bitwise3_counter1_1_1,#0x02
00109$:
        djnz    _my_irq_bitwise3_counter2_1_1,00114$
        cpl     _P1_2
        mov     _my_irq_bitwise3_counter2_1_1,#0x03
00114$:
        djnz    _my_irq_bitwise3_counter3_1_1,00121$
        cpl     _P1_3
        mov     _my_irq_bitwise3_counter3_1_1,#0x04
00121$:
        pop     acc
        reti


List of 8 messages in thread
TopicAuthorDate
timing sequence generation using AT89S52            01/01/70 00:00      
   Can you count?            01/01/70 00:00      
      I used 1 sec delay            01/01/70 00:00      
   This is a typical PCA job            01/01/70 00:00      
      PCA?            01/01/70 00:00      
   start with assembler code generated from C            01/01/70 00:00      
      or rather try this highly pathological C code :^)            01/01/70 00:00      
   Use the Timer            01/01/70 00:00      

Back to Subject List