Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1. //----------------------------------------------------------------------------
  2. // C main line
  3. //----------------------------------------------------------------------------
  4.  
  5. #include <m8c.h>
  6. #include "PSoCAPI.h"
  7.  
  8. void main(void)
  9. {
  10.         debut:  if((PRT0DR & 0x10) == 0x10)
  11.                     PRT1DR = PRT1DR | 0x02;
  12.                     else
  13.                         PRT1DR = PRT1DR & 0xFD;
  14.                     if((PRT0DR & 0x20) == 0x20)
  15.                         PRT1DR = PRT1DR | 0x04;
  16.                     else
  17.                         PRT1DR = PRT1DR & 0xFB;
  18.                     if((PRT0DR & 0x01) == 0x00)
  19.                         goto label1;
  20.                     if((PRT0DR & 0x02) == 0x02)
  21.                         goto label1;
  22.                     if((PRT0DR & 0x04) == 0x00)
  23.                         goto label2;
  24.                     if((PRT0DR & 0x08) == 0x08)
  25.                         goto label2;
  26.                    
  27.         label3: if((PRT0DR & 0x20) == 0x20)
  28.                 {
  29.                     PRT1DR = PRT1DR | 0x04;
  30.                     PRT1DR = PRT1DR & 0xFE;
  31.                 }
  32.                 goto debut;
  33.         label2: if((PRT0DR & 0x10) == 0x10)
  34.         label1: {PRT1DR = PRT1DR | 0x01;
  35.                 goto debut;
  36.                 }else{
  37.                     goto label3;
  38.                 }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement