October 04, 2001 32-bit emmulation bug | ||||
---|---|---|---|---|
| ||||
Attachments:
| 'unsigned long' variables don't work in 16-bit mode. They only work with 32-bit mode. In 16-bit mode, I think assigning a long variable more than 16-bits (64k) is broken into high-word and low-word. The low-word is used in the variable and the high-word is deleted. unsigned long in 16-bit mode takes 2 bytes of RAM when it should be taking 4 bytes. So in another words: sizeof(unsigned long) == sizeof(unsigned short) |
October 05, 2001 Re: 32-bit emmulation bug | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imran Haider Attachments:
| The following program prints "4" as expected when compiled with -ms or -ml: -------------------------------------------------------------------- #include <stdio.h> void main() { printf("%d\n", sizeof(unsigned long)); } ------------------------------------------------------- Imran Haider wrote in message <9piqdp$247e$1@digitaldaemon.com>... 'unsigned long' variables don't work in 16-bit mode. They only work with 32-bit mode. In 16-bit mode, I think assigning a long variable more than 16-bits (64k) is broken into high-word and low-word. The low-word is used in the variable and the high-word is deleted. unsigned long in 16-bit mode takes 2 bytes of RAM when it should be taking 4 bytes. So in another words: sizeof(unsigned long) == sizeof(unsigned short) |
Copyright © 1999-2021 by the D Language Foundation