Using AI to Convert MPLab 8.92 Project to MPLabX

Thread Starter

joeyd999

Joined Jun 6, 2011
6,562
Ok, so for years you guys know that I've been bitching that mpasm is not supported under MPLabX, and that I have dozens of years, hundreds of projects, and thousands of libraries under the old MPLab.

So, anyway, I'm sitting at home today on account of rain, and I decided to give my best friend, Grok AI, a wack at converting one of my old projects (about 15K lines of total assembly, spread across 30-40 files, with 17 different build configurations).

Here's my prompt:

Take a look at the current directory. This is an MPLab 8.92 assembly project. I wish to convert it to MPLabX (currently 6.52) pic-as. I've already created a new git branch for this, so feel free to make all changes required. Please modify the project as necessary."

I like asking nicely. I know it doesn't make a difference, but I kinda feel bad when I ask Grok to do something that would take weeks to months, and then still possibly be riddled with bugs.

1.5 hours later, the project built on MPLabX with no errors, all 17 different configurations.

Grok even created all the necessary project files so it loaded up instantly in MPLabX (and I didn't ask it to!).

Unfortunately, since I am home I don't have the hardware handy to try. But I am going to spend a few hours comparing hex files to identify any differences (if they exist) and why -- and have Grok make any corrections necessary.

AI freakin' rules.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,562
Absolutely rocks for doing that sort of thing.
And for writing complete applications, in languages I don't even know or understand.

Last week I had it write a graphical Gnome data acquisition and analysis app in Vala to replace the old DOS app I wrote in 1994 (C++) and have been using under DOSBox since. It even wrote and integrated a BLE connector for me to capture realtime data via Bluetooth, something my old code couldn't do at all.

It feels like a mind reader: I give it a short prompt, and get back an entire code base that does exactly what I want in minutes! Even the GUI looks far more professional than I'd ever care to write myself. I'm talking professional, for fee, code writing.
 
Last edited:

Thread Starter

joeyd999

Joined Jun 6, 2011
6,562
Here's an early version of the Vala app I mentioned above -- entirely written by Grok. Sorry, I had to redact some of the text.

Main.png

Charts.png
 

cmartinez

Joined Jan 17, 2007
8,897
One of my assembly projects for a PIC16 MCU is doing weird things related to timekeeping interrupts. I'm going to ask Grok see if it can help me find the bug. Thanks for sharing your experience with us.
 

cmartinez

Joined Jan 17, 2007
8,897
And by the way. I think it's good that you're keeping things civil with Grok. Most of us are going to have to interact with AI quite often. And, out of habit, the manners with which we treat it will most likely spill to the way we treat our fellow humans too.

Asking nicely is always important.
 

Thread Starter

joeyd999

Joined Jun 6, 2011
6,562
Sadly, it's only a partial solution to my MPLabX problem.

Yes, it creates a project that builds under MPLabX (pic-as), and even produces the exact byte sequence as MPLab (mpasm).

Unfortunately, there is no way to easily make the project work well in the debugger. Labels and addresses are not recognized as variables, so unless the entire project is restructured the pic-as way, it's not useful for continued development.

It'll be useful for maintenance, though, and give me an opportunity to upgrade some older projects to newer, cheaper silicon.
 
Top