Chapter 9 Writing Machine Language Instructions and Directive Statements

9.4.9radix

Syntax

label

operation

operand

 

radix

expression

Default settings

Radix 10 (decimal).

Functional description

This directive specifies the radix that will be used by default. The Cross-Assembler provides three coding formats for numbers.

Extended C language format

Intel format

Matsushita format

The format is selected with the notation directive. Refer to the description of the notation directive. The default is extended C language format.

The radix directive specifies the default radix for numbers in these coding formats by the expression in the operand. Select one from radix 2 (binary), radix 8 (octal), radix 10 (decimal), and radix 16 (hexadecimal).

NOTE:

In extended C language format, the default radix cannot be specified by the radix

 

 

directive. The default is fixed as radix 10 (decimal), and it cannot be changed to

 

 

another radix

 

 

 

Operand coding rules

The expression coded in the operand must result in the attribute abs (absolute). Refer to section 8.7.4, "Expression Attributes", regarding attributes of expressions.

The calculated result of the expression coded in the operand must be either 2, 8, 10, or 16. The radix of the expression in the operand is always 10 (decimal), regardless of the current default radix. If the expression results in a number that does not specify a radix, the assembler will generate an error and ignore this directive.

Usage example

Below is an example use of the radix directive.

radix 16

radix BINARY

Writing Directive Statements 165

Page 177
Image 177
Panasonic MN1030 user manual Label Operation Operand Radix Expression, Another radix, Radix Radix Binary