Gast
#385613
Hallo Leute. Ich bräuchte eure hilfe. Wer könnte mir folgendes Programm umschreiben, damit es unter VB6 läuft?? Statt OUT und INP würde ich OUT32 und INP32 (Inpout.dll) verwenden. Das Modul dazu ist mir schon klar. Bitte Bitte helft mir. 5 REM Software Robomemm rev B 6 REM change 18 to rbit=abit for rev A 7 REM change 540 to abit for rev A 8 REM change 560 to <> for rev A 10 port = &H378 11 sport = &H379 12 cport = &H37A 13 ibit = &H4 14 sbit = &H1 15 bbit = &H80 16 abit = &H40 17 sbith = &HFE 18 rbit = bbit 19 DIM resp(64) 20 GOTO 2000 50 FOR k = 0 TO 63 100 a = INP(cport) 110 OUT cport, (a OR ibit) AND sbith 120 GOSUB 6000 130 FOR j = 1 TO 8 140 GOSUB 7000 160 NEXT 170 GOSUB 6000 180 GOSUB 8000 200 GOSUB 7000 300 index = &H20 310 IF (k AND index) = 0 THEN 400 320 GOSUB 8000 350 GOTO 420 400 GOSUB 7000 420 index = index \ 2 430 IF index <> 0 THEN 310 450 response = 0 500 FOR index = 0 TO 15 510 GOSUB 7000 530 response = response * 2 540 status = (INP(sport) AND rbit) 560 IF status = 0 THEN 600 570 response = response + 1 600 NEXT 604 resp(k) = response 610 NEXT 620 FOR k = 0 TO 63 625 PRINT CHR$(resp(k) - ((resp(k) \ 256) * 256)); 630 PRINT CHR$(resp(k) \ 256); 660 NEXT 670 PRINT 700 RETURN 1000 a = INP(cport) 1010 OUT cport, (a OR ibit) AND sbith 1020 GOSUB 6000 1030 GOSUB 7000 1050 GOSUB 7000 1070 GOSUB 8000 1090 GOSUB 8000 1110 FOR j = 1 TO 15 1120 GOSUB 7000 1140 NEXT 1200 FOR k = 0 TO 63 1210 GOSUB 6000 1220 GOSUB 7000 1240 GOSUB 8000 1260 index = &H20 1270 IF (k AND index) = 0 THEN 1310 1280 GOSUB 8000 1300 GOTO 1330 1310 GOSUB 7000 1330 index = index \ 2 1340 IF index <> 0 THEN 1270 1350 index = 32768 1360 IF (resp(k) AND index) = 0 THEN 1400 1370 GOSUB 8000 1390 GOTO 1430 1400 GOSUB 7000 1430 index = index \ 2 1440 IF index <> 0 THEN 1360 1450 OUT port, &HFF 1460 SLEEP 1 1470 NEXT 1500 RETURN 2000 PRINT "Bust a memmory options" 2010 PRINT "read = 0" 2020 PRINT "write = 1" 2025 PRINT "stop = 2" 2030 INPUT a 2040 IF a = 0 THEN 2100 2050 IF a = 1 THEN 2200 2060 IF a = 2 THEN 2300 2070 GOTO 2000 2100 GOSUB 50 2110 GOTO 2000 2200 GOSUB 1000 2210 GOTO 2000 2300 STOP 6000 OUT port, &HFF 'clock high data high select off 6010 OUT port, &HFC 'clock low data low select off 6020 OUT port, &H5C 'select on 6030 OUT port, &H5D 'clock high data low 6040 OUT port, &H5E 'clock low data high 6050 OUT port, &H5F 'clock high data high 6060 RETURN 7000 OUT port, &H5C 'clock low data low 7010 OUT port, &H5D 'clock high data low 7020 RETURN 8000 OUT port, &H5E 'clock low data high 8010 OUT port, &H5F 'clock high data high 8020 RETURN