[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

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
Specifies the default assembly mode. A source program can contain only instructions that are common to both POWER family and PowerPC. Any other instruction causes an error.
push
Saves the current assembly mode in the assembly mode pushdown stack.
pop
Removes 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
Specifies the PowerPC common architecture, 32-bit mode. A source program can contain only PowerPC common architecture, 32-bit instructions. Any other instruction causes an error.
ppc64
Specifies the PowerPC 64-bit mode. A source program can contain only PowerPC 64-bit instructions. Any other instruction causes an error.
com
Specifies the POWER family and PowerPC architecture intersection mode. A source program can contain only instructions that are common to both POWER family and PowerPC. Any other instruction causes an error.
pwr
Specifies the POWER family architecture, POWER family implementation mode. A source program can contain only instructions for the POWER family implementation of the POWER family architecture. Any other instruction causes an error.
pwr2
POWER family architecture, POWER2 implementation. A source program can contain only instructions for the POWER2 implementation of the POWER family architecture. Any other instruction causes an error. (pwr2 is the preferred value, but the alternate value pwrx can also be used.)

 
any
Any nonspecific POWER family/PowerPC architecture or implementation mode. This includes mixtures of instructions from any of the valid architectures or implementations.
601
Specifies the PowerPC architecture, PowerPC 601 RISC Microprocessor mode. A source program can contain only instructions for the PowerPC architecture, PowerPC 601 RISC Microprocessor. Any other instruction causes an error.
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 family instructions which are not included in the PowerPC architecture. This allows existing POWER family 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 family 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
Specifies the PowerPC architecture, PowerPC 603 RISC Microprocessor mode. A source program can contain only instructions for the PowerPC architecture, PowerPC 603 RISC Microprocessor. Any other instruction causes an error.
604
Specifies the PowerPC architecture, PowerPC 604 RISC Microprocessor mode. A source program can contain only instructions for the PowerPC architecture, PowerPC 604 RISC Microprocessor. Any other instruction causes an error.
A35
Specifies the A35 mode. A source program can contain only instructions for the A35. Any other instruction causes an error.
Note
See as Command Flags for more information on assembly mode values.

Examples

  1. To set the target environment to POWER family architecture, POWER family implementation:
    .machine "pwr"
  2. To set the target environment to any non-specific POWER family/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.

Assembling with the as Command.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]