Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!mcgill-vision!snorkelwacker!tut.cis.ohio-state.edu!purdue!haven!mimsy!jds From: jds@mimsy.umd.edu (James da Silva) Newsgroups: comp.lang.scheme Subject: Re: (none) Message-ID: <26034@mimsy.umd.edu> Date: 16 Aug 90 05:47:17 GMT References: <9008151749.AA23832@mailhost.samsung.com> Reply-To: jds@cs.umd.edu (James da Silva) Organization: University of Maryland, Department of Computer Science Lines: 33 In article <9008151749.AA23832@mailhost.samsung.com> gjc@mitech.com writes: >>From: Alfred Kayser >>I've once tryed to port it to MSDOS or OS2 (compiler and cpu are the same) >>but it crashed enormously. The code was too unreadable to be debugged. > >Under the microsoft C compiler, small code and data model at least the 1.3 >version of SIOD compiled and ran the first time I tried it. I would guess that SIOD wants sizeof(pointer) == sizeof(int). This holds for 8086 small model but not for large model, where sizeof(pointer) == 4. >Anybody who would want to utilize the large data model 80286 mode would >have to be an expert MSDOS/C programmer, I am told by someone who did >a port. The details were something I had a hard time grasping. Very strange >stuff along the lines of PADDING the "struct obj" structure so it would >be 16 bytes long instead of 10 bytes long. This is an old 8086 programmer's trick. On the 86 addresses are divided into two 16-bit parts; the segment, and the offset. To get the physical address, the hardware calculates `segment << 4 + offset'. Thus segment numbers have 16 byte granularity. If all your objects are 16-byte aligned, you can use just the segment number as the address (the offset is always 0), thus you are back to sizeof(address) == sizeof(int). Rather than using this 86-specific hack, it would be better to just make the SIOD code portable to architectures where ints, pointers, and longs are not interchangeable. I think making SIOD pass lint would be enough. Any volunteers? Jaime ........................................................................... : domain: jds@cs.umd.edu James da Silva : path: uunet!mimsy!jds Systems Design & Analysis Group