DOS Debug and Memory Read and Write
Keywords: DOS Debug
Question:
How can I execute the DOS's Debug function and then read and put the return value in a variable within a Winbatch programm?The DOS Debug fonction gives me the opportunity, with a simple command put a word in a memory address or read the content of this location.
Try this:
then it will display the content of the adress #378, that is the parallel port.
- Go into dos mode
- Type Debug
- Type i 378
To write to the parallel port (be sure that nothing is connected to it!!!!)
This will write 11(HEX) to the paralell port.
- o 378 11
11 ;will be displayed and available on the paralel port.
- 1 378
Now, this is a wonderful and an unexpensive way to have programmable i/o with the computer.
Answer:
Since you know how to do what you want with Debug, an alternative might be to use debug scripts, especially if you have to create them on the fly or alter them.eg:
fHnd = FileOpen ("debug.txt", "Write") FileWrite (fHnd, "i 378") FileWrite (fHnd, "o 378 11") ... FileWrite (fHnd, "q") ; very important! FileClose (fHnd) RunShell ("command.com","/c debug.com output.txt", "",@HIDDEN, @WAIT)This works for me.As far as getting value back to Winbatch, not sure.
Article ID: W12882Filename: DOS Debug and Memory Read and Write.txt