Skip to main content
Knowledgebase
Home
Renesas Singapore - Knowledgebase

Please tell me how to set the option function register in detail.

Latest Updated:03/13/2009

Question:

Please tell me how to set the option function register in detail.

Answer:

There are three methods for setting the option function select register using the C complier package M3T-NC30WA:

  1. Using the load module converter (lmc30 -R8C) -OFSREGX (or -PROTECTX) option
  2. Using assembler directive command .OFSREG (or .PROTECT)
  3. By assembly programming

The load module converter option and directive command depend on the assembler version. For more details, refer to the "M3T-NC30WA Assembler User's Manual".

A. Using the load module converter (lmc30 -R8C) -OFSREGX (or -PROTECTX) option

Example: Using -OFSREGX (or -PROTECTX) option, specify the value (0FEh) of the option function register.

lmc30 -R8C -OFSREGX FE

B. Using the assembler directive command called extended function directive command .OFSREG (or .PROTECT)

Example: Using extended function directive command .OFSREG (or .PROTECT), specify the value (0FEh) of the option function register.

.org 0FFFCh

RESET:

.lword start

.OFSREG 0FEh

C. By assembly programming

The following two examples show how to set 0FEh in the option function select register in the program.

  1. Example of using address control directive command .LWORD and logical ORs
    .org 0FFFCh
    
    RESET:
    
    .lword start | 0FE000000h
    
  2. Example of using address control directive command .ADDR
    .org 0FFFCh
    
    RESET:
    
    .addr start
    
    .byte 0FEh
    
Suitable Products
R8C/18
R8C/19
R8C/1A
R8C/1B
R8C/20
R8C/21
R8C/22
R8C/23
R8C/24
R8C/25
R8C/26
R8C/27
R8C/28
R8C/29
R8C/2A
R8C/2B
R8C/2C
R8C/2D
R8C/2E
R8C/2F
R8C/2G
R8C/2H
R8C/2J
R8C/2K
R8C/2L
R8C/32C
R8C/33C
R8C/34C
R8C/35C
R8C/36C
R8C/38C
R8C/3GC
R8C/3JC
R8C/32D
R8C/33D
R8C/35D
R8C/3GD
R8C/33T
R8C/38A
R8C/34E, R8C/34F, R8C/34G, R8C/34H
R8C/36E, R8C/36F, R8C/36G, R8C/36H
R8C/38E, R8C/38F, R8C/38G, R8C/38H
R8C/L35C
R8C/L36C
R8C/L38C
R8C/L3AC