Page 1 of 1

memory size

Posted: Wed Jan 01, 2003 1:35 pm
by pini
I traced the function 0xE801 from int 0x15, which should give the memory size by groups :
CX gives the number of Kb between 1 and 16 Mb (15 Mb is the max <=> range [1 Mb;16 Mb[)
DX gives the number of 64 Kb blocks between 16 Mb and 4 Gb ( range [16 Mb;4 Gb])

it gives these results on my test machine : CX=0x3C00 & DX=0x100 which gives a total of 32768 Ko (+1 because of the first Meg) which is the correct amount of memory.

This functions is composed of a sequence of
[pre]DB 66h

and

CS:
DB 66h
[/pre]

Can anyone explain me what are these opcodes ? and how to use them ?

Re:memory size

Posted: Thu Jan 02, 2003 1:11 am
by K.J.
I'm not quite sure what you are asking, but if it's how the BIOS function works, look at the Bochs BIOS sourcecode.

K.J.

Re:memory size

Posted: Thu Jan 02, 2003 1:51 pm
by Slasher
hi,
thats is needed cause the bios is using 32bit registers/data in a 16bit code segment! (correct me if I'm wrong anyone)

Re:memory size

Posted: Thu Jan 02, 2003 2:01 pm
by DarylD
Your right.

66 is the modifier for 32bit registers in a 16 bit segment and vice versa (I believe).

Would be suprised if this function works in protected mode though.