News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Creating new data segment

Started by g0nzo, June 06, 2005, 07:24:21 AM

Previous topic - Next topic

MichaelW

CodeView should have a 386 selection on the Options menu that will allow you to view all of the registers. I think you need to start CodeView with the /S option for debugging a program that uses graphics (e.g. codeview /S exename). CodeView uses text mode for its output, so it should not disturb whatever is in the graphics buffer. You should be able to examine the contents of the graphics buffer at any time with a dump command, and I think also with the F4 key. This does not work on my system, but I strongly suspect that running under Windows, where AFAIK the graphics buffer must be emulated or virtualized, is the problem.

As an alternative to using a debugger, you could add a procedure that displays hex values using the BIOS display functions (which will work in the standard graphics modes), and use it to display the values of registers, variables, memory etc at runtime.

Some other comments on your code:

MASM assumes from the memory model that the procedures are far, so there is no need to specify this.

For all but the Quit procedure the parameters are words. The "near ptr" serves no purpose that I can see, and in the case of OpenFile, for example, it is misleading because the parameter is actually a near pointer to a byte.
eschew obfuscation