Hi,
I have a code I've been trying to dechipher and I got stuck with one command... It's simple.
WHILE (INP(&H3BD) AND 8) = UPVAL
So I know WHILE, I also know INP for input and then &H3BD would be the parallel port, but is this also the pin? Is it in hexadecimal? It receives the input from pin 15... Not sure what AND does exactly, is it a logical and? Or adding the numbers? And UPVAL would be a variable which the code gives it a number. So I guess they are basically comparing (INP(&H3BD) AND 8) to UPVAL for true/false to continue the WHILE loop... But I don't see the result for AND.
I think the input recieves two (2) numbers: 159 for lever up and 151 for lever down. I guess these come in in binary and get compared with 8?
When I create a new program, to see how it works, and write WHILE (10 AND 8) = 12 I get an error in syntax... Help would be appreciated.
A bit of background...
I'm not a programmer but I do remember a bit from back in college (c++ and assembly). I got involved in this when my wife asked for my help on a project she's working on. She works for a children's research department and they are implementing this new test that involves an old ibm thinkpad laptop connected to an interface box through the parallel port and then the interface box connects to a train that has a lever.
So toddlers push the lever and the train moves, this in turn sends signals to the computer to recollect the data.
So basically, I volunteered in helping them and I'm reparing the three (3) sets of trains that they have and later on I'll recreate some newer ones. I can do well with electronics but I didn't think I had to mess with the program until I found out that the three (3) sets of trains had differences in their programs which they should all be the same.
Each computer has three files: .exe, .bas and .obj. (not sure what type of basic, maybe quick basic)
From one computer, I compile the .bas file and see a difference from the original .exe program. Also the name of the .exe file and the .bas file are different which leds me to believe that the codes my be different. Isn't it common practice to have your .exe file and .bas file under the same name?
Where I'm also trying to get with this is for them to use newer computers, ones that can work on battery and not be plugged all the time (since they perform this research at houses). So for that I guess I need to tell the code to send the signals through USB and not parallel port. I bought and adaptor but it didn't work cause the program is still looking for the parallel port on a new computer.
Thanks,
Fernando
I have a code I've been trying to dechipher and I got stuck with one command... It's simple.
WHILE (INP(&H3BD) AND 8) = UPVAL
So I know WHILE, I also know INP for input and then &H3BD would be the parallel port, but is this also the pin? Is it in hexadecimal? It receives the input from pin 15... Not sure what AND does exactly, is it a logical and? Or adding the numbers? And UPVAL would be a variable which the code gives it a number. So I guess they are basically comparing (INP(&H3BD) AND 8) to UPVAL for true/false to continue the WHILE loop... But I don't see the result for AND.
I think the input recieves two (2) numbers: 159 for lever up and 151 for lever down. I guess these come in in binary and get compared with 8?
When I create a new program, to see how it works, and write WHILE (10 AND 8) = 12 I get an error in syntax... Help would be appreciated.
A bit of background...
I'm not a programmer but I do remember a bit from back in college (c++ and assembly). I got involved in this when my wife asked for my help on a project she's working on. She works for a children's research department and they are implementing this new test that involves an old ibm thinkpad laptop connected to an interface box through the parallel port and then the interface box connects to a train that has a lever.
So toddlers push the lever and the train moves, this in turn sends signals to the computer to recollect the data.
So basically, I volunteered in helping them and I'm reparing the three (3) sets of trains that they have and later on I'll recreate some newer ones. I can do well with electronics but I didn't think I had to mess with the program until I found out that the three (3) sets of trains had differences in their programs which they should all be the same.
Each computer has three files: .exe, .bas and .obj. (not sure what type of basic, maybe quick basic)
From one computer, I compile the .bas file and see a difference from the original .exe program. Also the name of the .exe file and the .bas file are different which leds me to believe that the codes my be different. Isn't it common practice to have your .exe file and .bas file under the same name?
Where I'm also trying to get with this is for them to use newer computers, ones that can work on battery and not be plugged all the time (since they perform this research at houses). So for that I guess I need to tell the code to send the signals through USB and not parallel port. I bought and adaptor but it didn't work cause the program is still looking for the parallel port on a new computer.
Thanks,
Fernando