home *** CD-ROM | disk | FTP | other *** search
- ABSADR v1.0 Absolute address calcluations.
- Copyright (c) 1991 Thomas M. Peters
-
- Purpose: Given any two of segment, offset, or absolute addresses,
- calculate the third value.
-
- Usage:
-
- Enter ABSADR at the command line. The program will prompt you for
- three values. You must enter TWO of them. Press ENTER only, not a
- zero, for the unknown parameter. ABSADR then calculates the third
- value and displays the entire address in the form:
-
- ssss:oooo = aaaaaaa
-
- ssss = segment
- oooo = offset
- aaaaaa = absolute
-
- Limitations:
-
- ABSADR is written in Microsoft C, a language I rarely use, and
- therefore has no elaborate error checking. It is meant to be a simple
- programming aid and as such, has certain limitations.
-
- 1. It is easy to specify a segment and offset that form an absolute
- address beyond the addressing capacity of IBM-PC compatible machines.
- No checking is done for this, and though the answer given by ABSADR is
- valid, it is probably inapplicable.
-
- 2. It is likewise not hard to enter a segment and absolute address for
- which no offset can reach. CHECK YOUR RESULTS! Segment and offset
- addresses must both lie in the range of 0000h to FFFFh. If you get a
- segment or offset from ABSADR that is more than four digits, the
- problem cannot be solved as you have entered it.
-
- The only way ABSADR signals this situation is to output an address
- more than four digits long in the segment or offset fields.
-
- One way to check the results is to feed the output values back into
- the program and check the answer.
-
- 3. Very little input value range checking is done. ABSADR will try to
- make sense of nearly anything you enter, with no guarantee that the
- results will mean anything. About all it does is complain if the
- number of parameters input was not two.
-
- Internals:
-
- The segment, offset, and absolute addresses are stored internally as C
- "long integers" and all calculations are done using longs. The hex
- conversion is done only on input and output.
-
- Background: The iapx-86 family (8086, 8088, 80186, 80286, etc) of
- microprocessors began as 16-bit address bus chips. This limited the
- amount of memory they could reach to 2 to the 16th power, or 65535
- (64k). To widen the address space of such machines, a two part memory
- addressing scheme was used. One value is used to specify which 64k
- segment to use, the other specifies where in that segment to find the
- data required.
-
- To address more memory, the IBM-PC and her clones multiply the segment
- address by 16 (10h) before using it.
-
- To find out what particular address a given segment:offset pair
- specifies, one can multiply the segment value by 16 (10h) and simply
- add the offset. A similar process can be used to solve for segment or
- offset, given the other two values. Example:
-
- A000:0100 = (segment:offset form)
- A000*10 + 0100 =
- A0000 + 0100 =
- A0100 (absolute form)
-
- Copyrights:
-
- ABSADR and accompaning documentation are copyrighted (c) 1991 by
- Thomas M. Peters. Permission is hereby granted to reproduce it,
- provided that all files are copied intact.
-
- If you use ABSADR, please send $5 or more to the author at the address
- following. If you send more than $8, I will send the commented C
- source code on paper.
-
- Thomas M. Peters
- 4517 N. Oakland Ave
- Milwaukee, WI 53211-1216