Controlling Names Used In Assembler Code - Red Hat ENTERPRISE LINUX 3 - USING GCC Using Instructions

Using the gnu compiler collection (gcc)
Hide thumbs Also See for ENTERPRISE LINUX 3 - USING GCC:
Table of Contents

Advertisement

Chapter 6. Extensions to the C Language Family
S/390 and zSeries--
s390.h
a
Address register (general purpose register except r0)
d
Data register (arbitrary general purpose register)
f
Floating-point register
I
Unsigned 8-bit constant (0-255)
J
Unsigned 12-bit constant (0-4095)
K
Signed 16-bit constant (-32768-32767)
L
Unsigned 16-bit constant (0-65535)
Q
Memory reference without index register
S
Symbolic constant suitable for use with the

6.39. Controlling Names Used in Assembler Code

You can specify the name to be used in the assembler code for a C function or variable by writing the
(or
) keyword after the declarator as follows:
asm
__asm__
int foo asm ("myfoo") = 2;
This specifies that the name to be used for the variable
rather than the usual
On systems where an underscore is normally prepended to the name of a C function or variable, this
feature allows you to define names for the linker that do not start with an underscore.
It does not make sense to use this feature with a non-static local variable since such variables do not
have assembler names. If you are trying to put the variable in a particular register, see Section 6.40
Variables in Specified Registers. GCC presently accepts such code with a warning, but will probably
be changed to issue an error, rather than a warning, in the future.
You cannot use
asm
declaration for the function before its definition and putting
.
_foo
in this way in a function definition; but you can get the same effect by writing a
instruction
larl
in the assembler code should be
foo
there, like this:
asm
173
myfoo

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ENTERPRISE LINUX 3 - USING GCC and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Enterprise linux 3

Table of Contents