Path: utzoo!attcan!uunet!snorkelwacker!apple!fox!portal!cup.portal.com!cliffhanger From: cliffhanger@cup.portal.com (Cliff C Heyer) Newsgroups: comp.sys.ibm.pc Subject: SEGMENT:OFFSET Madness Message-ID: <25821@cup.portal.com> Date: 11 Jan 90 16:05:58 GMT Organization: The Portal System (TM) Lines: 47 I wish Microsoft and MSDOS book writers would get their terms straight. For example, lets take "segment:offset". The sensible thing to do would be to use these words they way they are usually used in the english language, rather than invent "new" meanings. Specifically, segment means a 64K "segment" and offset means "offset within a 64K segment." But I guess this was "too easy" for whoever made the word decision. So I'll take this opportunity now to set the matter straight. First of all, "segment" in segment:offset is NOT a segment. In fact, the number is meaningless in itself. The same goes for "offset". Let me explain. To get the "real" segment, you must multiply (base 10 this example) the so-called segment by 16 and add the offset. Then you must subtract 65,536 from this total repeatedly and stop just before you get a negative number. Then number of times you subtract is the "real" segment number, and your remainder is the "real" offset address. In Hex, you multiply the so-called segment by 10h and add the offset. The first hex number of your result is the "real" segment, and the "real" offset is the remaining four hex numbers. To be true to standard "segment:offset" word use, 39D3:0ECE should be written 3:ABFE or 3:44030 base 10. If people are smart enough to invent computers, they ought to be smart enough to get word use straight. I don't know what to call segment:offset, but certainly NOT segment:offset. I realize that it is more efficient to convert "segment:offset" in it's present form to a 20-bit real address than to store the "real" segment number 1-16 in the segment register. This is because currently only a bit-shift need be done to multiply the segment by 10h. With the real segment number in there, you'd have to multiply it by 65536 each time to get the segment address and consume more CPU cycles. However, this does not justify continued use of the same words. Perhaps an astute observer could offer and explanation that would more easily allow conceptualization of what the current "segment:offset" really represent.