Log in

View Full Version : Error [113]



MikeBZH
- 25th April 2013, 10:04
Hi,

I cannot understand the reason for an Error [113] message.
I am using a PIC18F2685 with PBPL.


DataTP CON EXT ; Tables P
DataTC CON EXT ; Tables C
DataTB CON EXT ; Tables B

DataTS VAR LONG BANK0

...

DataTP ;
#include "KPPV3.ASM"
EndTP

DataTC ;
#include "KPCV3.ASM"
EndTC

DataTB ;
#include "KPBV3.ASM"
EndTB

...

DataTS = DataTC

...

movlw LOW DataTS ; Computing DataTS+AdTS
addwf _AdTS,W ; and storing to Ads(AdsU:AdsH:AdsL)
movwf _ADSL
movlw HIGH DataTS
addwfc _AdTS+1,W
movwf _ADSH
movlw UPPER DataTS
addwfc _ZERO,W
movwf _ADSU


I use three external tables.
I want to select one table and make some operations with it

I think that the declarations are correct but three Error [113] message are generated, one per line of the asm section where DataTS is used. These errors are related to DataTS which is seen as not being declared.

If I replace DataTS by DataTC (for example) in the asm section, no errors occur.

What's wrong ?

Thank you for your help

MikeBZH

Demon
- 25th April 2013, 12:45
ASM
...assembler code
ENDASM

Look up proper syntax in manual.

Robert

Edit: EndTP, is that a new command in PBP3?

MikeBZH
- 25th April 2013, 21:49
I found the solution.

Writing :

movlw LOW DataTS

is a non-sense since DataTS is a variable, not a constant
and movlw stands for "move litteral to w"

other mov instructions are certainly more appropriate. I need to search.

Demon, all this syntax comes from Darrel examples. It works !

MikeBZH

Demon
- 26th April 2013, 01:31
I don't doubt it works, but are you compiling in PVP or ASM?

MikeBZH
- 27th April 2013, 07:24
Hi Demon

I assume you mean PBP, not PVP.
The code is written in PBP with some sections in ASM.

You're right. The block :

DataTP ;
#include "KPPV3.ASM"
EndTP

DataTC ;
#include "KPCV3.ASM"
EndTC

DataTB ;
#include "KPBV3.ASM"
EndTB

is inside an ASM / ENDASM section

MikeBZH

Demon
- 27th April 2013, 10:55
PBP, Darn small keypad on cell phone.

MikeBZH
- 28th April 2013, 13:15
To complete this topic and for anybody interested by the solution :

DataTS is first splitted into three bytes :

DataTSL = DataTS.BYTE0
DataTSH = DataTS.BYTE1
DataTSU = DataTS.BYTE2

then the program is the same as before but movlw are replaced by movf

movf _DataTSL,W
addwf _AdTS,W
movwf _ADSL
movf _DataTSH,W
addwfc _AdTS+1,W
movwf _ADSH
movf _DataTSU,W
addwfc _ZERO,W
movwf _ADSU

No more error. It works.

MikeBZH