Chapter Contents |
Previous |
Next |
Communication with Assembler Programs |
Most existing assembler routines can be called from
C with little modification, if any. Furthermore, assembler routines called
from C can call other C routines if, when C is called, register 12 has the
same value that it had when the first assembler routine was entered. (Additional
restrictions apply if one of the run-time linkage options
=optimize
or
=minimal
is in use, as described later in this chapter.)
In compiled code, general register 12 always addresses a block of data known
as the C Run-Time Anchor Block (CRAB). The CRAB is explained in detail in The C Run-Time Anchor Block.
Adding Existing Assembler Routines to C Programs |
Many existing assembler routines can be called from
C without modification. Unless the routine expects a normal C parameter list,
you may need to use one or more of the
@
operators or the
_ _asm
,
_ _ref
, or
_ _ibmos
keywords to cause the compiler to create the parameter list in the
format expected by the assembler routine.
Adding New Assembler Routines to C Programs |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.