Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. #include <REG52.H>
  2. #include <stdio.h>
  3. void init_RS(void);
  4. int a = -30;
  5. int b = -12345;
  6. long int c = 0x4A6F6E00;
  7. char d = 'A';
  8. long int e = 54321;
  9. long int f = 0xAFFFFFFF;
  10.  
  11. void main(void) {
  12.     init_RS();
  13.     printf("a = %d;\nb = %d;\nc = %lx;\nd = %c;\ne = %ld;\nf = %lx;", a, b, c, d, e, f);
  14.     while(1);
  15. }
  16.  
  17. void init_RS(void) {
  18.     SCON = 0x52;
  19.     TMOD |= 0x20;
  20.     TH1 = 0xFD;
  21.     TR1 = 1;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement