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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/23/07 01:16
Read: times


 
#139636 - Pinnacle 52 project / module problem
Hello,

I am having some difficulties using Pinnacle 52 projects and modules. I have attached two simple files which illustrate my problem (at bottom).

I am using Pinnacle 52 1.130 on Windows XP professional.

As you can see I have two source files in my project called FILE1.ASM (Main program) and FILE2.ASM (Library containing two modules, SUBB1(Containing two subroutines ROUTINE and PRIVATE) and SUBB2(Containing one subroutine PRIVATE). As you can see in the main program I have declared ROUTINE and PRIVATE as EXTERNAL and within SUBB1 I have declared ROUTINE as PUBLIC and within SUBB2 I have declared PRIVATE as PUBLIC.

As you can see the SUBB1 module contains a subroutine called PRIVATE but as this module does not declare PRIVATE as a PUBLIC symbol it should not be “visible” to other modules? But this does not seem to be the case. As you can see from the Code Window (Disassembly) the supposedly “invisible” PRIVATE subroutine within the SUBB1 module is being confused with the intended PUBLIC subroutine PRIVATE within the SUBB2 module.

Also notice that at Addr 003F the program is trying to call a subroutine at 0048 which does not contain any Opcode but is where the PUBLIC subroutine PRIVATE should be?

Another worry for me is that removing the two lines within FILE2 declaring ROUTINE and PRIVATE as PUBLIC does not induce any errors and has no effect on the code produced? According to the Pinnacle Help this should not be possible?

Can anyone confirm if what I have done is correct? Am I using the wrong syntax somewhere? If anyone running Pinnacle 52 tries to build these files do they get the same results? I am convinced that I must be doing something obvious wrong but I have been through all the help files etc. and can not see anything? Could anyone who uses Pinnacle provide a working example illustrating the correct use of modules?

Any help would be greatly appreciated,

Best regards,

EI.

;*******************FILE1.ASM****************
PROGRAM MAIN

EXTERN ROUTINE,PRIVATE
ORG 0000
LJMP START

RSEG CODE
START:
MOV A,#1
LCALL ROUTINE
LCALL PRIVATE
LJMP START
END

;******************FILE2.ASM*******************
LIBRARY SUBB1
PUBLIC ROUTINE
RSEG SUBB1
ROUTINE:
MOV A,#2
LCALL PRIVATE
RET
PRIVATE:
MOV A,#3
CPL P1.0
RET

LIBRARY SUBB2
PUBLIC PRIVATE
RSEG SUBB2
PRIVATE:
MOV A,#4
CPL P2.0
RET



;**************Disassembly***************
Addr Opcodes Label Disassembly

0031 00 NOP
0032 74 01 START MOV A,#01h
0034 12 00 3D LCALL ROUTINE
0037 12 00 43 LCALL PRIVATE
003A 02 00 32 LJMP START
003D 74 02 ROUTINE MOV A,#02h
003F 12 00 48 LCALL 0048
0042 22 RET
0043 74 03 PRIVATE MOV A,#03h
0045 B2 90 CPL P1.0
0047 22 RET
0048 00 NOP
...


List of 13 messages in thread
TopicAuthorDate
Pinnacle 52 project / module problem            01/01/70 00:00      
   Known problem            01/01/70 00:00      
   Look here for support            01/01/70 00:00      
      Craig Steiners input?            01/01/70 00:00      
      What was the conclusion Jon?            01/01/70 00:00      
         I dug through some old emails            01/01/70 00:00      
            Thanks for the info Jon            01/01/70 00:00      
         Metalink            01/01/70 00:00      
            Metalink does not support modules            01/01/70 00:00      
               Original Intel Assembler            01/01/70 00:00      
                  relocatable modules            01/01/70 00:00      
                  Found it!            01/01/70 00:00      
   Craig?            01/01/70 00:00      

Back to Subject List