Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Runtime.InteropServices;
- namespace ConsoleApplication
- {
- class Program
- {
- [DllImport("inpout32", EntryPoint = "Out32")]
- private static extern void Output(ushort port, short data);
- private static ushort data = 888;
- private static ushort control = 890;
- private static short clockhi = 1;
- private static short clocklo = 3;
- private static short latchhi = 2;
- private static short latchlo = 3;
- static void Main(string[] args)
- {
- if (args.Length != 1)
- {
- System.Console.WriteLine("Takes one argument fucktard.");
- System.Environment.Exit(1);
- }
- string channels = args[0];
- if (channels.Length != 32)
- {
- System.Console.WriteLine("32 channels dipshit.");
- System.Environment.Exit(1);
- }
- for (int x = 31; x >= 0; x--)
- {
- if (channels[x].Equals('1'))
- {
- Output(data, 1);
- }
- else
- {
- Output(data, 0);
- }
- Output(control, latchhi);
- Output(control, latchlo);
- }
- Output(control, clockhi);
- Output(control, clocklo);
- System.Environment.Exit(0);
- }
- }
- }
Add Comment
Please, Sign In to add comment