On Wed, 19 Sep 2018 10:44:14 +0200, stecdose wrote:
> HOW does a 16bit truncate limit to 16384bytes?
> 
>                       b1 b0  (byte 1, byte 0)
>                     b2 | |   (byte 2)
>                      | | |
> decimal 81920 = hex 014000 decimal 65536 = hex   FFFF size of size_t = 2
> bytes
> 
> 16k is far less than 64k, why does it truncate to 16k? why not 64k if
> greater than 64k?

TK Chia tried to allocate 81920 bytes (0x14000), while malloc accepts an 
unsigned short (16-bits) only. Hence only the lowest 16 bits of 0x14000 
were actually fed to malloc(), ie. 0x4000, that is 16K.

Mateusz
-- 
FreeDOS is present on the USENET, too! alt.os.free-dos



_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to