PDA

View Full Version : Warning 202 Argument out of range. Least significant bits used



mikebar
- 18th November 2020, 20:09
Hi to everyone.
After compiling my 6200 PBP lines long program, all goes fine, but also I've the following:
Warning[202] C:\<myProgramPath>\Program.mac 2246 : Argument out of range. Least significant bits used.
The line 2246 of the Program.mac file is like that:


2245 HSEROUT?C macro Cin
2246 movlw Cin
2247 L?CALL HSEROUT
2248 endm
2249 HSEROUT_USED = 1

I'm using a PIC18F87J50 at 16MHz and used the great Mister-E PicMulticalc to set the serial ports. HSER1 to 115200 bps and HSER2 to 9600 bps, PicBasic Pro2.60c
I cannot yet test the program, because I'm waiting the board where the chip is used.
Anyone knows why this warning and what could cause if ignored?

Thanks in advance for an answer.

richard
- 19th November 2020, 00:44
the problem is not the macro, you are attempting to hserout a constant that is too big for it to swallow.
somewhere in those 6200 lines of code is an attempt to hserout an constant type item who's value exceeds a single byte in size

ChuckR
- 11th March 2021, 22:23
I recently encountered this same error message, and was confused as my code was executing properly. I was able to trace it through searching the *.LST file for "WARNING", and found it in a LOOKUP command. My byte length "index" ranged only 1 - 12, and my "variable" was defined as VAR WORD. But 3 of my constant values exceeded 255. Oops! All it took was changing to the LOOKUP2 command in order to handle word length constants. My code was executing properly because my index value was not reaching any of the word length constants. It would eventually have crashed.