Advertisement
Guest User

writeor

a guest
Jun 20th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.56 KB | None | 0 0
  1. #include "aduc812.h"
  2.  
  3.  
  4. #define MAXBASE 0x8
  5.  
  6. void write_max( unsigned char xdata *regnum, unsigned char val )
  7. {
  8. unsigned char oldDPP = DPP;
  9.  
  10.     DPP     = MAXBASE;
  11.     *regnum = val;
  12.     DPP     = oldDPP;
  13. }
  14. void writeor( unsigned char xdata *regnum, unsigned char val )
  15. {
  16. unsigned char oldDPP = DPP;
  17.  
  18.     DPP     = MAXBASE;
  19.     *regnum |= val;
  20.     DPP     = oldDPP;
  21. }
  22.  
  23. unsigned char read_max( unsigned char xdata *regnum )
  24. {
  25. unsigned char oldDPP=DPP;
  26. unsigned char val;
  27.  
  28.     DPP = MAXBASE;
  29.     val = *regnum;
  30.     DPP = oldDPP;
  31.  
  32.     return val;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement