Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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:

  1. Go into dos mode
  2. Type Debug
  3. Type i 378
then it will display the content of the adress #378, that is the parallel port.

To write to the parallel port (be sure that nothing is connected to it!!!!)

  1. o 378 11
This will write 11(HEX) to the paralell port.
  1. 1 378
11 ;will be displayed and available on the paralel port.

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:   W12882
Filename:   DOS Debug and Memory Read and Write.txt