darrell@sdcsvax.UUCP (Darrell Long) (07/11/85)
And now, the next episode in Darrell's adventures in AT&T land. The 3B-2 processor (WE-32001), has a displacement addressing mode disp(%rn). This mode could be used with the %pc as the register to yield a program counter relative (and thus position independent) addressing mode as is done in the VAX and Pdp-11. Instead, the assembler always uses ABSOLUTE ADRESSES! I've forced PC-relative mode and it works. Does anyone have an explaination? Could this be yet another processor bug that the assembler is working around? Fear & Loathing in AT&&-land. -- Darrell Long Department of Electrical Engineering and Computer Science University of California, San Diego USENET: sdcsvax!darrell ARPA: darrell@sdcsvax
wfmans@ihuxb.UUCP (w. mansfield) (07/25/85)
Mr Long comments that the WE-32001 contains a pc displacement addressing mode that could be used to effect position independent code. Yes it exists, and I don't know specifically why the assembler doesn't use it. The only possibilities that come to mind are that it might be easier for the assembler to generate the absolute address mode, or that the code might execute faster. If you look closely at the operand descripter encodings (at least for the 32100, I'm assuming that the 32001 is the same) you'll you'll see that using the PC with some addressing modes causes special things to happen.
jlw@ariel.UUCP (J.WOOD) (07/27/85)
> Mr Long comments that the WE-32001 contains a pc displacement addressing > mode that could be used to effect position independent code. Yes it > exists, and I don't know specifically why the assembler doesn't use it. > The only possibilities that come to mind are that it might be easier > for the assembler to generate the absolute address mode, or that the > code might execute faster. If you look closely at the operand > descripter encodings (at least for the 32100, I'm assuming that the > 32001 is the same) you'll you'll see that using the PC with some addressing > modes causes special things to happen. This also may be a holdover from the past. Most of the hardware implementations that I know about which use the 8086 and its descendants have separate I and D space. In that case PC relative addressing for data objects won't work. Perhaps the Assembler was written by the same crowd. Joseph L. Wood, III AT&T Information Systems Laboratories, Holmdel (201) 834-3759 <ariel!>titania!jlw
guy@sun.uucp (Guy Harris) (08/02/85)
> This also may be a holdover from the past. Most of the hardware > implementations that I know about which use the 8086 and its > descendants have separate I and D space. In that case PC relative > addressing for data objects won't work. I looked at the "iAPX 286 Programmer's Reference Manual" and don't see any PC-relative (or, in 80*8[68]-family terms, IP-relative) addressing modes. That's why PC relative addressing for data objects won't work on the 8086 and its descendants - it doesn't exist. The PDP-11s with separate I&D space use I space for references to "instructions, index words, absolute addresses, and immediate operands" - this implies that any operand references using the PC as an index register other than immediate operands and absolute addresses use D space, so PC-relative addressing for data objects will work. The M68000 and M68010, however, have the PC as a register separate from the general-purpose registers, and all references relative to it are "classified as program references", which means they refer to I space if the hardware has separate I&D space. Guy Harris