hi to everyone,

sorry for the obsolete argument not really asm32 related,
i need a little help to read a conventional memory address from a win16bit
dll procedure:

1. i do call GlobalDosAlloc,TheSize

2. in eax i get 00002ECF

The high word is the selector to the block,
and the low word the DOS real mode segment.
The offset of this block is always zero.

In this 16bit protected mode envoroment,
how can now read from this conventional memory address ?

I've already try:
fs=0000, esi=00002ECF mov al, byte ptr fs:[esi] protection fault
fs=0000, esi=2ECF0000 mov al, byte ptr fs:[esi] protection fault
fs=0000, esi=00000000 mov al, byte ptr fs:[esi] protection fault

fs=2ECF, esi=00000000 mov al, byte ptr fs:[esi]
works but i think i'm reading a wromg adress.

If some help .... THANKS :)
Posted on 2001-12-08 11:32:02 by Bit7
I haven't really done win16 programming, so this is just a bunch of
guesses :). Are you sure EAX is used for returning values, and not DX:AX?
0000 is definitely not a valid selector, and 2ECF sounds pretty high... not an impossible value I think, but it doesn't sound *right*.
Posted on 2001-12-08 17:32:21 by f0dder

you're magic !

After many days of trying, i see that the RESULT that all C source exaple indicates is NOT in eax !
I've found an asm example using GlobalDosAlloc: it shows

CALL GlobalDosAlloc
MOV Segment,DX
MOV Selector,AX

Whit your help i will probably finish my project:
Reading MBR from w95 in a quite easy way.
This has obviously already be done but i want do it in asm. After finished i will publish the code.

Thanks again.
Posted on 2001-12-09 04:32:45 by Bit7