-convert_asm


This option enables the assembler transition supporting function.

[Specification format]

-convert_asm

 

-

Interpretation when omitted

The assembler transition supporting function is not enabled.

[Detailed description]

-

For the descriptions on "CA78K0R Assembler Language Specifications" in the table below, the descriptions on "RL78 Assembler Language Specifications" should be read instead.

Table 2.7

Assembler transition supporting function

Classification

CA78K0R

Assembler

Language

Specifications

RL78 Assembler

Language

Specifications

Necessity for Modifying the Source and Specifying Options

Numerical

constant

n...nB (n = 0, 1)

(binary)

Same as left

Specify -base_number=suffix.

n...nO (n = 0 to 7)

(octal)

Same as left

Specify -base_number=suffix.

n...nH (n = 0 to 9, A to F, a to f)

(hexadecimal)

Same as left

Specify -base_number=suffix.

String

'Character ...

Character'

"Character ...

Character"

Change two consecutive single quotation marks ('') in each string to (\'), and enclose the string with double quotation marks(").

Example: .DB 'abc"de' -> .DB "abc\'de"

Operand column

Special function register (SFR, 2nd SFR)

Same as left

Specify -dev.

Segment

definition directive

No segment

.CSEG TEXT

 

No CSEG relocation attribute

.CSEG TEXTF

 

CSEG CALLT0

.CSEG CALLT0

 

CSEG FIXED

.CSEG TEXT

 

CSEG BASE

.CSEG TEXT

 

CSEG AT

.CSEG AT

 

CSEG UNIT

.CSEG TEXTF

 

CSEG UNITP

.CSEG TEXTF

Add .ALIGN 2.

CSEG IXRAM

.CSEG TEXTF

 

CSEG OPT_BYTE

.CSEG OPT_BYTE

 

CSEG SECUR_ID

.CSEG SECUR_ID

 

CSEG PAGE64KP

.CSEG TEXTF_UNIT64KP

 

CSEG UNIT64KP

.CSEG TEXTF_UNIT64KP

 

CSEG MIRRORP

.CSEG CONST

 

No DSEG relocation attribute

.DSEG BSSF

 

DSEG SADDR

.DSEG SBSS

 

DSEG SADDRP

.DSEG SBSS

 

DSEG AT

.DSEG BSS_AT

 

DSEG UNIT

.DSEG BSS

 

DSEG UNITP

.DSEG BSS

 

DSEG IHRAM

.DSEG BSS

 

DSEG LRAM

.DSEG BSS

 

DSEG DSPRAM

.DSEG BSS

 

DSEG IXRAM

.DSEG BSS

 

DSEG BASEP

.DSEG BSS

 

DSEG PAGE64KP

.DSEG BSS

 

DSEG UNIT64KP

.DSEG BSS

 

No BSEG relocation attribute

.BSEG SBSS_BIT

 

BSEG UNIT

.BSEG SBSS_BIT

 

BSEG AT

.BSEG BIT_AT

 

ORG

.ORG

 

Symbol definition directive

EQU

.EQU

A relocatable label cannot be written for an operand.

SET

.SET

 

Memory

initialization and area allocation directive

DB

.DB

The code should be changed for size

specifications.

DW

.DB2

The code should be changed for size

specifications. If the operand is a string constant, change it to a string.

Example: DW 'ab' -> .DB "ba"

DG

.DB4

The code should be changed for size

specifications. If the operand is a string constant, change it to a string.

Example: DG 'ab' -> .DB "ba\0\0"

DS

.DS

 

DBIT

.DBIT

 

Linkage directive

PUBLIC

.PUBLIC

 

EXTRN

.EXTERN

 

EXTBIT

.EXTBIT

 

Object module name declaration directive

NAME

Commented out

 

Branch instruction automatic

selection directive

BR

BR !!addr20

 

CALL

CALL !!addr20

 

Assemble end directive

END

Commented out

Invalidate this because the code after END becomes valid.

Assemble product type specification control instruction

$PROCESSOR($PC)

Commented out

Specify -dev.

Debug

information output

control instruction

$DEBUG($DG)

Commented out

Specify -debug.

$NODEBUG($NODG)

Commented out

Specify -debug.

$DEBUGA

Commented out

Specify -debug.

$NODEBUGA

Commented out

Specify -debug.

Cross reference list output

specification

control instruction

$XREF($XR)

Commented out

 

$NOXREF($NOXR)

Commented out

 

$SYMLIST

Commented out

 

$NOSYMLIST

Commented out

 

Include control instruction

$INCLUDE($IC)

$INCLUDE

 

Assemble list control instruction

$EJECT($EJ)

Commented out

 

$LIST($LI)

Commented out

 

$NOLIST($NOLI)

Commented out

 

$GEN

Commented out

 

$NOGEN

Commented out

 

$COND

Commented out

 

$NOCOND

Commented out

 

$TITLE($TT)

Commented out

 

$SUBTITLE($ST)

Commented out

 

$FORMFEED

Commented out

 

$NOFORMFEED

Commented out

 

$WIDTH

Commented out

 

$LENGTH

Commented out

 

$TAB

Commented out

 

Conditional assemble control instruction

$IF(switch name)

Same as left

Specify -define=switch name=1 or

-define=switch name=0.

$IF(switch name : switch name ...)

$IF(switch name | switch name ...)

Specify -define=switch name=1 or

-define=switch name=0.

Another method is to add "switch name .SET 1" or "switch name .SET 0".

$_IF

$IF

 

$ELSEIF(switch name : switch name ...)

$ELSEIF(switch name | switch name ...)

Specify -define=switch name=1 or

-define=switch name=0.

Another method is to add "switch name .SET 1" or "switch name .SET 0".

$_ELSEIF

$ELSEIF

 

$SET

Commented out

 

$RESET

Commented out

 

Kanji code

control instruction

$KANJICODE

Commented out

Specify -character_set.

RAM area

allocation

specification

control instruction

$RAM_ALLOCATE

Commented out

Allocate the target segment using ".CSEG TEXTF_UNIT64KP".

Other control instructions

$TOL_INF

Commented out

 

$DGS

Commented out

 

$DGL

Commented out

 

[Caution]

-

The language specifications of the CA78K0R assembler which are not listed in the above table require the source program to be modified.

-

A relocatable label cannot be written for an operand of the symbol definition directive .EQU.
In this case, replace the reference to the name in the left side of EQU with the relocatable label, and delete the .EQU directive.

Example 1.

DMAINP  DSEG   SADDRP
RABUF1: DS     8
RABUF2: DS     8
OFFSET  EQU    RABUF2 - RABUF1  ; E0551203: Relocatable symbol is not allowed.
FPREAD  EQU    RABUF1.4         ; E0551203: Relocatable symbol is not allowed.
        CSEG
        ADD    A,#OFFSET
        CLR1   FPREAD
        END

 

(Modification method)

OFFSET  EQU    RABUF2 - RABUF1
FPREAD  EQU    RABUF1.4

Disable the above code.

        ADD    A,#OFFSET
        CLR1   FPREAD

Modify the above code to the code below.

        ADD    A,#RABUF2 - RABUF1
        CLR1   RABUF1.4

-

When the address width exceeds 16 bits, error occurs at linkage.
In this case, add a LOWW operator to an address.

Example 2.

DMAINP  DSEG   SADDRP
RABUF1: DS     8
        CSEG
        MOVW   HL,#RABUF1  ; E0562330:Relocation size overflow
        END

 

(Modification method)

        MOVW   HL,#RABUF1

Modify the above code to the code below.

        MOVW   HL,#LOWW RABUF1

-

Operand "(size)" of memory initialization and area allocation directive is different.
Correct according to the following Example 3.

Example 3.

        CSEG
        DW     (3)
        END

 

(Modification method)

        .CSEG
        .DS     6
        .END

CA78K0R Assembler: initialize 6 bytes (3 words) area to 00H.

RL78 Assembler: initialize 2 bytes (1 word) area to 03H.

-

Change operation not allowed by RL78 Assembler to other method.

Example 4.

MSGDATA CSEG   AT 80H
TMSGOK:
        DB     'OK'
        CSEG
        MOV    H,#LOWW TMSGOK/100H   ; E0551215: Illegal label reference.
                                     ; E0550250: Illegal syntax (100H).
        END

 

(Modification method)

        MOV    H,#LOWW TMSGOK/100H

Modify the above code to the code below.

        MOV    H,#HIGH TMSGOK

-

Change Section definition directives "CSEG UNITP" to ".CSEG TEXTF" + ".ALIGN 2".

Example 5.

XMAIN2  CSEG   UNITP
TINTVL: DW     47999
        END

 

(Modification method)

XMAIN2  CSEG   UNITP

Modify the above code to the code below.

XMAIN2  .CSEG   TEXTF
        .ALIGN  2

[Example of use]

-

To enable the function for supporting transition of programs written for ca78k0r, describe as:

>asrl -convert_asm -cpu=S2 -dev=dr5f100pj.dvf main.asm