DECLARE SUB Port888Status () DECLARE SUB Port890Status () DECLARE SUB Port889Status () DECLARE SUB InitScreen () DECLARE SUB DrawPort888 () DECLARE SUB DrawPort890 () DECLARE SUB DrawPort889 () DECLARE SUB OutPort888 (Port888Num) DECLARE SUB OutPort890 (Port890Num) DECLARE SUB KeyPressed (ActionKey$) DIM SHARED BinaryPort888(8) AS INTEGER DIM SHARED BinaryPort890(4) AS INTEGER DIM SHARED BinaryPort889(5) AS INTEGER DIM SHARED ActionKey AS STRING InitScreen Port888Status Port890Status Port889Status DrawPort888 DrawPort890 DrawPort889 DO ActionKey$ = INKEY$ IF ActionKey$ = "x" OR ActionKey$ = "X" THEN CLS : END ELSE IF ActionKey$ <> "" THEN KeyPressed (ActionKey$) Port889Status DrawPort889 LOOP SUB DrawPort888 FOR i = 1 TO 4 LOCATE (i + 5), 13 PRINT RIGHT$(STR$(BinaryPort888(i)), 1); NEXT i FOR i = 5 TO 8 LOCATE (i + 1), 34 PRINT RIGHT$(STR$(BinaryPort888(i)), 1); NEXT i END SUB SUB DrawPort889 FOR i = 1 TO 3 LOCATE (i + 18), 13 PRINT RIGHT$(STR$(BinaryPort889(i)), 1); NEXT i FOR i = 4 TO 5 LOCATE (i + 15), 34 PRINT RIGHT$(STR$(BinaryPort889(i)), 1); NEXT i END SUB SUB DrawPort890 FOR i = 1 TO 2 LOCATE (i + 12), 13 PRINT RIGHT$(STR$(BinaryPort890(i)), 1); NEXT i FOR i = 3 TO 4 LOCATE (i + 10), 34 PRINT RIGHT$(STR$(BinaryPort890(i)), 1); NEXT i END SUB SUB InitScreen CLS PRINT CHR$(201); FOR i = 1 TO 50 PRINT CHR$(205); NEXT i PRINT CHR$(187) FOR i = 1 TO 22 PRINT CHR$(186); TAB(52); CHR$(186) NEXT i PRINT CHR$(200); FOR i = 1 TO 50 PRINT CHR$(205); NEXT i PRINT CHR$(188); LOCATE 2, 14 PRINT "Interface Control Ver. 1.0"; LOCATE 3, 14 FOR i = 1 TO 26 PRINT CHR$(196); NEXT i LOCATE 4, 5 PRINT "Outputs:"; LOCATE 5, 11 PRINT CHR$(218); FOR i = 1 TO 30 PRINT CHR$(196); NEXT i PRINT CHR$(191) LOCATE 6, 11 PRINT CHR$(179); "[ ] Bit 1 [ ] Bit 5"; CHR$(179); LOCATE 7, 11 PRINT CHR$(179); "[ ] Bit 2 [ ] Bit 6"; CHR$(179); LOCATE 8, 11 PRINT CHR$(179); "[ ] Bit 3 [ ] Bit 7"; CHR$(179); LOCATE 9, 11 PRINT CHR$(179); "[ ] Bit 4 [ ] Bit 8"; CHR$(179) COLOR 4 FOR i = 1 TO 4 LOCATE (i + 5), 19 PRINT i; NEXT i FOR i = 5 TO 8 LOCATE (i + 1), 41 PRINT RIGHT$(STR$(i), 1); NEXT i COLOR 7 LOCATE 10, 11 PRINT CHR$(192); FOR i = 1 TO 30 PRINT CHR$(196); NEXT i PRINT CHR$(217) LOCATE 12, 11 PRINT CHR$(218); FOR i = 1 TO 38 PRINT CHR$(196); NEXT i PRINT CHR$(191) LOCATE 11, 5 PRINT "Control Lines:"; LOCATE 13, 11 PRINT CHR$(179); "[ ] Strobe [ ] Initialize "; CHR$(179); LOCATE 14, 11 PRINT CHR$(179); "[ ] LF/CR [ ] Sel/Desel "; CHR$(179); COLOR 4 LOCATE 13, 16 PRINT "S"; LOCATE 14, 16 PRINT "L"; LOCATE 13, 37 PRINT "I"; LOCATE 14, 38 PRINT "e"; COLOR 7 LOCATE 15, 11 PRINT CHR$(192); FOR i = 1 TO 38 PRINT CHR$(196); NEXT i PRINT CHR$(217) LOCATE 17, 5 PRINT "Inputs:"; LOCATE 18, 11 PRINT CHR$(218); FOR i = 1 TO 30 PRINT CHR$(196); NEXT i PRINT CHR$(191) LOCATE 19, 11 PRINT CHR$(179); "[ ] Bit 1 [ ] Bit 4"; CHR$(179); LOCATE 20, 11 PRINT CHR$(179); "[ ] Bit 2 [ ] Bit 5"; CHR$(179); LOCATE 21, 11 PRINT CHR$(179); "[ ] Bit 3 "; CHR$(179); LOCATE 22, 11 PRINT CHR$(192); FOR i = 1 TO 30 PRINT CHR$(196); NEXT i PRINT CHR$(217) LOCATE 23, 3: PRINT "Press X to Exit" END SUB SUB KeyPressed (ActionKey$) IF ActionKey$ = "1" AND BinaryPort888(1) = 1 THEN OutPort888 (-1): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "1" AND BinaryPort888(1) = 0 THEN OutPort888 (1): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "2" AND BinaryPort888(2) = 1 THEN OutPort888 (-2): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "2" AND BinaryPort888(2) = 0 THEN OutPort888 (2): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "3" AND BinaryPort888(3) = 1 THEN OutPort888 (-4): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "3" AND BinaryPort888(3) = 0 THEN OutPort888 (4): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "4" AND BinaryPort888(4) = 1 THEN OutPort888 (-8): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "4" AND BinaryPort888(4) = 0 THEN OutPort888 (8): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "5" AND BinaryPort888(5) = 1 THEN OutPort888 (-16): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "5" AND BinaryPort888(5) = 0 THEN OutPort888 (16): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "6" AND BinaryPort888(6) = 1 THEN OutPort888 (-32): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "6" AND BinaryPort888(6) = 0 THEN OutPort888 (32): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "7" AND BinaryPort888(7) = 1 THEN OutPort888 (-64): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "7" AND BinaryPort888(7) = 0 THEN OutPort888 (64): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "8" AND BinaryPort888(8) = 1 THEN OutPort888 (-128): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "8" AND BinaryPort888(8) = 0 THEN OutPort888 (128): Port888Status: DrawPort888: EXIT SUB IF ActionKey$ = "s" OR ActionKey$ = "S" AND BinaryPort890(1) = 1 THEN OutPort890 (-1): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "s" OR ActionKey$ = "S" AND BinaryPort890(1) = 0 THEN OutPort890 (1): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "l" OR ActionKey$ = "L" AND BinaryPort890(2) = 1 THEN OutPort890 (-2): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "l" OR ActionKey$ = "L" AND BinaryPort890(2) = 0 THEN OutPort890 (2): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "i" OR ActionKey$ = "I" AND BinaryPort890(3) = 1 THEN OutPort890 (-4): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "i" OR ActionKey$ = "I" AND BinaryPort890(3) = 0 THEN OutPort890 (4): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "e" OR ActionKey$ = "E" AND BinaryPort890(4) = 1 THEN OutPort890 (-8): Port890Status: DrawPort890: EXIT SUB IF ActionKey$ = "e" OR ActionKey$ = "E" AND BinaryPort890(4) = 0 THEN OutPort890 (8): Port890Status: DrawPort890: EXIT SUB END SUB SUB OutPort888 (Port888Num) tempport = INP(888) Port888Num = Port888Num + tempport OUT 888, Port888Num END SUB SUB OutPort890 (Port890Num) tempport = INP(890) Port890Num = Port890Num + tempport OUT 890, Port890Num END SUB SUB Port888Status InPort = INP(888) FOR i = 1 TO 8 BinaryPort888(i) = 0 NEXT i FOR i = 1 TO 8 BinaryPort888(i) = InPort MOD 2 InPort = FIX(InPort / 2) NEXT i END SUB SUB Port889Status InPort = INP(889) FOR i = 1 TO 5 BinaryPort889(i) = 0 NEXT i FOR i = 1 TO 5 BinaryPort889(i) = InPort MOD 2 InPort = FIX(InPort / 2) NEXT i END SUB SUB Port890Status InPort = INP(890) FOR i = 1 TO 4 BinaryPort890(i) = 0 NEXT i FOR i = 1 TO 4 BinaryPort890(i) = InPort MOD 2 InPort = FIX(InPort / 2) NEXT i END SUB