[comp.sys.mips] li.s,li.d

jordan@aero.org (Larry M. Jordan) (04/02/91)

Any ideas how these two assembler macros (li.s, li.d) are
really implemented?

Also, (and this may be the solution to my question) is
there a disassembler for the .o files?  The .s files, I'm
afraid, hide too much of what is going on--I really want to
know what machine instructions are generated.

Thanks in advance.

--Larry

kenton@abyss.zk3.dec.com (Jeff Kenton OSG/UEG) (04/02/91)

In article <1991Apr1.182811.28382@aero.org>, jordan@aero.org (Larry M.
Jordan) writes:
|> 
|> Also, (and this may be the solution to my question) is
|> there a disassembler for the .o files?  The .s files, I'm
|> afraid, hide too much of what is going on--I really want to
|> know what machine instructions are generated.
|> 

You should be able to build a working dis-assembler in about half a day.

-----------------------------------------------------------------------------
==	jeff kenton		Consulting at kenton@decvax.dec.com        ==
==	(617) 894-4508			(603) 881-0011			   ==
-----------------------------------------------------------------------------

rogerk@mips.com (Roger B.A. Klorese) (04/02/91)

In article <1991Apr1.182811.28382@aero.org> jordan@aero.org (Larry M. Jordan) writes:
>
>Any ideas how these two assembler macros (li.s, li.d) are
>really implemented?

Yes, they are implemented as load-word-to-coprocessor-1 (lwc1) instructions
or pairs.  They "immediate" values are stored in the .lit4 (single) and
.lit8 (double) sections.

>Also, (and this may be the solution to my question) is
>there a disassembler for the .o files?  The .s files, I'm
>afraid, hide too much of what is going on--I really want to
>know what machine instructions are generated.


Script started on Mon Apr  1 12:24:00 1991
% [tecate:rogerk] 101) cat foo.s
.set noreorder
li.s    $f0, 1.23456e+5
nop
li.d        $f2, 2.46810121416e+123
% [tecate:rogerk] 102) as foo.s
% [tecate:rogerk] 103) size a.out

Size of a.out:48        

        Section         Size      Physical Address    Virtual Address

          .text          16                0                  0 
          .lit8          16               16                 16 
          .lit4          16               32                 32 
% [tecate:rogerk] 104) dis a.out
  0x0:  c7808020        lwc1    $f0,-32736(gp)
  0x4:  00000000        nop
  0x8:  c7838010        lwc1    $f3,-32752(gp)
  0xc:  c7828014        lwc1    $f2,-32748(gp)
% [tecate:rogerk] 105) dis -s .lit8 a.out
  0x10: 598dde5b        blezl   t4,0xffff7980
  0x14: ea6964fd        swc2    $9,25853(s3)
  0x18: 00000000        nop
  0x1c: 00000000        nop
% [tecate:rogerk] 106) dis -s .lit4 a.out
  0x20: 47f12000        
  0x24: 00000000        nop
  0x28: 00000000        nop
  0x2c: 00000000        nop
% [tecate:rogerk] 107) exit
% [tecate:rogerk] 108) 

script done on Mon Apr  1 12:24:58 1991
-- 
ROGER B.A. KLORESE                                  MIPS Computer Systems, Inc.
MS 6-05    930 DeGuigne Dr.   Sunnyvale, CA  94088              +1 408 524-7421
"10 years of Reagan/Bush have brought us to a new place: postconstitutional
America." - Jon Carroll     rogerk@mips.COM | {ames,decwrl,pyramid}!mips!rogerk 

murphy@mips.com (Mike Murphy) (04/02/91)

In article <1991Apr1.182811.28382@aero.org> jordan@aero.org (Larry M. Jordan) writes:
>Also, (and this may be the solution to my question) is
>there a disassembler for the .o files?  The .s files, I'm
>afraid, hide too much of what is going on--I really want to
>know what machine instructions are generated.

Try /usr/bin/dis

--mike

boaz@mips2.eng.ready.com (Boaz Kahana) (04/03/91)

In article <1991Apr1.182811.28382@aero.org>, jordan@aero.org (Larry M.
Jordan) writes:
> 
> 
> Also, (and this may be the solution to my question) is
> there a disassembler for the .o files?  The .s files, I'm
> afraid, hide too much of what is going on--I really want to
> know what machine instructions are generated.
> 

If you are developing a code for the MIPS workstation you can examine the 
assemley code by using dbx (after compiling  with -g flag) . 
Disassembley  in DBX is done by <address>/<number>i
 Meaning disassemble <number>  instruction starting at <address>.


Boaz Kahana
Ready Systems 
470 Potrero Ave. Sunnyvale CA 94086
boaz@mips2.eng.ready.com  (408) 522-7392