So I tried compiling this code below but keep getting the 1176E error message of
Branch offset out of range 0xFFFFFFE8 out of range permitted values are up to 0x00007E
on the 5th code line. I read the error description on ARM site but can't make since of it. I think it my be something to do with the fact that this code is in a sub procedure maybe? Anyways it looks like using
rout can help, but I am not sure how to implement that instruction in the code below and what pushes the PC out of range in the first place?
Can anyone shed light on how to use
rout in this case to subvert the error?
powerCount PROC MOV r4 , r1 // get a copy of test value MOV r9, #10 // make a divisor MOV r3, #0 // initialize a counter loop3 CBZ r4, check // check loop condition ADD r3, r3, #1 // record the number of di SDIV r4, r9 // divide the value toward B loop3 ENDP