Advertisement
MadCortez

Untitled

Dec 15th, 2021
860
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.37 KB | None | 0 0
  1. void outputClassCode(long regData) {
  2.     fputs(" TASK 1\n", file);
  3.     puts(" TASK 1");
  4.  
  5.  
  6.     int classCode = (regData » 24) & 0xFF;
  7.     char *classData;
  8.     switch (classCode) {
  9.     case 0:
  10.         classData = "devices before classification";
  11.         break;
  12.     case 1:
  13.         classData = "storage controllers";
  14.         break;
  15.     case 2:
  16.         classData = "network controllers";
  17.         break;
  18.     case 3:
  19.         classData = "display controllers";
  20.         break;
  21.     case 4:
  22.         classData = "multimedia devices";
  23.         break;
  24.     case 5:
  25.         classData = "memory controllers";
  26.         break;
  27.     case 6:
  28.         classData = "bridges";
  29.         break;
  30.     case 7:
  31.         classData = "communication controllers";
  32.         break;
  33.     case 8:
  34.         classData = "system peripherals";
  35.         break;
  36.     case 9:
  37.         classData = "input device controllers";
  38.         break;
  39.     case 10:
  40.         classData = "docking stations";
  41.         break;
  42.     case 11:
  43.         classData = "processors";
  44.         break;
  45.     case 12:
  46.         classData = "serial bus controllers";
  47.         break;
  48.     case 13:
  49.         classData = "wireless interface controllers";
  50.         break;
  51.     default:
  52.         classData = "invalid class number";
  53.         break;
  54.     }
  55.     fprintf(file, "Class name: %s\n", classData);
  56.     printf( "Class name: %s\n", classData);
  57. }
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement