After my eventual success in converting a 'C' program into a similar GCBasic program I'm left with another challenge.
We have many programs for which we don't have the source code. We have the .hex files for some, I seem to remember that there was a disassembler available for PIC code, though can't remember where I saw such a thing. Has anyone had any success with such a tool?
Much of the source code has been written in Assembly. My knowledge of Assembly is less than nil, and definitely not 255. Trying to comprehend what is happening is way beyond me. Does anyone know of a tool that is capable of generating something close to a "Flow Chart" from an Assembly program which could hopefully give me some inkling of the structure of the program?
My option otherwise is to guess at what is happening in the program by measuring the output/input pins during operation. Not very efficient and very time consuming. I have managed to replace certain chips in this way but that was for a single device. Many of the chips and programs I'm hoping to replace have dependencies on other devices, for which I equally don't have code, schematics or notes for!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've never, not once, ever had any success with MpLabX. I've struggled with it every time I have gone near it. It stopped me from working with PICs totally until I discovered there was another way.
Real PIC simulator I might look into. Although that won't give me much of a 'feel' for the program that I was hoping for. It is difficult to visualise For...Next loops and such like from the original assembler, even less so from the .hex.
I guess it will be out with the multimeter, oscilloscope and pen. Decode the hardware and then write the software to replicate.
Or do as a colleague suggested and ask ChatGPT...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I will genuinely be 10,000% quicker using a multimeter and 'scope. I find MPLabX impossible to understand, even with the video guidance. I think I'd quit if I was forced to use it.
I was hoping that by having a BASIC listing or a 'Flowchart' from the .asm I might be able to pick up on the lessons that the previous (assembly) programmer had learned, rather than me having to learn them all one by one again.
Mind you, the whole thing needs a redesign which in the long term would no doubt be the correct way to go. With any luck I'll have moved on before that becomes required!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After my eventual success in converting a 'C' program into a similar GCBasic program I'm left with another challenge.
We have many programs for which we don't have the source code. We have the .hex files for some, I seem to remember that there was a disassembler available for PIC code, though can't remember where I saw such a thing. Has anyone had any success with such a tool?
Much of the source code has been written in Assembly. My knowledge of Assembly is less than nil, and definitely not 255. Trying to comprehend what is happening is way beyond me. Does anyone know of a tool that is capable of generating something close to a "Flow Chart" from an Assembly program which could hopefully give me some inkling of the structure of the program?
My option otherwise is to guess at what is happening in the program by measuring the output/input pins during operation. Not very efficient and very time consuming. I have managed to replace certain chips in this way but that was for a single device. Many of the chips and programs I'm hoping to replace have dependencies on other devices, for which I equally don't have code, schematics or notes for!
As weird as this sounds.
The best disassembler....Mplab-X. Creat a project and load the hex. Then, select disassemble.
The advantage is you see all the ports changing and RAM updates.
Another way, Real PIC Simulator. Does the same but limited chips are supported.
Sorry I have been so long in replying.
I've never, not once, ever had any success with MpLabX. I've struggled with it every time I have gone near it. It stopped me from working with PICs totally until I discovered there was another way.
Real PIC simulator I might look into. Although that won't give me much of a 'feel' for the program that I was hoping for. It is difficult to visualise For...Next loops and such like from the original assembler, even less so from the .hex.
I guess it will be out with the multimeter, oscilloscope and pen. Decode the hardware and then write the software to replicate.
Or do as a colleague suggested and ask ChatGPT...
I would try MPLAB-X debugger, with a PICKIT you can walk the ASM ( which is fully documented) in the MPLAB Debugger.
Create your program in GCBASIC and walk in MPLAB. it is easy. I have posted a few YouTube videos on how to do this.
I will genuinely be 10,000% quicker using a multimeter and 'scope. I find MPLabX impossible to understand, even with the video guidance. I think I'd quit if I was forced to use it.
I was hoping that by having a BASIC listing or a 'Flowchart' from the .asm I might be able to pick up on the lessons that the previous (assembly) programmer had learned, rather than me having to learn them all one by one again.
Mind you, the whole thing needs a redesign which in the long term would no doubt be the correct way to go. With any luck I'll have moved on before that becomes required!
I think this is potential doable.
I have been in contact with the a developer who may be able to adapt a flow charting solution for IAR/MSP430 to Microchip ASM.
Could work. Interested ?
Last edit: Anobium 2024-08-15