LOCATING SUBROUTINES IN MEMORY

I am trying to put a subroutine at a fixed address (I want it to remain fixed after the code is rebuilt and other modules are changed).

First I linked my code and obtained its absolute linked address (assigned by the linker). Then I used the _at_ (0x07A) command in the C source file.
I got a FIXUP error when I linked.
When I did the same thing using the linker SE command, I didn't get any errors. I really wanted to cast the addresses in the source
C code file using the _at_ command but I am having problems.... Any thoughts...



Thanks, Jim

Parents
  • One thing that can cause this is using the wrong jump or call. In 251 you have three choices in assembler - a short (sjmp), standard (ljmp, lcall) or extended (ejmp, ecall). When you relocated the subroutine, you may have put it beyond the callers ability to address it. With the 251, memory usage is less of a problem, so we typically use ejmp or ecall for anything that is not within the same routine.

Reply
  • One thing that can cause this is using the wrong jump or call. In 251 you have three choices in assembler - a short (sjmp), standard (ljmp, lcall) or extended (ejmp, ecall). When you relocated the subroutine, you may have put it beyond the callers ability to address it. With the 251, memory usage is less of a problem, so we typically use ejmp or ecall for anything that is not within the same routine.

Children
More questions in this forum