> I use Open Watcom to play with 13h mode. It's just for fun :)
> To init 13h mode, here is my code :
<snip>
> mov ax,13h
> int 10h
<snip>
> char far *screen = (char far*)0x0A0000000;
> *screen = (char) 1;
<snip>
> I use this command line to compile :
> wcl386 /l=dos4g test.c
I don't know too much about Open Watcom, but I do know
about the PC's hardware.
For compatibility reasons, the CPU of a PC has several
operating modes. DOS only knows about 16-bit, but DOS extenders
and newer operating systems know 32-bit (or 64-bit :-)
On the lowest software level, 16-bit and 32-bit aren't 100% compatible,
and that's probably what goes wrong here. The code uses 16-bit
DOS programming stuff, while being compiled for 32-bit (looking at the
command line).
I suggest you look into the manual how to target 16-bit DOS, _or_
look for their 32-bit equivalents.
Herman

0

Herman

9/22/2003 9:02:54 PM

"Laura Martignas" <lauramarty@libertysurf.fr> wrote in message
news:Xns93FDEBFBDB7B6lauraliberty@213.228.0.196...
> Hi
>
> I use Open Watcom to play with 13h mode. It's just for fun :)
>
> void main(void)
> {
> initMode13();
> char far *screen = (char far*)0x0A0000000;
> *screen = (char) 1;
> }
>
> colour 1 is supposed to be red (0xff0000, initialized before 13h mode).
But
> when I run, my program hangs. Why ?
I see you're linking into dos4gw.
Welcome to protected mode. You now address memory in a linear fashion.
to convert a seg:off pair to a linear address u do the following:
linear=(segment shl 4)+offset
so quite simply B800:0000 becomes 0xb8000
Segment registers under protected mode arnt used in the say way as they are
under realmode.
They are used in the form of sel:offset
you can use a DPMI call to allocate a selector and set its base address as
0xa0000
all u do is load ES with the selector, and your reference memory location
(pixel) in EDI
thats one approach (not necessarily the best)
if your DS and ES already have a base of 0, they're likely to have a limit
of 4gig, so
you can just address anything inside that space with your ESI/EDI registers
your program is hanging because of an incompatible memory pointer.
cheers
alex

In comp.lang.asm.x86, Msg ID: <bl0rji$l4m$1@lust.ihug.co.nz>
"alex" <no@spam.pls.kthx.com>, wrote:
>"Laura Martignas" <lauramarty@libertysurf.fr> wrote in message
>news:Xns93FDEBFBDB7B6lauraliberty@213.228.0.196...
>> I use Open Watcom to play with 13h mode. It's just for fun :)
I'm new to HLLs,
I've been resisting it for years.
Now I'm trying to decide which one to learn..
After getting Open Watcom, and cuz it looks like
the basics are there,
I decided on "just enough" of C/C++ and Fortran to get a clue.
And the same for win, NT and O/S2.
- Hey .. It rhymes !!!
A few questions for all..
Re: "It's just for fun".
Sounds like an apology - If so for what?
>I see you're linking into dos4gw.
That is what got me to Watcom.
>Welcome to protected mode. You now address memory in a linear fashion.
>to convert a seg:off pair to a linear address u do the following:
Now that I'm there, Have I arrived at a good place to start?
Cuz I think I've also come to the place I want to end too..
What else is there?
OBTW - If it isn't for fun, what's it for? Money? << sucker !!
--
Ray