OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [binutils-2.18.50/] [gas/] [doc/] [c-i370.texi] - Diff between revs 156 and 816

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 156 Rev 816
@c Copyright 2000, 2002 Free Software Foundation, Inc.
@c Copyright 2000, 2002 Free Software Foundation, Inc.
@c This is part of the GAS manual.
@c This is part of the GAS manual.
@c For copying conditions, see the file as.texinfo.
@c For copying conditions, see the file as.texinfo.
@ifset GENERIC
@ifset GENERIC
@page
@page
@node ESA/390-Dependent
@node ESA/390-Dependent
@chapter ESA/390 Dependent Features
@chapter ESA/390 Dependent Features
@end ifset
@end ifset
@ifclear GENERIC
@ifclear GENERIC
@node Machine Dependencies
@node Machine Dependencies
@chapter ESA/390 Dependent Features
@chapter ESA/390 Dependent Features
@end ifclear
@end ifclear
 
 
@cindex i370 support
@cindex i370 support
@cindex ESA/390 support
@cindex ESA/390 support
 
 
@menu
@menu
* ESA/390 Notes::                Notes
* ESA/390 Notes::                Notes
* ESA/390 Options::              Options
* ESA/390 Options::              Options
* ESA/390 Syntax::               Syntax
* ESA/390 Syntax::               Syntax
* ESA/390 Floating Point::       Floating Point
* ESA/390 Floating Point::       Floating Point
* ESA/390 Directives::           ESA/390 Machine Directives
* ESA/390 Directives::           ESA/390 Machine Directives
* ESA/390 Opcodes::              Opcodes
* ESA/390 Opcodes::              Opcodes
@end menu
@end menu
 
 
@node ESA/390 Notes
@node ESA/390 Notes
@section Notes
@section Notes
The ESA/390 @code{@value{AS}} port is currently intended to be a back-end
The ESA/390 @code{@value{AS}} port is currently intended to be a back-end
for the @sc{gnu} @sc{cc} compiler.  It is not HLASM compatible, although
for the @sc{gnu} @sc{cc} compiler.  It is not HLASM compatible, although
it does support a subset of some of the HLASM directives.  The only
it does support a subset of some of the HLASM directives.  The only
supported binary file format is ELF; none of the usual MVS/VM/OE/USS
supported binary file format is ELF; none of the usual MVS/VM/OE/USS
object file formats, such as ESD or XSD, are supported.
object file formats, such as ESD or XSD, are supported.
 
 
When used with the @sc{gnu} @sc{cc} compiler, the ESA/390 @code{@value{AS}}
When used with the @sc{gnu} @sc{cc} compiler, the ESA/390 @code{@value{AS}}
will produce correct, fully relocated, functional binaries, and has been
will produce correct, fully relocated, functional binaries, and has been
used to compile and execute large projects.  However, many aspects should
used to compile and execute large projects.  However, many aspects should
still be considered experimental; these include shared library support,
still be considered experimental; these include shared library support,
dynamically loadable objects, and any relocation other than the 31-bit
dynamically loadable objects, and any relocation other than the 31-bit
relocation.
relocation.
 
 
@node ESA/390 Options
@node ESA/390 Options
@section Options
@section Options
@code{@value{AS}} has no machine-dependent command-line options for the ESA/390.
@code{@value{AS}} has no machine-dependent command-line options for the ESA/390.
 
 
@cindex ESA/390 Syntax
@cindex ESA/390 Syntax
@node ESA/390 Syntax
@node ESA/390 Syntax
@section Syntax
@section Syntax
The opcode/operand syntax follows the ESA/390 Principles of Operation
The opcode/operand syntax follows the ESA/390 Principles of Operation
manual; assembler directives and general syntax are loosely based on the
manual; assembler directives and general syntax are loosely based on the
prevailing AT&T/SVR4/ELF/Solaris style notation.  HLASM-style directives
prevailing AT&T/SVR4/ELF/Solaris style notation.  HLASM-style directives
are @emph{not} supported for the most part, with the exception of those
are @emph{not} supported for the most part, with the exception of those
described herein.
described herein.
 
 
A leading dot in front of directives is optional, and the case of
A leading dot in front of directives is optional, and the case of
directives is ignored; thus for example, .using and USING have the same
directives is ignored; thus for example, .using and USING have the same
effect.
effect.
 
 
A colon may immediately follow a label definition.  This is
A colon may immediately follow a label definition.  This is
simply for compatibility with how most assembly language programmers
simply for compatibility with how most assembly language programmers
write code.
write code.
 
 
@samp{#} is the line comment character.
@samp{#} is the line comment character.
 
 
@samp{;} can be used instead of a newline to separate statements.
@samp{;} can be used instead of a newline to separate statements.
 
 
Since @samp{$} has no special meaning, you may use it in symbol names.
Since @samp{$} has no special meaning, you may use it in symbol names.
 
 
Registers can be given the symbolic names r0..r15, fp0, fp2, fp4, fp6.
Registers can be given the symbolic names r0..r15, fp0, fp2, fp4, fp6.
By using thesse symbolic names, @code{@value{AS}} can detect simple
By using thesse symbolic names, @code{@value{AS}} can detect simple
syntax errors. The name rarg or r.arg is a synonym for r11, rtca or r.tca
syntax errors. The name rarg or r.arg is a synonym for r11, rtca or r.tca
for r12, sp, r.sp, dsa r.dsa for r13, lr or r.lr for r14, rbase or r.base
for r12, sp, r.sp, dsa r.dsa for r13, lr or r.lr for r14, rbase or r.base
for r3 and rpgt or r.pgt for r4.
for r3 and rpgt or r.pgt for r4.
 
 
@samp{*} is the current location counter.  Unlike @samp{.} it is always
@samp{*} is the current location counter.  Unlike @samp{.} it is always
relative to the last USING directive.  Note that this means that
relative to the last USING directive.  Note that this means that
expressions cannot use multiplication, as any occurrence of @samp{*}
expressions cannot use multiplication, as any occurrence of @samp{*}
will be interpreted as a location counter.
will be interpreted as a location counter.
 
 
All labels are relative to the last USING.  Thus, branches to a label
All labels are relative to the last USING.  Thus, branches to a label
always imply the use of base+displacement.
always imply the use of base+displacement.
 
 
Many of the usual forms of address constants / address literals
Many of the usual forms of address constants / address literals
are supported.  Thus,
are supported.  Thus,
@example
@example
        .using  *,r3
        .using  *,r3
        L       r15,=A(some_routine)
        L       r15,=A(some_routine)
        LM      r6,r7,=V(some_longlong_extern)
        LM      r6,r7,=V(some_longlong_extern)
        A       r1,=F'12'
        A       r1,=F'12'
        AH      r0,=H'42'
        AH      r0,=H'42'
        ME      r6,=E'3.1416'
        ME      r6,=E'3.1416'
        MD      r6,=D'3.14159265358979'
        MD      r6,=D'3.14159265358979'
        O       r6,=XL4'cacad0d0'
        O       r6,=XL4'cacad0d0'
        .ltorg
        .ltorg
@end example
@end example
should all behave as expected: that is, an entry in the literal
should all behave as expected: that is, an entry in the literal
pool will be created (or reused if it already exists), and the
pool will be created (or reused if it already exists), and the
instruction operands will be the displacement into the literal pool
instruction operands will be the displacement into the literal pool
using the current base register (as last declared with the @code{.using}
using the current base register (as last declared with the @code{.using}
directive).
directive).
 
 
@node ESA/390 Floating Point
@node ESA/390 Floating Point
@section Floating Point
@section Floating Point
@cindex floating point, ESA/390 (@sc{ieee})
@cindex floating point, ESA/390 (@sc{ieee})
@cindex ESA/390 floating point (@sc{ieee})
@cindex ESA/390 floating point (@sc{ieee})
The assembler generates only @sc{ieee} floating-point numbers.  The older
The assembler generates only @sc{ieee} floating-point numbers.  The older
floating point formats are not supported.
floating point formats are not supported.
 
 
 
 
@node ESA/390 Directives
@node ESA/390 Directives
@section ESA/390 Assembler Directives
@section ESA/390 Assembler Directives
 
 
@code{@value{AS}} for the ESA/390 supports all of the standard ELF/SVR4
@code{@value{AS}} for the ESA/390 supports all of the standard ELF/SVR4
assembler directives that are documented in the main part of this
assembler directives that are documented in the main part of this
documentation.  Several additional directives are supported in order
documentation.  Several additional directives are supported in order
to implement the ESA/390 addressing model.  The most important of these
to implement the ESA/390 addressing model.  The most important of these
are @code{.using} and @code{.ltorg}
are @code{.using} and @code{.ltorg}
 
 
@cindex ESA/390-only directives
@cindex ESA/390-only directives
These are the additional directives in @code{@value{AS}} for the ESA/390:
These are the additional directives in @code{@value{AS}} for the ESA/390:
 
 
@table @code
@table @code
@item .dc
@item .dc
A small subset of the usual DC directive is supported.
A small subset of the usual DC directive is supported.
 
 
@item .drop @var{regno}
@item .drop @var{regno}
Stop using @var{regno} as the base register.  The @var{regno} must
Stop using @var{regno} as the base register.  The @var{regno} must
have been previously declared with a @code{.using} directive in the
have been previously declared with a @code{.using} directive in the
same section as the current section.
same section as the current section.
 
 
@item .ebcdic @var{string}
@item .ebcdic @var{string}
Emit the EBCDIC equivalent of the indicated string.  The emitted string
Emit the EBCDIC equivalent of the indicated string.  The emitted string
will be null terminated.  Note that the directives @code{.string} etc. emit
will be null terminated.  Note that the directives @code{.string} etc. emit
ascii strings by default.
ascii strings by default.
 
 
@item EQU
@item EQU
The standard HLASM-style EQU directive is not supported; however, the
The standard HLASM-style EQU directive is not supported; however, the
standard @code{@value{AS}} directive .equ can be used to the same effect.
standard @code{@value{AS}} directive .equ can be used to the same effect.
 
 
@item .ltorg
@item .ltorg
Dump the literal pool accumulated so far; begin a new literal pool.
Dump the literal pool accumulated so far; begin a new literal pool.
The literal pool will be written in the current section; in order to
The literal pool will be written in the current section; in order to
generate correct assembly, a @code{.using} must have been previously
generate correct assembly, a @code{.using} must have been previously
specified in the same section.
specified in the same section.
 
 
@item .using @var{expr},@var{regno}
@item .using @var{expr},@var{regno}
Use @var{regno} as the base register for all subsequent RX, RS, and SS form
Use @var{regno} as the base register for all subsequent RX, RS, and SS form
instructions. The @var{expr} will be evaluated to obtain the base address;
instructions. The @var{expr} will be evaluated to obtain the base address;
usually, @var{expr} will merely be @samp{*}.
usually, @var{expr} will merely be @samp{*}.
 
 
This assembler allows two @code{.using} directives to be simultaneously
This assembler allows two @code{.using} directives to be simultaneously
outstanding, one in the @code{.text} section, and one in another section
outstanding, one in the @code{.text} section, and one in another section
(typically, the @code{.data} section).  This feature allows
(typically, the @code{.data} section).  This feature allows
dynamically loaded objects to be implemented in a relatively
dynamically loaded objects to be implemented in a relatively
straightforward way.  A @code{.using} directive must always be specified
straightforward way.  A @code{.using} directive must always be specified
in the @code{.text} section; this will specify the base register that
in the @code{.text} section; this will specify the base register that
will be used for branches in the @code{.text} section.  A second
will be used for branches in the @code{.text} section.  A second
@code{.using} may be specified in another section; this will specify
@code{.using} may be specified in another section; this will specify
the base register that is used for non-label address literals.
the base register that is used for non-label address literals.
When a second @code{.using} is specified, then the subsequent
When a second @code{.using} is specified, then the subsequent
@code{.ltorg} must be put in the same section; otherwise an error will
@code{.ltorg} must be put in the same section; otherwise an error will
result.
result.
 
 
Thus, for example, the following code uses @code{r3} to address branch
Thus, for example, the following code uses @code{r3} to address branch
targets and @code{r4} to address the literal pool, which has been written
targets and @code{r4} to address the literal pool, which has been written
to the @code{.data} section.  The is, the constants @code{=A(some_routine)},
to the @code{.data} section.  The is, the constants @code{=A(some_routine)},
@code{=H'42'} and @code{=E'3.1416'} will all appear in the @code{.data}
@code{=H'42'} and @code{=E'3.1416'} will all appear in the @code{.data}
section.
section.
 
 
@example
@example
.data
.data
        .using  LITPOOL,r4
        .using  LITPOOL,r4
.text
.text
        BASR    r3,0
        BASR    r3,0
        .using  *,r3
        .using  *,r3
        B       START
        B       START
        .long   LITPOOL
        .long   LITPOOL
START:
START:
        L       r4,4(,r3)
        L       r4,4(,r3)
        L       r15,=A(some_routine)
        L       r15,=A(some_routine)
        LTR     r15,r15
        LTR     r15,r15
        BNE     LABEL
        BNE     LABEL
        AH      r0,=H'42'
        AH      r0,=H'42'
LABEL:
LABEL:
        ME      r6,=E'3.1416'
        ME      r6,=E'3.1416'
.data
.data
LITPOOL:
LITPOOL:
        .ltorg
        .ltorg
@end example
@end example
 
 
 
 
Note that this dual-@code{.using} directive semantics extends
Note that this dual-@code{.using} directive semantics extends
and is not compatible with HLASM semantics.  Note that this assembler
and is not compatible with HLASM semantics.  Note that this assembler
directive does not support the full range of HLASM semantics.
directive does not support the full range of HLASM semantics.
 
 
@end table
@end table
 
 
@node ESA/390 Opcodes
@node ESA/390 Opcodes
@section Opcodes
@section Opcodes
For detailed information on the ESA/390 machine instruction set, see
For detailed information on the ESA/390 machine instruction set, see
@cite{ESA/390 Principles of Operation} (IBM Publication Number DZ9AR004).
@cite{ESA/390 Principles of Operation} (IBM Publication Number DZ9AR004).
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.