What does this bsr.l instruction do?

568 views Asked by At

I'm playing with coldfire disassembler and find out this piece of code:

loc_F7E:
    bsr.l loc_F7E+2
    lea 12(sp),sp
    pea (284).w
    clr.l -(sp)
    move.l  a6,d0
    addi.l  #-636,d0
    move.l  d0,-(sp)

loc_F98:
    bsr.l loc_F98+2
    lea $C(sp),sp
    pea (284).w
    clr.l -(sp)
    move.l  a6,d0
    addi.l  #-$398,d0
    move.l  d0,-(sp)

I'm trying to figure out what is the need for those bsr.l. For me it is only jumping itself.

2

There are 2 answers

2
Igor Skochinsky On

I think these might be the result of a compiler optimization for more compact code. See "Short BRA Optimization" in the compiler guide.

Recent IDA versions disassemble such branches as skip2 (there is also skip1) for HC08 and HC12 code. I haven't seen such optimization in ColdFire code before.

EDIT: or it could be just an object file with unresolved relocations.

0
lvd On

According to manual, bsr.l *+2 has hex code $61FF $0000 $0000, so it is most probably result of disasming an object code with unresolved relocations, as Igor Skochinsky has mentioned above.