Skip to main content
Knowledgebase
Home
Renesas Electronics Europe - Knowledgebase

How to make branch destination address as even no. w/ JMP instruction

Latest Updated:12/01/2009

Question:

I would like to know how to make a branch destination address always an even number with JMP instruction or JSR instruction, ets,.

Answer:

By using an assembler directive "".ALIGN"", correct a location counter value in section to multiple number of the boundary alignment. The following are examples of descriptions by the assembler:

                .SECTION A,DATA,ALIGN=2
             DATA1
               .DATA.W H'0001
             DATA2
               .DATA.B H'02
               .ALIGN 2
             DATA3
               .DATA.W H'0003
               .END

As above, next location counter value may become an odd number since acquiring 1 byte data in DATA2. Therefore, the location counter value is corrected to multiple numbers of 2 in .ALIGN 2.

Suitable Products
C/C++ Compiler Package for SuperH Family
C/C++ Compiler Package for H8SX, H8S, H8 Famil