Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 08:55 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : CMM2: V5.05.06RC18 - Improved debugging

Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 01:23pm 13 Nov 2020
Copy link to clipboard 
Print this post

V5.05.06RC18

http://geoffg.net/Downloads/Maximite/CMM2_Beta.zip

This release contains a new capability to help you debug your Basic programs

There is a new directive #MMDEBUG
and  new command MMDEBUG

#MMDEBUG directive.
This has two forms #MMDEBUG ON and #MMDEBUG OFF.
By default #MMDEBUG is off.

These can appear anywhere in the program and are used by the program loader.
If #MMDEBUG is OFF (default condition) then any lines starting with the command MMDEBUG are ignored (effectively treated as comments) and will have absolutely zero impact on program performance - they are simply not loaded into program memory.
If #MMDEBUG is on then lines starting MMDEBUG are included in the program and the MMDEBUG command will be executed as follows

MMDEBUG command
By default the MMDEBUG command acts exactly like the PRINT command so you can use it liberally throughout your program during development and know that by simply setting #MMDEBUG OFF or removing any #MMDEBUG directives, your program will run normally without any impact on performance.

The second form of the MMDEBUG command is
MMDEBUG BREAK

in this case you get a command prompt
DEBUG>
Here you can execute any normal MMBASIC commands as though you were at the normal command prompt allowing you to change any variables, print them, or execute any other user subroutines or built in commands. Of course these should only be things that make sense at the command line (e.g. GOTO would be a BAD idea)
To exit this mode then use the command CONTINUE

MMDEBUG commands not at the start of a line will be included in the program and executed regardless

Hopefully this will make program development a bit easier

Don't even think about asking for single stepping - it won't ever happen



Edited 2020-11-13 23:49 by matherp
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 04:16pm 13 Nov 2020
Copy link to clipboard 
Print this post

Excellent! Thanks, Peter!
-Bill
 
markboston36
Regular Member

Joined: 27/10/2020
Location: United States
Posts: 76
Posted: 04:23pm 13 Nov 2020
Copy link to clipboard 
Print this post

why not single stepping? it would seem to me to be very useful to step through code one line at a time and see where its tripping up.
 
PeteCotton

Guru

Joined: 13/08/2020
Location: Canada
Posts: 543
Posted: 04:41pm 13 Nov 2020
Copy link to clipboard 
Print this post

       
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4311
Posted: 05:23pm 13 Nov 2020
Copy link to clipboard 
Print this post

  markboston36 said  why not single stepping? it would seem to me to be very useful to step through code one line at a time and see where its tripping up.


I doubt Peter was commenting on the desireability of such a feature, only on the feasibility of implementing it ontop of the existing MMBasic / firmware architecture.

That said, the majority of the time when when Peter says he can't / won't do something he generally then proceeds to do it within 24 hours ... However I do not expect that will be the case this time.

Best wishes,

Tom
Edited 2020-11-14 03:26 by thwill
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 05:38pm 13 Nov 2020
Copy link to clipboard 
Print this post

This is yet another great enhancement, Peter...but the CMM2 documentation gap is getting wider with every increment of the RC version number.

Any idea when you will release 5.0.6 and update the docs accordingly?

Or, are there WIP versions of the 5.0.6 documentation available somewhere?

I would really love to have a printed "baseline" MMBasic reference manual in my hands again :)
Edited 2020-11-14 03:39 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
William Leue
Guru

Joined: 03/07/2020
Location: United States
Posts: 405
Posted: 07:09pm 13 Nov 2020
Copy link to clipboard 
Print this post

+1 on the need for an updated manual. I printed the manual that came with 5.05.06RC15. It was titled '5.05.05' but did contain some 5.05.06 features, I think, but not all of them. I have been supplementing the manual by printing out The Back Shed posts, mostly from Peter, and appending them to a growing book of my own.

Yes, I know this is old-fashioned, but I much prefer a printed manual: true, there is no search feature, but I have mine filled with tons of marginal notes, including code snippets, and this makes it worthwhile for me.

-Bill
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:37pm 13 Nov 2020
Copy link to clipboard 
Print this post

I try and keep this up to date. It was done as part of MMEdit but I decided to make it available for all.

It can be hard keeping up with Peter at times but I am trying and now it's there, keeping up (and fixing my stuff-ups) will be easier.
I will have a MMDEBUG page in a couple of hours. Breakfast comes first!

https://www.c-com.com.au/mmhelp/index.htm
It is syntax help only and does not have any tutorials or general information.
It covers all Maximite/Micromites so there are pages that are not relevant to the CMM2.

Jim
VK7JH
MMedit
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 504
Posted: 08:52pm 13 Nov 2020
Copy link to clipboard 
Print this post

Again, an amazing Peter job.

How Peter is being paid for all this work?
Is it only with the CMM2 selling profit?
Can I make a donation?
 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 09:28pm 13 Nov 2020
Copy link to clipboard 
Print this post

  William Leue said  
Yes, I know this is old-fashioned, but I much prefer a printed manual: true, there is no search feature, but I have mine filled with tons of marginal notes, including code snippets, and this makes it worthwhile for me.

-Bill


First off, cognitive research shows that “old fashioned” hard-copy printed material and hand-written notes both reinforce learning and retention. Second, the MMBasic command and function references are in alphabetical order, so think it’s a toss-up how quickly you can flip to the right page versus doing a full text search (and, making notes in the margins about them is invaluable!). Third, while it’s reasonably convenient to bring a help window to the foreground if you’re working on the same platform, with the CMM2 you are obliged to go to a second screen, or do some fussy monitor input switching,, which is annoying and disruptive to mental “flow”. Lastly, printed documentation “just feels right” when you are working in BASIC !

  LeoNicolas said  
How Peter is being paid for all this work?
Is it only with the CMM2 selling profit?
Can I make a donation?


I’ve often wondered about that myself. AFAIK, most of what goes on in the MaxiMite Universe is a non-profit labor of love. I gather many people here use the MM platform to implement custom microcontroller projects for their customers or the companies they work for, and I imagine the handful of MM HW vendors worldwide make a (very) modest profit fabricating the PCBs, kits and fully-assembled units.

Overall, though, I imagine this is what the “Homebrew Computer Club” must have been like in the early 1970s - personal computer hobbyists doing what they love doing and eager to share their knowledge.

  TassyJim said  I try and keep this up to date. It was done as part of MMEdit but I decided to make it available for all.

Jim


Jim, exactly to my point above...and where have you been all my life?! Did I miss this earlier, or did you just make it available now? In any case, this is awesome ! A quick syntax check is often all you need, and it’s nice to see all the non-CMM2 stuff as well - the MaxiMite Universe seems infinite :) Thanks very much for this great additional resource.
Edited 2020-11-14 07:50 by RetroJoe
Enjoy Every Sandwich / Joe P.
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 10:56pm 13 Nov 2020
Copy link to clipboard 
Print this post

  Quote  How Peter is being paid for all this work?

I'm not. I don't want to be. I don't make anything from and sales of anything. Just want the effort to be enjoyed.

Coming tomorrow another performance improvement - a new record





 
RetroJoe

Senior Member

Joined: 06/08/2020
Location: Canada
Posts: 290
Posted: 11:00pm 13 Nov 2020
Copy link to clipboard 
Print this post

  matherp said   I ... just want the effort to be enjoyed.


Peter, I'm just spitballing here, but I think you can cross that item off your bucket list :)
Enjoy Every Sandwich / Joe P.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 11:15pm 13 Nov 2020
Copy link to clipboard 
Print this post

  RetroJoe said  
Jim, exactly to my point above...and where have you been all my life?! Did I miss this earlier, or did you just make it available now?


MMEdit has had syntax help for 9 years so no, it's not new.

The previous system I used was not suitable for the ever increasing range of devices so I changed to HTML.
The change to HTML is what made it feasible to have the files available outside MMEdit.

I work slowly so it has taken a couple of months to get into a usable form.

Jim
VK7JH
MMedit
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 11:25pm 13 Nov 2020
Copy link to clipboard 
Print this post

(RC18)
Strange behaviour with MATH SET:

This one causes a crash. Yes, the manual says the array should be specified as a() but...
dim a(10,10)
math set 0,a(10,10)

This one works in an undocumented manner, but does not crash.
Array elements 5 to 10 are set to the value. Array elements 0 to 4 are untouched.
dim a(10)
math set 3,a()
math set 9,a(5)
for i = 0 to 10
 print a(i),
next


Also, I've been seeing an increased number of cases lately of keys repeating in the editor. This is most annoying when I'm forward deleting some characters on a line and suddenly the first half of the line gets gobbled before I can mash some keys to make it stop. Of, course, I can't figure out what combination of actions makes it happen...
Visit Vegipete's *Mite Library for cool programs.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 11:55pm 13 Nov 2020
Copy link to clipboard 
Print this post

  TassyJim said  https://www.c-com.com.au/mmhelp/index.htm

I didn't know about this. What a great resource, Jim. Thanks very much.

  matherp said  Coming tomorrow another performance improvement - a new record

"534346 lines per second"


Yikes. How amazing is that? How do you keep 'em coming?

Profound thanks for all the improvements to this wonderful microcomputer ecosystem.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
LeoNicolas

Guru

Joined: 07/10/2020
Location: Canada
Posts: 504
Posted: 01:20am 14 Nov 2020
Copy link to clipboard 
Print this post

  matherp said  I'm not. I don't want to be. I don't make anything from and sales of anything. Just want the effort to be enjoyed.


The only thing I can say is you are an amazing person doing an amazing job.

Thank you so much
 
jirsoft

Guru

Joined: 18/09/2020
Location: Czech Republic
Posts: 533
Posted: 12:39pm 14 Nov 2020
Copy link to clipboard 
Print this post

Hi Peter,
really amazing job! Until now no problem in EDITOR and speed is fantastic...
Jiri
Napoleon Commander and SimplEd for CMM2 (GitHub),  CMM2.fun
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 05:42pm 15 Nov 2020
Copy link to clipboard 
Print this post

Awesome! This will be REALLY helpful when writing and debugging code. Can literally just load up a ton of these in your code during development and not have to go nuts removing in them to then test for performance once you get things working.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025