Subject: Re: expr.c: large structure problems
To: Herman ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
From: Jonathan Stone <jonathan@DSG.Stanford.EDU>
List: tech-toolchain
Date: 10/27/1998 15:23:49
I wrote:
>the assembly generated (my comments) is
>
> 0: 00852021 addu $a0,$a0,$a1 # add first two args
> 4: 2402000d li $v0,13 # load constant offset 13
> 8: 3c010001 lui $at,0x1 # load $at with (1 << 16)
> c: 00240821 addu $at,$at,$a0 # add to frist two args
> 10: 03e00008 jr $ra # delayed-branch return
> 14: a0228020 sb $v0,-32736($at) # store into
> # (a0 + a1) + (1 << 16) +
(0x10000 - 3800)
oops, that last line has the operands backwards. it should be
# (a0 + a1) + (1 << 16) +
(32800 - (1 << 16))
if it wasnt clear from context, the upper part is done in 32-bit
arithmetic, and the 16-bit immediate offset in the bottom line gets
sign-extended to 32 bits, so it all works out properly.