Article View: comp.sys.intel
Article #1656Re: pointer alignment when int != char *
From: gnu
Date: Mon, 07 Sep 1987 01:42
Date: Mon, 07 Sep 1987 01:42
17 lines
1421 bytes
1421 bytes
root@hobbes.UUCP (John Plocher) wrote:
> -- New Subject: pointer manipulation on intel chips --
> A pointer has 2 parts, a SEGMENT and an OFFSET, each 16 bits in length.
> e.g.: 1040:3333
> SEGMENT:OFFSET
> An address may be converted into a normalized pointer by constructing a
> SEGMENT:OFFSET pair where the lower 12 bits of the SEGMENT are ZERO.
> segment = (unsigned short)(address & 0x000F0000) / 16;
> offset = (unsigned short)(address & 0x0000FFFF);
I think it's great :-) that people are teaching folks how to write programs
for the 8086 that will break when recompiled for the 80386. There's nothing
like software foolishness to break even the best-implemented hardware
compatability...
--
{dasys1,ncoast,well,sun,ihnp4}!hoptoad!gnu gnu@postgres.berkeley.edu
My name's in the header where it belongs.
Technical Details
Message-ID:
<2894@hoptoad.uucp>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!unisoft!hoptoad!gnuReferences:
<493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <201@hobbes.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!rutgers!lll-lcc!unisoft!hoptoad!gnu From: gnu@hoptoad.UUCP Newsgroups: comp.sys.intel Subject: Re: pointer alignment when int != char * Message-ID: <2894@hoptoad.uucp> Date: Sun, 6-Sep-87 21:42:11 EDT Article-I.D.: hoptoad.2894 Posted: Sun Sep 6 21:42:11 1987 Date-Received: Tue, 8-Sep-87 00:43:08 EDT References: <493@its63b.ed.ac.uk> <6061@brl-smoke.ARPA> <3812@spool.WISC.EDU> <201@hobbes.UUCP> Organization: Nebula Consultants in San Francisco Lines: 17