fork(2) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. unsigned short set_value, dev=4, 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 0s 5296KB
stdin
Standard input is empty
stdout
0x1496
0x9496
0x1482
0x9482