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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/16/05 18:22
Read: times


 
#99523 - Pinnacle 52
I'm having a little difficulty understanding how the linker handles segments and libraries. I'm using the following.

Linker segment definitions
Code: CODE=0040h,CSEG,LIBCODE

Main program: TEST.ASM
EXTERN SUB1
EXTERN SUB1

CSEG CODE
     MOV     R1,#45H
     MOV     R2,#54H
     LCALL   SUB1
     LCALL   SUB2
END

Library program: LIB1.ASM
LIBRARY SUB_1
PUBLIC SUB1
RSEG LIBCODE
;
SUB1:....
...
...
     RET

Library program: LIB2.ASM
LIBRARY SUB_2
PUBLIC SUB2
REG LIBCODE
;
SUB2: ...
...
...
     RET

When I assemble this, the main program assembles at 40h like anticipated, SUB1 and SUB2 assemble just after the last instruction in the main program, but SUB1's label is overwritten by SUB2's label and SUB2 has no label.
I've been over the help files several times and don't understand what is happening. Also is there a way to combine two or more subroutines (modules) in one library file and pull only one routine from the library? I tried to do it, but it pulls everything from the library whether it's referenced or not.
I'm using WinXP Pro., I know the program is not completely compatible with XP yet, so is this related to that?

Thanks in advance
Jon

List of 4 messages in thread
TopicAuthorDate
Pinnacle 52            01/01/70 00:00      
   Support            01/01/70 00:00      
   Who uses Pinnacle 52?            01/01/70 00:00      
      I do            01/01/70 00:00      

Back to Subject List