170
Chapter 29. MIPS Dependent Features
uses
$gp
. Passing
 G 0
to
as
prevents it from using the
$gp
register on the basis of object size (but
the assembler uses
$gp
for objects in
.sdata
or
sbss
in any case). The size of an object in the
.bss
section is set by the
.comm
or
.lcomm
directive that defines it. The size of an external object may be
set with the
.extern
directive. For example,
.extern sym,4
declares that the object at
sym
is 4
bytes in length, whie leaving
sym
otherwise undefined.
Using small ecoff objects requires linker support, and assumes that the
$gp
register is correctly ini 
tialized (normally done automatically by the startup code). mips ecoff assembly code must not modify
the
$gp
register.
29.3. Directives for debugging information
mips ecoff
as
supports several directives used for generating debugging information which are not
support by traditional mips assemblers. These are
.def
,
.endef
,
.dim
,
.file
,
.scl
,
.size
,
.tag
,
.type
,
.val
,
.stabd
,
.stabn
, and
.stabs
. The debugging information generated by the three
.stab
directives can only be read by gdb, not by traditional mips debuggers (this enhancement is
required to fully support C++ debugging). These directives are primarily used by compilers, not as 
sembly language programmers!
29.4. Directives to override the ISA level
gnu
as
supports an additional directive to change the mips Instruction Set Architecture level on the
fly:
.set mipsn
.
n
should be a number from 0 to 5, or 32, 32r2, 64 or 64r2. The values other than
0 make the assembler accept instructions for the corresponding isa level, from that point on in the
assembly.
.set mipsn
affects not only which instructions are permitted, but also how certain macros
are expanded.
.set mips0
restores the isa level to its original level: either the level you selected
with command line options, or the default for your configuration. You can use this feature to permit
specific r4000 instructions while assembling in 32 bit mode. Use this directive with care!
The directive
.set mips16
puts the assembler into MIPS 16 mode, in which it will assemble in 
structions for the MIPS 16 processor. Use
.set nomips16
to return to normal 32 bit mode.
Traditional mips assemblers do not support this directive.
29.5. Directives for extending MIPS 16 bit instructions
By default, MIPS 16 instructions are automatically extended to 32 bits when necessary. The directive
.set noautoextend
will turn this off. When
.set noautoextend
is in effect, any 32 bit instruc 
tion must be explicitly extended with the
.e
modifier (e.g.,
li.e $4,1000
). The directive
.set
autoextend
may be used to once again automatically extend instructions when necessary.
This directive is only meaningful when in MIPS 16 mode. Traditional mips assemblers do not support
this directive.
29.6. Directive to mark data as an instruction
The
.insn
directive tells
as
that the following data is actually instructions. This makes a difference
in MIPS 16 mode: when loading the address of a label which precedes instructions,
as
automatically
adds 1 to the value, so that jumping to the loaded address will do the right thing.






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

canadian web hosting

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved