Products
and Services Support
and Docs Training Partner Programs About Red
Hat
  download storecart
red hat logo
redhat.comredhat network

Red Hat Documentation

h8/300 Dependent Features Contents|Index|Previous|Next
H8/300 dependent features

See the following documentation for the Hitachi H8/300 architecture’s features and options for the assembler.

Options for H8/300

as has no additional command-line options for the Hitachi H8/300 family.

Syntax for H8/300

The following documentation refers to the syntax for the Hitachi H8/300.

Special characters for H8/300

; is the line comment character.

$ can be used instead of a newline to separate statements. Therefore you may not use $ in symbol names on the H8/300.

Register names for H8/300

You can use predefined symbols of the form rnh and rnl to refer to the H8/300 registers as sixteen 8-bit general-purpose registers. n is a digit from 0 to 7); for instance, both r0h and r7l are valid register names. You can also use the eight predefined symbols rn to refer to the H8/300 registers as 16-bit registers (you must use this form for addressing). On the H8/300H, you can also use the eight predefined symbols ern (er0...er7) to refer to the 32-bit general purpose registers.

The two control registers are called pc (program counter; a 16-bit register, except on the H8/300H where it is 24 bits) and ccr (condition code register; an 8-bit register). r7 is used as the stack pointer, and can also be called sp.

Addressing modes for H8/300

as understands the following addressing modes for the H8/300.
 

    rn
      Register direct

    @rn

      Register indirect

    @(d, rn)
    @(d:16, rn)
    @(d:24, rn)

      Register indirect: 16-bit or 24-bit displacement, d, from register, n (24-bit displacements are only meaningful on the H8/300H)

    @rn+

      Register indirect with post-increment

    @-rn

      Register indirect with pre-decrement

    @aa
    @aa:8
    @aa:16
    @aa:24

      Absolute address, aa (the address size, :24, only makes sense on the H8/300H)
    #xx
    #xx:8
    #xx:16
    #xx:32
      Immediate data, xx. Use the ‘:8’, ‘:16’, or ‘:32’ specifications for clarity, if you wish; but as neither requires this nor uses it—the data size required is taken from context.

    @@aa
    @@aa:8

      Memory indirect. Use the ‘:8’ specification for clarity, if you wish; but as neither requires this nor uses it.

Floating point for H8/300

The H8/300 family has no hardware floating point, but the .float directive generates IEEE floating-point numbers for compatibility with other development tools.

Machine directives for H8/300

as has only one machine-dependent directive for the H8/300:
 

    .h8300h
      Recognize and emit additional instructions for the H8/300H variant, and also make .int emit 32-bit numbers rather than the usual (16-bit) for the H8/300 family.

For the H8/300 family (including the H8/300H), .word directives generate 16-bit numbers.

Opcodes for H8/300

For detailed information on the H8/300 machine instruction set, see H8/300 Series Programming Manual (Hitachi ADE–602–025).

For information specific to the H8/300H, see H8/300H Series Programming Manual (from Hitachi).

as implements all the standard H8/300 opcodes. No additional pseudo-instructions are needed on this family.

Four H8/300 instructions (add, cmp, mov, and  sub) are defined with variants using the suffixes, .b, .w, and .l to specify the size of a memory operand.

as supports these suffixes, but does not require them; since one of the operands is always a register, as can deduce the correct size.

For instance, since r0 refers to a 16-bit register, note the distinctions in the following examples.

      mov   r0,@foo

      mov   w r0,@foo

If you use the size suffixes, as issues a warning when the suffix and the register size do not match.

Top|Contents|Index|Previous|Next

 

 


 
© 2001 Red Hat, Inc. All rights reserved.
About Red Hat  :  Legal statement  :  Privacy statement  :  Y2K statement  :  Contact Red Hat