Goto Label xxx in other file...

Dear all,
I have a question about jumping to some specific label in other file(in Keil C51 project)

Ex. In file A there is one label named _xxx. In file B can we use

goto _xxx

?
(maybe _xxx should be declared as extern, right ?)

The reason why I want this is: We did NOT want to do the tasks before label _xxx because they are wrong...! And unfornately file A is located in ROM and we can not modify it...

So we want to just jump to label _xxx and skip wrong codes....

Parents
  • More detailed information is:

    File A located in ROM

    ...   // wrong code here
    _xxx  // label
    ...   // OK code
    

    File B in RAM

    ccc   // corrected code here
    goto _xxx   // this can skip wrong code in File A
    

    Thus the calling sequence will be:
    - execute corrected code in File B
    - jump to ROM code labeled _xxx
    - execute OK code in File A

    Note: We still want to execute the remaining codes after label _xxx in ROM !!!

Reply
  • More detailed information is:

    File A located in ROM

    ...   // wrong code here
    _xxx  // label
    ...   // OK code
    

    File B in RAM

    ccc   // corrected code here
    goto _xxx   // this can skip wrong code in File A
    

    Thus the calling sequence will be:
    - execute corrected code in File B
    - jump to ROM code labeled _xxx
    - execute OK code in File A

    Note: We still want to execute the remaining codes after label _xxx in ROM !!!

Children
More questions in this forum