|
Post by Thrashbarg on Aug 30, 2004 2:32:46 GMT 10
SUB bin (b, n)
b = 2 ^ b
FOR x = 7 TO 0 STEP -1 y = 2 ^ x z = n AND y z = z / z OUT pbase, INP(pbase) AND &HF0 OUT pbase, INP(pbase) OR z OUT pbase, INP(pbase) OR b OUT pbase, INP(pbase) AND &HF0 FOR d = 0 TO 1: NEXT NEXT END SUB
the thing i'm asking is why does the damn thing overflow on y = 2 ^ x if I don't have the FOR d = 0 to 1: NEXT statement??? I'm using QB 4.5 On the shift registers, tie the data inputs together and attach them to D0 (pin 2) on the parallel port. Attach the clock of the first register to D1 (pin 3), the clock of the second register to D2 (pin 4) and so on. Tie clear high, or to a pin on the parallel port if you want to be able to reset the registers. I'm using the 74LS164. B = the register number N = the data to write.
|
|