Mail Archives: djgpp/1997/01/06/23:10:34
On Tue, 07 Jan 1997 01:06:21 GMT brin AT star DOT net (Brin) writes:
>Hello everyone,
>I realize this is a very stupid question and that it should be
>painfully obvious, but I cannot seem to find the answer. Basically, I
>recently started programming in the DJGPP-GPC enviornment and have
>been able to do alot the of the basic stuff, I am very familiar with
>Turbo Pascal. Unfortunentally, I am not familiar with the other
>languages that the compiler is based on (ansi, extended etc.) and an
>not familiar with protected mode. I was wondering if there are any
>good books/docs etc on the subject.
>
>Also, I have been trying to find out about how to write, say a byte,
>directly to memory or to read a byte directly from memory.
>
>ie
>
>var
> P : ^void;
>
>begin
> .
> .
> .
> GetMem(P, The_Space_I_Need);
> P := $A0000; {Video Memory}
This is the problem. P, a pointer to nothing (I usually used ^byte), is
pointing at the address $a0000. In real mode, this is $a0000. In
protected mode, this could be anywhere. I know how to work around this
in C, but I haven't used GNU Pascal (only Borland), so I don't know the
work-around... sorry. :(
> .
> .
> .
>end.
>
>
> Now how do I read the and write to the memory I have allocated. In
>Turbo Pascal, i could use the mem[segment:offset] array, but that is
>not available in GNU Pascal...
>
> I also wish to be able to read and write to ports, of the material I
>have found, I know that the port[] array that was in Turbo Pascal is
>also no longer available. What can I do in its place (ie writing to
>SB registers and to the Palette registers)
>
>Any help on any of the above problems would be of a huge help!
>
>Thanks in advance
>-Brin
>
> "I am therefore I think"
>*******************************************************************************
>*SUBSCRIBE!: If you're not on then get signed up! *
>* >>>>>Send an EMail to: brin AT star DOT net<<<<< *
>* leaving the body blank and Subscribe in the Subject. *
>* DISTRIBUTE!: Send this to all your friends, enemies, and *
>* to Samantha (I wonder if she reads this)... I know a girl
named Samantha - a cute one, too :)
> *
>*COME AND SEE:The archives
> *
>* http://www.star.net/people/~brin
> *
>* CONTRIBUTE!: Send me funny stuff.
> *
>***************************************************************************
>
>
- Raw text -