News:

Let's find out together what makes a PIC Tick!

Main Menu

Help with diagnosing ASM ERROR 113

Started by tomatobro, Apr 16, 2022, 03:28 PM

Previous topic - Next topic

tomatobro

I have used a copy of proton plus that uses the dongle for many years and because the dongle is starting to be a bit iffy I purchased this updated version via Les.
I have a program from the old version which controls a observatory dome and have copied the .Bas file into the new proton version. I had to make a few changes to get it to (try to) compile ok but am stuck with trying to figure out this error message

ASM ERROR:Error[113] c:\PROGRAM FILES (X86)\PROTONIDE\PICBASIC_PROGRAMS\A.S 1173: Symbol not previously defined (RSIN)

A typical line of code is  RsIn Dec Domerate
The program compiles and runs fine on the old version of Proton Plus. I have tried both copy and paste the .Bas file and have retyped it in from scratch and no joy

I also typed in a simple test program using the syntax and it compiles ok even though I am using exactly the same syntax as used in the copy and pasted listing.

Any help most appreciated

RGV250

Without the whole code it would be pretty difficult to answer here.

Regards,
Bob

tomatobro

I have just spotted that this post is in Forum rules so if the moderators could move it that would be great
 
sample of code attached

 Device=16F877A 
        Xtal=4
       

       
       

        Declare RSOut_Mode inverted
      Declare RSIn_Mode  inverted
       
        Declare RSOut_Pin PORTC.7
        Declare RSIn_Pin PORTC.6
      Declare Serial_Baud 9600
        Declare RSIn_Timeout = 2000 


        sidset:
 domecount = 15
 domeloop:
 RsOut 027,99
 domeloopx:
 RsOut "                     ",011,013
 RsOut "Enter value for Sidreal rotation",011,013
 RsOut "Value must be between 1 and 20",011,013
 RsIn Dec yyy
 
 If yyy<1 Then RsOut "number entered is too small",011,013 :GoTo domeloopx
 If yyy>20 Then RsOut "number enetered is too large",011,013 :GoTo domeloopx
 RsOut "the sidreal number is  ", Dec yyy,011,013
 RsOut "y/n?",011,013
 y=RsIn
 If y = "n" Then GoTo domeloop
 domecount=yyy
 RsOut "sidreal value = ",Dec domecount,011
 
 
 loopk:
 RsOut "Enter value for Dome rotation time interval",011,013
 RsIn Dec domerate
 If domerate<1 Then RsOut "Number entered is too small", 011,013: GoTo loopk
 If domerate>400 Then RsOut "Number entered is too large",011,013:GoTo loopk
 RsOut "Dome rate rotation time interval is   ",Dec domerate, 011,013
 RsOut "y/n?", 011,013
 y=RsIn
 If y = "n" Then GoTo loopk
 
 
 
 DelayMS 1000                                                                                                               
 

RGV250

#3
Hi,
First off there are a loot of variables not declared, I has a guess and added
Dim domecount As Word
Dim yyy As Word
Dim y As Word
Dim domerate As Word

Then this RsIn Dec yyy should be yyy = RsIn

Looks like y should be a string.

Bob

tomatobro

Only some of the code was included
Looking at the assembler it makes reference to RSIN (in capitals) which matches the error output but typing in RSIN auto changes to RsIn

According to the online manual the syntax looks to be correct. Also I have created a small test program which compiles and runs ok. see below

'pins used
'pin 1 = MCLR
'pin 2 = RA0 
'pin 3 = RA1  switch1
'pin 4 = RA2
'pin 5 = RA3
'pin 6 = RA4
'pin 7 = RA5 
'pin 8 = VSS (ground)
'pin 9 = OSC1
'pin 10 = OSC2
'pin 11 = RC0
'pin 12 = RC1
'pin 13 = RC2 
'pin 14 = RC3 
'pin 15 = RC4 
'pin 16 = RC5
'pin 17 = RC6  RSIN 
'pin 18 = RC7  RSOUT
'pin 19 = VSS (ground)
'pin 20 = VDD (5 volt)
'pin 21 = RB0
'pin 22 = RB1 
'pin 23 = RB2 
'pin 24 = RB3
'pin 25 = RB4  potone
'pin 26 = RB5  redledthree
'pin 27 = RB6  redledtwo
'pin 28 = RB7  redledone






'****************************************************************

Device=16F876
        Xtal=4
        All_Digital=1

        REMARKS = off
       
       ' Declare RSOUT_MODE true
      Declare RSIn_Mode inverted
        Declare RSOut_Mode inverted
       
        Declare RSOut_Pin PORTC.6
        Declare RSIn_Pin PORTC.7
      Declare Serial_Baud 9600
        Declare RSIn_Timeout = 5000
'Symbols used
          
     Symbol redledone= PORTB.7
     Symbol redledtwo = PORTB.6
     Symbol redledthree = PORTB.5
     Symbol switch1 = PORTA.0
     Symbol potone = PORTB.4
     

      Dim trev As Byte
      Dim x As Word
      Dim y As Word
      Dim z As Word
 '========================== start of main program =====================
 
 loopa:
 For x= 1 To 5
 DelayMS 500
 Low redledone
 DelayMS 400
 High redledone
 DelayMS 400
 RsOut "Steves Pic Development Board",011,013
 DelayMS 1000
 Input switch1
 If switch1 = 1 Then RsOut "switch on",011,013
 If switch1 = 0 Then RsOut "switch off",011,013
 High potone
 DelayMS 100
 y=RCIn potone,High
 RsOut Dec y,011,013
 Next x
 RsOut 027,99,011,013
 
 RsOut "enter a number",011,013
 RsIn {continuex},Dec  trev
 RsOut Dec trev
 
 continuex:
 GoTo loopa
 
 

End
 
 
 

tomatobro

I have also just spotted that its reporting (in addition to the 113 error) a compilation error
Ln 281:col 89

line 281 is the ,============================================================== just after the GoTo manloop. Col 89 is after the last =
Its commented out so the compiler should not be doing anything with it.

 domel:
  If notext = 0 Then RsOut "moving dome left",011,013
  notext = 1
  High domemotor
  High domeslow
  GoTo manloop
'=======================================================================================
'------------------ auto control of dome -------------------- 
 sidset:
 domecount = 15
 domeloop:
 RsOut 027,99

tomatobro

Its not reporting its an error just where the cursor is. Sorry about that. I put a rubbish line of code in and it found it ok

tumbleweed

#7
It seems to depend which family you compile for. I found that when compiling for a base 16F device (device=16F877A), it does not like the syntax:

RsIn Dec yyy

However, it will accept
RsIn {continuex},Dec yyy

As a simple check, if you change the device to 'device=16F18323' or 'device=18F25K20' it compiles ok using either syntax.

test code:
Device=16F877A           ' fails to compile ... ASM ERROR symbol not previously defined
'device=16F18323         ' compiles ok
'device=18F25K20         ' compiles ok
Xtal=4
       
Declare RSOut_Mode inverted
Declare RSIn_Mode  inverted
       
Declare RSOut_Pin PORTC.7
Declare RSIn_Pin PORTC.6
Declare Serial_Baud 9600
Declare RSIn_Timeout = 2000

Dim y As Byte

y = 0
RsOut "  ",011,013

' check three different forms of RSIN
' this one will fail with 16F877a
RsIn Dec y

RsIn {continuex},Dec y
continuex:

y=RsIn


top204

#8
I was just preparing the latest update when I saw this thread, so "in the nick of time". :-)

I'll get into the compiler this afternoon and find out why it produces the error only with standard 14-bit core devices. It works as it should with enhanced 14-bit core and 18F devices, so it is a puzzler (for now) because they all share the same Rsin parser function. With a complex mechanism such as a compiler for multiple devices, it always amazes me that something in a function far removed can effect something else that should have no reference to it. You would think after 20 years of creating and maintaining the compiler, I would have gotten used to that scenario, but it still puzzles me sometimes. So once an anomaly has been corrected, I always go through the code to satisfy myself as to why it happened in the first place, and sometimes, it is a fault of the C++ compiler and not a fault of mine. :-)

top204

#9
The RSin anomaly with standard 14-bit core devices, is now corrected and the free "corrections update" is available from here:

Positron Corrections Update 4.0.1.7 - 1.1.0.8

tomatobro

Thanks to all for correcting this. It compiles my observatory software without errors.