Can instruction "BRN" be decoded by CW 6.1?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can instruction "BRN" be decoded by CW 6.1?

1,721 Views
DanielTan
Contributor I
I have a asm file using HCS08 instructions( just test it) like below:
_Startup:
            LDHX   #RAMEnd+1        ; initialize the stack pointer
            TXS
            CLI                                    ; enable interrupts
            BRN    _Startup
In memory window of debugger:
0100: 45 02 80 94 9A 21 F9
 
But in assembly window of debugger:
            LDHX #0x0280
            TXS
            CLI
            SKIP
            ADC  ,X
It seems like the "BRN" (opcode is 21) can't be decoded correctly by CW6.1.
What's wrong with it?


Message Edited by Daniel Tan on 2008-11-04 05:20 AM
Labels (1)
0 Kudos
2 Replies

305 Views
DanielTan
Contributor I
Hi, compilerGuru,
The code is only a test code to indentify the BRN decoder issue, there's no function of it.
When I use another debugger like P&E HCS08 Development Kit, this code may be decoded correctly.
0 Kudos

305 Views
CompilerGuru
NXP Employee
NXP Employee
Did you really intend to code a branch never to _Startup?

>BRN    _Startup

In case you want to unconditionally branch to _Startup, use a BRA, branch always

>BRA _Startup

The SKIP opcode is a pseudo instruction used by the compiler in order to use the unused 1 byte branch offset in optimizations.

Daniel
0 Kudos