From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa751,76b32c1a25e6d8c9 X-Google-Attributes: gidfa751,public X-Google-Thread: 100159,76b32c1a25e6d8c9 X-Google-Attributes: gid100159,public X-Google-Thread: 1164f8,76b32c1a25e6d8c9 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1051a8,76b32c1a25e6d8c9 X-Google-Attributes: gid1051a8,public From: linnig@portugal.dseg.ti.com (Mike Linnig) Subject: Re: MIPS Assembly language question Date: 1995/09/19 Message-ID: #1/1 X-Deja-AN: 110386419 distribution: na references: <43ko7h$ff0@news.eecs.umich.edu> newsgroups: comp.sys.mips,comp.sys.dec,comp.sys.sgi.misc,comp.sys.sgi.hardware In article <43ko7h$ff0@news.eecs.umich.edu> jlbell@presto.eecs.umich.edu (Jeffrey L. Bell) writes: > > Presently my code looks like this: > > lw t1, x > lw t2, y > or t1, t2, t3 > sw t3, z > ... > .data > x: .word 0 > y: .word 0 > z: .word 0 > > The assembler creates lui instructions for all of the > loads and stores. This takes up a good 20% of my executable. > How about using the la instruction to load the base address and using .struct to create the offsets: la s8, data_origin # load address of data_origin ... lw t1, x(s8) lw t2, y(s8) or t1, t2, t3 lw t3, z (s8) ... .data data_origin: .word 0 # x -- this is the actual storage .word 0 # y .word 0 # z .struct 0 x: .word 0 -- this provides the offsets y: .word 0 z: .word 0 -- -- Mike +-----------------------------------------+ | Mike Linnig | | Phone: 214-575-4308 | | "97.43% of all statistics are made up" | +-----------------------------------------+