fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned short set_value, dev=3, page=0, reg=2;
  5. set_value = 0x1000 | 0x0400 | dev << 5 | 0x16 ;
  6. printf("0x%04x\n", set_value);
  7. set_value |= 0x8000;
  8. printf("0x%04x\n", set_value);
  9.  
  10. set_value = 0x1000 | 0x0400 | dev << 5 | reg ;
  11. printf("0x%04x\n", set_value);
  12. set_value |= 0x8000;
  13. printf("0x%04x\n", set_value);
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5276KB
stdin
Standard input is empty
stdout
0x1476
0x9476
0x1462
0x9462