Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/06/01 05:27
Read: times


 
#13842 - RE: Intel ASM51 and RL51 Help!!!!!!!
Sanjeev:

This means that _DISTANCE must be declared in some other file, and made public with the PUBLIC _DISTANCE declaration.

For example:

FILE1.ASM:

EXTERN _DISTANCE
MOV A,#_DISTANCE

FILE2.ASM

PUBLIC _DISTANCE
_DISTANCE EQU 20h

When you assemble these two files you'll get two OBJ files. You then link the two OBJ files with a linker. The linker reads the OBJ file for FILE1 and realizes that _DISTANCE isn't declared in that object, but the "EXTERN _DISTANCE" tells it that it will be declared somewhere else.

When it gets to FILE2 it finds the value of _DISTANCE is 20h, so now it can go back and fill in the correct value in FILE1.

However, if you don't have FILE2 (or don't assemble it or don't link it) then the linker doesn't know what the correct value is for _DISTANCE. It's an "unresolved external." FILE1 told the linker the symbol would be declared somewhere else, but it never was.

Basically, you need to make sure _DISTANCE is declared in some other object file AND made public with the PUBLIC _DISTANCE directive.

Good luck,
Craig Stiener


List of 11 messages in thread
TopicAuthorDate
Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      
RE: Intel ASM51 and RL51 Help!!!!!!!            01/01/70 00:00      

Back to Subject List