[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

.machine Pseudo-op

Purpose

Defines the intended target environment.

Syntax

.machine StringConstant

Description

The .machine pseudo-op selects the correct instruction mnemonics set for the target machine. It provides symbol table information necessary for the use of the linkage editor. The .machine pseudo-op overrides the setting of the as command's -m flag, which can also be used to specify the instruction mnemonics set for the target machine.

The .machine pseudo-op can occur in the source program more than once. The value specified by a .machine pseudo-op overrides any value specified by an earlier .machine pseudo-op. It is not necessary to place the first .machine pseudo-op at the beginning of a source program. If no .machine pseudo-op occurs at the beginning of a source program and the -m flag is not used with the as command, the default assembly mode is used. The default assembly mode is overridden by the first .machine pseudo-op.

If a .machine pseudo-op specifies a value that is not valid, an error is reported. As a result, the last valid value specified by the default mode value, the -m flag, or a previous .machine pseudo-op is used for the remainder of the instruction validation in the assembler pass one.

Parameters

StringConstant Specifies the assembly mode. This parameter is not case-sensitive, and can be any of the values which can be specified with the -m flag on the command line. Possible values, enclosed in quotation marks, are:
Null string ("" ) or nothing The default assembly mode. Instructions not in the POWER and PowerPC architecture intersection result in instructional warnings. This mode is new beginning with the Version 4.1 assembler.
push Save the current assembly mode in the assembly mode pushdown stack.
pop Remove a previously saved value from the assembly mode pushdown stack and restore the assembly mode to this saved value.
Note: The intended use of push and pop is inside of include files which alter the current assembly mode. .machine "push" should be used in the included file, before it changes the current assembly mode with another .machine. Similarly, .machine "pop" should be used at the end of the included file, to restore the input assembly mode.

Attempting to hold more than 100 values in the assembly mode pushdown stack will result in an assembly error. The pseudo-ops .machine "push" and .machine "pop" are used in pairs.

ppc PowerPC common architecture, 32-bit mode.
com POWER and PowerPC architecture intersection.
pwr POWER architecture, POWER implementation.
pwr2 POWER architecture, POWER2 implementation. (pwr2 is the preferred value, but the alternate value pwrx can also be used.)
any Any nonspecific POWER/PowerPC architecture or implementation mode. This includes mixtures of instructions from any of the valid architectures or implementations.
601 PowerPC architecture, PowerPC 601 RISC Microprocessor.
Attention: It is recommended that the 601 assembly mode not be used for applications that are intended to be portable to future PowerPC systems. The com or ppc assembly mode should be used for such applications.

The PowerPC 601 RISC Microprocessor implements the PowerPC architecture, plus some POWER instructions which are not included in the PowerPC architecture. This allows existing POWER applications to run with acceptable performance on PowerPC systems. Future PowerPC systems will not have this feature. The 601 assembly mode may result in applications that will not run on existing POWER systems and that may not have acceptable performance on future PowerPC systems, because the 601 assembly mode permits the use of all the instructions provided by the PowerPC 601 RISC Microprocessor.

603 PowerPC architecture, PowerPC 603 RISC Microprocessor.
604 PowerPC architecture, PowerPC 604 RISC Microprocessor.
Note: See "as Command Flags" for more information on assembly mode values.

Examples

  1. To set the target environment to POWER architecture, POWER implementation:
    .machine "pwr"
  2. To set the target environment to any non-specific POWER/PowerPC architecture or implementation mode:
    .machine "any"
  3. To explicitly select the default assembly mode:
    .machine ""
  4. The following example of assembler output for a fragment of code shows the usage of .machine "push" and .machine "pop" :
     push1.s                              V4.1                04/15/94
    File# Line#  Mode Name   Loc Ctr   Object Code            Source
    0       1 |                                              .machine   "pwr2"
    0       2 |                                              .csect    longname1[PR]
    0       3 |  PWR2 longna 00000000  0000000a              .long   10
    0       4 |  PWR2 longna 00000004  329e000a              ai    20,30,10
    0       5 |  PWR2 longna 00000008  81540014              l    10, 20(20)
    0       6 |                                              .machine "push"  
    0       7 |                                              .machine  "ppc"
    0       8 |                                              .csect  a2[PR]
    0       9 |  PPC  a2     00000000  7d4c42e6               mftb  10
    0      10 |                                              .machine "pop"
    0      11 |  PWR2 a2     00000004  329e000a              ai    20,30,10
    0      12 |                                      

Related Information

Host Machine Independence and Target Environment Indicator Flag.

Pseudo-ops Overview.


[ Previous | Next | Contents | Home | Search ]