Guest User

Untitled

a guest
May 26th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. using System;
  2. using System.Runtime.InteropServices;
  3.  
  4. namespace ConsoleApplication
  5. {
  6. class Program
  7. {
  8. [DllImport("inpout32", EntryPoint = "Out32")]
  9. private static extern void Output(ushort port, short data);
  10.  
  11. private static ushort data = 888;
  12. private static ushort control = 890;
  13.  
  14. private static short clockhi = 1;
  15. private static short clocklo = 3;
  16. private static short latchhi = 2;
  17. private static short latchlo = 3;
  18.  
  19. static void Main(string[] args)
  20. {
  21. if (args.Length != 1)
  22. {
  23. System.Console.WriteLine("Takes one argument fucktard.");
  24. System.Environment.Exit(1);
  25. }
  26.  
  27. string channels = args[0];
  28.  
  29. if (channels.Length != 32)
  30. {
  31. System.Console.WriteLine("32 channels dipshit.");
  32. System.Environment.Exit(1);
  33. }
  34.  
  35. for (int x = 31; x >= 0; x--)
  36. {
  37. if (channels[x].Equals('1'))
  38. {
  39. Output(data, 1);
  40. }
  41. else
  42. {
  43. Output(data, 0);
  44. }
  45.  
  46. Output(control, latchhi);
  47. Output(control, latchlo);
  48. }
  49.  
  50. Output(control, clockhi);
  51. Output(control, clocklo);
  52.  
  53. System.Environment.Exit(0);
  54. }
  55. }
  56. }
Add Comment
Please, Sign In to add comment