ganapathy murali krishnan wrote:> I am new to 32-bit programming in DOS. So this might be a stupid question.
>
> How do I access an absolute memory location in my COM32 code. If I
> understand it correctly, all the memory addresses use virtual addresses.
> I need to write code to read an absolute location in memory
>
> Is it as simple as
>
> answer = *(unsigned char *)MK_PTR(seg,ofs)
>
> or does the fact that the COM32 code is runing using virtual addresses
> complicate matters.
>
COM32 actually doesn't use virtual addresses at all, it uses 32-bit flat
addresses. MK_PTR() and SEG()/OFFS() can be used to convert 32-bit flat
addresses from/to 16-bit real-mode segment:offset type pointers, as long
as the address falls in the first megabyte of memory.
The first megabyte restriction is important, that's why you need the low
memory bounce buffer.
-hpa