Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 09:10 29 Mar 2024 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 : Micromite MMBasic Ver 5.05.02 Beta

     Page 2 of 4    
Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:28am 21 Dec 2018
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I'd like to run basically the same code (without i/o, of course) on mmbasic DOS.


lizby: It would be very easy for you to add my longstring commands to your own version of MMBasic for DOS. Download Geoff's source and get yourself set up to compile/link it. Then download the MMX source. Once you have got this working I can provide very simple instructions as to how to copy/paste them across - no coding needed.


I've downloaded the source and successfully compiled; sent a PM if you are able to get to it at this busy season.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 08:47am 21 Dec 2018
Copy link to clipboard 
Print this post

  Quote  I've downloaded the source and successfully compiled


Substitute these two files and you should be up and running

2018-12-21_184724_DOS_Misc.zip
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 03:47pm 21 Dec 2018
Copy link to clipboard 
Print this post

  matherp said  
  Quote  I've downloaded the source and successfully compiled


Substitute these two files and you should be up and running

Done. Compiled in 13 seconds. Here's the output of a test program, with listing of the program.


[code]
dim as integer buff(4000), b2(4000),i,j,k
open "s_quotes.txt" for input as #10
do while not eof(#10)
line input #10,A$
LONGSTRING APPEND buff(), A$+chr$(13)+chr$(10)
loop
close #10
LONGSTRING PRINT buff()
j = LInstr(buff(),", some")
print Lgetstr$(buff(),j+2,22)
LONGSTRING copy b2(), buff()
LONGSTRING clear buff()
print "buff cleared? "; : LONGSTRING PRINT buff()
j = LInstr(b2(),"something")
print "mmbasic is "+Lgetstr$(b2(),j,26)+"!" : print ""
[/code]
Now the obvious question is: Can this be included in the beta?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 12:43pm 22 Dec 2018
Copy link to clipboard 
Print this post

Thanks for the suggestions Lance and I will take them on board.

When it comes to adding "features" to MMBasic I try to be careful because once added it is impossible to remove a feature (to preserve backwards compatibility). Also, it is very easy to clutter the language with too many features resulting in it being too hard to understand and use. In programming languages simpler is always better.

So, with any new feature I consider:
- Will a significant number of people use it?
- Can it be done using the current features of MMBasic?
- Does it fit with the "look and feel" of the BASIC language?
- Will it be really useful?
Geoff Graham - http://geoffg.net
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 01:54pm 22 Dec 2018
Copy link to clipboard 
Print this post

I understand. Thanks for considering.

>Will a significant number of people use it?

Well, I know of two DOS mmbasic users. Not a large base, I admit.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8516
Posted: 02:13pm 22 Dec 2018
Copy link to clipboard 
Print this post

The LONGSTRING command and associated functions seem to be pretty widely used on the MMX and Pi-cromite.
I added these commands as direct implementations of Geoff's CFunctions because I found the CFunctions so useful on the MM2 and MM+ and of course the Pi-cromite, MMX and now Armmite implementations don't support CFunctions.
I think I may have added a couple of things (certainly PRINT) but otherwise they are just integrated versions of the CFunctions
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 09:52pm 31 Dec 2018
Copy link to clipboard 
Print this post

One other pi-cromite/ARMmite concept I would like to see added to all versions is EPOCH. Without that, rollover of minute, hour, day, month, year, etc. makes doing something or checking something in, say, 10 minutes convoluted.

Especially notable today at this time where I am, when it is not quite yet 2019.



PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1983
Posted: 09:08am 01 Jan 2019
Copy link to clipboard 
Print this post

been done for some time. Pure MMbasic so compatible with any platform

http://www.fruitoftheshed.com/MMBasic.UnixTime-or-Epoch-Time.ashx
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:35pm 01 Jan 2019
Copy link to clipboard 
Print this post

Thanks, Cap'n. Just the ticket for now. Still hope to see built-in EPOCH in all mmbasics.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 1983
Posted: 09:53pm 01 Jan 2019
Copy link to clipboard 
Print this post

welcome. The counter-part "Human Time" is in there too
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1584
Posted: 03:51am 03 Jan 2019
Copy link to clipboard 
Print this post

For what it's worth, I tested the CLOSE command without using a loop to wait for the last character to be sent and lost no characters in the transmitted message. Thanks Geoff.
Keep safe. Live long and prosper.
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 839
Posted: 06:34am 23 Jan 2019
Copy link to clipboard 
Print this post

MAX() MIN() functions to allow use of an array?


Is it feasible/worthwhile to allow the MAX() and MIN() functions to operate on an array as well as a list of variables as it does now.

MIN(vc(0),vc(1),vc(2),vc(3),vc(4),vc(5),vc(6),vc(7),vc(8),vc(9))


i.e allow this as well.

MIN(vc())



Latest F4 Latest H7
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 07:55am 23 Jan 2019
Copy link to clipboard 
Print this post

Interesting idea and I guess that it could be useful.
I have added it to my list of enhancements to be investigated.
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2282
Posted: 12:36am 24 Jan 2019
Copy link to clipboard 
Print this post

well, since people are making suggestions...

mine is to:
1. add the VT100 and VT102 scroll window escape sequences to the VT100 VGA terminal ("ASCII Video Terminal"), then,
2. make use of scroll regions in the micromite basic's editor. this would substantially improve the editor's performance.

i'd be happy to assist with upgrading the terminal firmware, in so far as sitting down with the source code and figuring out the needed changes.

btw, geoff: is there a list of suggestions people have made maintained anywhere? i've made a few suggestions over the years, some of which have made it into mmbasic, others that have not. i'm loathe to re-suggest changes i've suggested in the past, yet am not sure if some have been dismissed as not feasible (or perhaps useful), or just overlooked/forgotten. mouse support in the editor is one example.


cheers,
rob :-)
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 12:58pm 24 Jan 2019
Copy link to clipboard 
Print this post

This brings us back to the subject of MMBasic enhancements and when they are worthwhile or not. At this stage I believe that MMBasic and the Micromite are reasonably mature and have a good feature set. My focus is on chasing down any remaining bugs, polishing what has been implemented and documenting everything.

I am painfully aware that every change/improvement will bring a crop of new bugs. For example the VAR RESTORE bug in this thread was caused by a small change to remove the need for MMBasic to rewrite its flash when first run and while this was small it still caused a hard to find bug elsewhere. MMBasic for the Micromite is quite large (the source is tens of thousands of lines and about 2.5 million characters) so it is next to impossible to be sure that one small change will not affect something else.

The other issue is the effort required to implement some of the exotic things on people's wish lists. Your idea Rob for scroll regions is quite worthwhile but how many people use the configuration that you are talking about? And is it worth the large amount of effort (I have lots of other projects that I want to work on).

So, don't expect lots of interesting new features in the Micromite and Micromite Plus. For anyone who likes playing with new features they should follow Peter Mather who is always venturing into uncharted territory.

Stability and maturity are important. As an example, the recent projects in Silicon Chip for a frequency standard and DAB+ radio were based on the MM+ and developed by the magazine without needing any help from me. There were no emails about issues, bugs or documentation queries. Both of these were extremely sophisticated projects and the fact that professional engineers were able to use the Micromite "as is" is, I believe, a testament to its feature set, maturity and documentation.

BTW, this is the current list of headings on my "to be investigated list":
- USB keyboard for the MM+
- MAX() MIN() functions to allow use of an array
- Make DISPLAYBOX Touchable
- STEP Command
- Rob's Suggestions for Micromite Editor #1
- Colour Code for Text in Editor
- Editor Escape Codes on Exit

Because the editor is such a complicated beast any changes to that tend to languish at the bottom of the pile.

GeoffEdited by Geoffg 2019-01-25
Geoff Graham - http://geoffg.net
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2282
Posted: 01:58pm 24 Jan 2019
Copy link to clipboard 
Print this post

agree 100% that stability is paramount, and also realize that the flash in the mx170 is pretty much chock-a-block full. on top of this is the fact that you are putting in a massive amount of work purely for the love of it, something that all of us on the forums would like to repay you for in some way.

i believe using scroll regions in the editor would benefit everyone who does not use mmedit, with responsiveness when entering programs beyond a single page improved dramatically. the down side is it would break your ASCII Video Terminal, that according to the documentation currently does not support scroll regions. this may be undesirable.

btw, while using just the VT100 commands DECSTBM, IND, RI may be a little convoluted, if the VT102 commands DL and IL are exploited things become much easier as you are able to insert/delete lines in the middle of the scroll region - so you could just set the scroll region when starting the editor and unset it when exiting. from what i have read, almost every VT100 terminal emulator is in fact VT102 compliant, and even DEC specified that "VT100 compatibility" should include these VT102 features.


cheers,
rob :-)
Edited by robert.rozee 2019-01-26
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 02:59pm 24 Jan 2019
Copy link to clipboard 
Print this post

Well, to get wild, what I'd really like to see is a debugger--at least for devices with enough flash.

Clearly some important hooks are already there--when an error is encountered, mmbasic reconstructs the line it occurred on and displays it. And from the ensuing ">" prompt you can do "PRINT varname" to print the still-existing value of any variable (which I find invaluable when debugging).

I wonder what debugging tools Geoff has developed to assist in his uncovering of subtle bugs.

I have no idea how hard it would be to implement the most basic features--single step and run-to-breakpoint, with display of values. With guidance, I would be happy to attempt it with the DOS or pi-cromite versions, which have the advantage of having an OS underlying mmbasic (though perhaps that would really just get in the way of a more comprehensive implementation).

40 years ago, with COBOL CICS, looking at hex representation of code and data, I figured out that I could insert a JUMP_TO_X instruction in place of failing instruction-A, then at X look at and fix erroneous values and jump back to A+1 to continue--while others were waiting for their core dumps to print. To have that minimum functionality would be valuable.

I seem to recall that some early microprocessors had an interrupt-on-address capability, which provided a hook for a debugger to implement single-step and run-to-breakpoint.



PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Paul_L
Guru

Joined: 03/03/2016
Location: United States
Posts: 769
Posted: 05:17pm 24 Jan 2019
Copy link to clipboard 
Print this post

Bravo Geoff! There are two things about which I wish to quarrel with you, one -- I wish you would put a donate button on your website, two -- I wish you would learn to spell color!

Lizby - I too wonder how convoluted the implementation of single step would be, however I do not believe that having an OS underlying mmbasic is necessarily a good thing. I think Geoff writes tighter code than a few thousand geeks trying to make AT&T's Unix code "better". That's a cute idea you had jumping out to a debug routine in COBOL under CICS. You're almost as old as I.

Paul in NY
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3163
Posted: 11:51pm 24 Jan 2019
Copy link to clipboard 
Print this post

Yes, I agree that some debugging features would be useful. However, precisely what? Something to think about.

  Paul_L said   I wish you would put a donate button on your website

I should - but that is another thing that keeps dropping to the bottom of the ToDo list.

  Paul_L said   I wish you would learn to spell color!

I think that you guys were lucky to get both COLOUR and COLOR as commands. Next you will want us to drive on the wrong side of the road!
Geoff Graham - http://geoffg.net
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 2989
Posted: 12:52am 25 Jan 2019
Copy link to clipboard 
Print this post

  Geoffg said   Yes, I agree that some debugging features would be useful. However, precisely what? Something to think about.

To my mind, it would take very little to greatly add to debugging.

1. From the ">" prompt, RUNTO line# (and return to ">", from which one could print variables).

2. NXT (or better, some function key--next line, return to ">"--single-stepping).

3. RPT (or some function key--repeat either 1 or 2).

This omits many possible features, like continuous display of variables, but should be able to be implemented with a minimal disruption of the present process of running an mmbasic program.

Because the program would have to check the line number with each line that was executed, there could be a considerable speed penalty, so you might have to start the program in a special debugging mode.

Thanks for your consideration.

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 2 of 4    
Print this page
© JAQ Software 2024