Page 1 of 1

invalid opcode: fmtnum

Posted: 29 Apr 2013, 21:46
by artistjohn
When compiling code containing

Code: Select all

    lin = FormatNum("WriteResult = %d", lResult);
I get a compile error Invalid opcode: fmtnum

So the compiler is translating the FormatNum into a line of NBC (I guess...) using the fmtnum function, but then the assembler is not finding the symbol definition??
Apparently I have messed up the installation of bricxcc or the associated libraries, header files, or something.

Could use a bit of help here, since I'm completely new to this.
I have version 3.3, build 3.3.8.9 of bricxcc, and have downloaded firmware 1.31 to the NXT.

Thanks,
John

Re: invalid opcode: fmtnum

Posted: 30 Apr 2013, 07:28
by HaWe
hey,
what if you type

Code: Select all

FormatNum
into your BCC code editor and press F1?

if there's an error,too: best to reinstall the latest BCC and the lates bugfix on your PC, and the latest EFW on your NXT brick

Re: invalid opcode: fmtnum

Posted: 06 May 2013, 11:18
by afanofosc
This is one of a number of features in NXC which require the enhanced NBC/NXC firmware. You need to have it installed on your NXT and tell the compiler to target the enhanced firmware. This is most easily done if you install the latest test release installer of version 3.3.8.10 which is available at http://bricxcc.sourceforge.net/test_releases/

Make sure you have checked the "enhanced firmware" and "2.0 firmware" and "automatic firmware" options on the NBC/NXC tab on the Compilers page in the Preferences dialog.

John Hansen

Re: invalid opcode: fmtnum

Posted: 29 May 2013, 20:02
by artistjohn
Thanks very much for your help, John. Everything is compiling fine now.

I've enjoyed reading your book on "Power Programming", but haven't read it completely through, yet. As a retired software engineer, I'm looking forward to doing a little "recreational programming".