HI ALL:

I have been trying to convert some 16 bit code
to 32 bit code but I am missing something or
getting the addressing wrong.
It does not me using Video Memory at ) 0B800h.

buffer db 2050 dup (?)
filename db 'SCREEN.ASC',0
end_of_buffer dw 0
handle          dw      0
program_start:
; ES > Video Memory
push cs
pop ds
mov ax,0B800h
mov es,ax
lea si,filename
mov ,si
lea    dx,filename
call    create_file

This program can not be run in dos mode.
It sometime sends dos windows to the
  printer have DOSPrint. Or sends cursors
around Dos Box before crashing.
It sometimes work if I run Debug.EXE
first but not always. It captures Video
Memory and creates an Ascii Text file
called SCREEN.ASC.
It works with 16 bit linker.


I am not not sure whats wrong?




Attachments:
Posted on 2006-05-25 12:29:22 by herge
Your snippet is very incomplete...

Anyway, dumping the text mode screen from B800:0000 to a file should be easy enough from a 16bit program, and should also work under windows quite fine. You won't be able to do that from a 32bit windows program. though.

So, what is it you want to do?
Posted on 2006-05-25 12:57:36 by f0dder
Hi f0dder:

I forgot to attach the souce code sorry.

Attachments:
Posted on 2006-05-25 14:46:59 by herge
So, do you want to simply "make the code work" (16bit), or do you want to convert it to 32bit/windows? If you want a windows 32bit program to snap the text buffer, that will require a completely different approach.
Posted on 2006-05-25 14:49:48 by f0dder
Hi f0dder:

I want to convert to 32 bit code and
get rid of those memory access
problems and other wise be more
stable in a 32 bit environment.
It's often creating a zero length
file called SCREEN.ASC.

I know the logic works but I seem
to be having addressing data
problems.
 
Posted on 2006-05-25 15:03:29 by herge
Converting to 32bit windows code would require you to drop all the "0B800h logic", and use APIs like the ReadConsoleOutput* family.

Getting the 16bit code working under windows requires debugging your code :P
Posted on 2006-05-25 15:20:15 by f0dder

Converting to 32bit windows code would require you to drop all the "0B800h logic", and use APIs like the ReadConsoleOutput* family.

Getting the 16bit code working under windows requires debugging your code :P


This applies to using a current Operating System (Windows/*nix/etc...), as such addresses (i.e. video memory @ 0000:B800), are protected and managed by higher-level APIs.

Converting your code to 32-bit runs along the lines of programming at the lowest hardware level, which is the basis of Operating System Development, and if that topic doesn't interest you, you just have to conform to something like f0dder suggested. If it does interest you, pick up a copy of Bochs and start reading up on OS Dev/32-bit Protected Mode :)
Posted on 2006-05-25 16:22:10 by SpooK