When I compile my firmware with the CYASM  I get the following message:  Error 'Jumps can not cross 4K boundary...' Why?

Question: When I compile my firmware with the CYASM, I get the following message:  Error "Jumps can not cross 4K boundary..." Why?

 

Answer:

You get this message because you're attempting to go across the 4K boundary with a jmp instruction. The 8K ROM is "divided" into two 4K blocks, upper and lower 4Ks.

The Index, CALL and JMP instructions are limited to 12 bit addresses and cannot transcend the 4K block limit. The CALL allows access from the lower 4K block to anywhere in the upper 4K. It does not allow access from the upper 4K to the lower 4K. After a CALL to the upper 4K, access to the lower 4K is restored by RET or RETI instructions. Therefore, Interrupt Service Routine should be located in the lower 4K block for utilizing the upper 4K.

For more details, please refer to the attached CYASM User's Guide.