Yes, there certainly is a way to have GCBASIC preserve the original code as comments in the assembly. To keep all code, use /K:A when calling the compiler. To keep just the BASIC comments, use /K:C.
Alternatively, if you have a gcbasic.ini file in the same folder as gcbasic.exe, you can add a line under the [gcbasic] section to control what is kept. Add
Preserve = a
or
Preserve = c
to keep all original lines, or to keep comments only in the assembly. I use that for debugging a lot myself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Below are the updates from Hugh. I can pull the ASM into MPASM X and see the code lines as comments, step and run the code. Next will maybe attempt PicKit2 as a emulator. Probably need to make a cable for that.
This is my command line and my batch file that I use to make my .asm and .hex files and it works like a champ. Using gputils.
HOWEVER, sometimes I would like to attempt to load the .ASM in mpasm and step through looking for problems.
Anyone have a batch file for this or changes I can make. The below is for the gputils.
Thanks
Last edit: lhatch 2014-01-31
Nobody? Maybe it is a GCB switch, I will check there.
It's definitely possible to load the ASM from GCBASIC into MPASM. I think that your m.bat should be like this:
Try that and see!
Hugh,
It ran perfect with no errors.
Then I loaded MPASM X (bloatware for sure), made a new project, pasted the .ASM in a new file and it worked great.
Thanks for the help. Sure this will help when I get a program that does not want to do what I want. Rare but does happen.
Is there any way to have GCBASIC throw comment lines with the actual GCBASIC source code. That would help even more with debugging.
Yes, there certainly is a way to have GCBASIC preserve the original code as comments in the assembly. To keep all code, use /K:A when calling the compiler. To keep just the BASIC comments, use /K:C.
Alternatively, if you have a gcbasic.ini file in the same folder as gcbasic.exe, you can add a line under the [gcbasic] section to control what is kept. Add
Preserve = a
or
Preserve = c
to keep all original lines, or to keep comments only in the assembly. I use that for debugging a lot myself.
Frank,
If you are out there, how do I add this /K:A option Hugh mentions to the batch files in your GCB@SYN.
Below are the updates from Hugh. I can pull the ASM into MPASM X and see the code lines as comments, step and run the code. Next will maybe attempt PicKit2 as a emulator. Probably need to make a cable for that.
New c.bat (c filename to compile the .BAS file)
GCBASIC /NC /K:C %1.bas /O:%1.asm /A:m.bat
and m.bat is the one Hugh posted.