Subject: Re: DEC/MIPS ABI and small structs?
To: Simon Burge <simonb@wasabisystems.com>
From: Andrew Cagney <ac131313@cygnus.com>
List: port-pmax
Date: 07/15/2001 18:11:52
> Andrew Cagney wrote:
>
>
>> Hello,
>>
>> I'm trying to find a little history on the original ABI used by DEC on
>> the PMAX (little endian MIPS) machines.
>>
>> I'm firstly wondering what the abi is correctly called.
>
>
> COFF.
I was thinking of something like o32, n32, o64, ....
>> Second, according to the ABI, how should small structs be passed vis:
>>
>> struct c1 { char c; };
>> void foo (struct c1 c1);
>
>
> I don't have an ABI document, but both appear to be passed on the stack.
> Here's the assembly output of the a simple C program (source included in
> the asm- more assemblers should do this :-):
I think it was was passed in A0, might need to look at the function to
see which value it uses.
> # 8
> # 9 bar1(c1);
> lbu $14, c1
> sb $14, 0($sp)
pick up c1, store it on the stack at 0($sp).
> lw $4, 0($sp)
move it in to A0 as a word. This means that c1 is sitting in the least
significant byte of A0 (and the other bytes contain garbage?).
> .livereg 0x0800000E,0x00000000
> jal bar1
> .loc 2 10
> # 10 bar2(foo);
> lbu $15, foo
> sb $15, 0($sp)
> lw $4, 0($sp)
> .livereg 0x0800000E,0x00000000
> jal bar2
> .loc 2 11
> # 11 }
> move $2, $0
The reason for asking is that I'm looking at a LE o32 bug involving
small structs and register alignment. To the best of my knowledge
nothing ever specified this formally.
Thanks for the info,
Andrew