Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:17 11 Jul 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 : MM-DOS: Is there really no DIR$ function or equivalent

Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 08:59am 07 Jul 2020
Copy link to clipboard 
Print this post

Hi folks,

I was idly poking at an MMBasic DOS version of Z-MIM when I came across an unexpected problem:

Is there really no DIR$ function or equivalent for programatically iterating through the contents of a directory?

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Atomizer_Zero
Senior Member

Joined: 04/07/2020
Location: United Kingdom
Posts: 134
Posted: 10:20am 07 Jul 2020
Copy link to clipboard 
Print this post

As far as I can tell, you'll need to use SYSTEM command-line$ in order to use actual DOS dir command. The example says it saves the results into a text file, which you could then operate on in mmbasic.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:27am 07 Jul 2020
Copy link to clipboard 
Print this post

  Atomizer_Zero said  As far as I can tell, you'll need to use SYSTEM command-line$ in order to use actual DOS dir command. The example says it saves the results into a text file, which you could then operate on in mmbasic.


Thank you.

I guess I could make that work, though it's a bit of a nuisance. I wonder how much trouble it would be to build MMBasic DOS myself and make some updates - the problem is I keep finding myself pulled in different directions by the 'mites.

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Atomizer_Zero
Senior Member

Joined: 04/07/2020
Location: United Kingdom
Posts: 134
Posted: 10:53am 07 Jul 2020
Copy link to clipboard 
Print this post

MMBasic for dos/win certainly is limited compared to the 'mites by the looks of things. I can't fully test all the features of my current program i'm writing as I run out of memory lol. Plus, with no graphics options, there's a whole half of my program that can't work either. And finally, you can't include other files into your main program like you can on the CMM2 or others.

It's fine for getting some logic up and running, making sure values are being manipulated properly and stuff, but man, I can't wait to actually get my CMM2 (still waiting for it to be dispatched... its on back order at MicroMite.org) so I can actually test all the things lol
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 10:59am 07 Jul 2020
Copy link to clipboard 
Print this post

  Atomizer_Zero said  I can't fully test all the features of my current program i'm writing as I run out of memory lol.


That must be a big program, it looks like MM Basic for DOS has 0.5 MB for Program and 0.5 MB for Variables.

  Quote  And finally, you can't include other files into your main program like you can on the CMM2 or others.


I believe that only the CMM2 supports #INCLUDE, the CMM1 has support for LIBRARY, I'm not sure about the micromites as I don't think necessarily have file-systems you could include additional files from.

My transcompiler (which I keep harping on about, but not delivering) can flatten #INCLUDE structures so that is how I'm converting the CMM2 source-code of Z-MIM to run on other platforms.

  Quote  but man, I can't wait to actually get my CMM2 (still waiting for it to be dispatched... its on back order at MicroMite.org) so I can actually test all the things lol


I was lucky, I think I got the first CMM2 that the WhiteWizzard at MicroMite.org sold ... I hope he doesn't regret it, I'm proving to be rather noisy

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3358
Posted: 01:32pm 07 Jul 2020
Copy link to clipboard 
Print this post

  thwill said  I wonder how much trouble it would be to build MMBasic DOS myself and make some updates

In December, 2018, I found it trivially easy to compile mmbasic for DOS to add Peter Mather's longstring functions (for which he provided the source). I just downloaded the recommended openWatcom C compiler and ran the compilation for DOS for the downloaded  mmbasic source on my 64-bit Win10 laptop. The BuildAll.bat file ran to completion in 16 seconds, and the mmbasic.exe executable works, at least as far as PRINT "Hello, World" goes. The longstring functions also worked.
Edited 2020-07-07 23:33 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 02:30pm 07 Jul 2020
Copy link to clipboard 
Print this post

  lizby said  In December, 2018, I found it trivially easy to compile mmbasic for DOS ...


And it is still trivially easy in July 2020 .

I was bracing myself for an extended period of swearing trying to set up the tooling but it all ran smoothly and built first time.

On first flush it even looks like I maye be able to lift most of the implemenation of Dir$() from the Picromite source.

Did you contact Geoff about including your port of LONGSTRING upstream ? It would have been helpful to me, but it's not essential.

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3358
Posted: 02:34pm 07 Jul 2020
Copy link to clipboard 
Print this post

  thwill said  Did you contact Geoff about including your port of LONGSTRING upstream

I suggested it, but it hasn't been included (matherp's LONGSTRING code--I changed nothing about it).
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Atomizer_Zero
Senior Member

Joined: 04/07/2020
Location: United Kingdom
Posts: 134
Posted: 02:44pm 07 Jul 2020
Copy link to clipboard 
Print this post

thwill, is it possible to increase the amount of memory allocated for programs in mmbasic-dos/win source? I need about 3MB right now. 512K just isnt cutting it lol...
Edited 2020-07-08 00:44 by Atomizer_Zero
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 02:50pm 07 Jul 2020
Copy link to clipboard 
Print this post

  Atomizer_Zero said  thwill, is it possible to increase the amount of memory allocated for programs in mmbasic-dos/win source? I need about 3MB right now. 512K just isnt cutting it lol...


I'm new here myself, but it's possibly just a case of changing the value of HEAP_SIZE in Configuration.h and recompiling.

I'm afraid you will need to do that for yourself though as the license agreement that gives me (or anyone else who requests) access to the source code expressly excludes the rights to distribute modified code or binaries. And Geoff has understandable reasons for this: http://geoffg.net/OpenSource.html

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3358
Posted: 02:51pm 07 Jul 2020
Copy link to clipboard 
Print this post

Matherp sent made the longstring routines available in a link in the second page of this thread:
longstring code

I just downloaded them, so the link is still good. You just replace DOS_Misc.c and DOS_Misc.h and recompile.
Edited 2020-07-08 00:52 by lizby
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 02:55pm 07 Jul 2020
Copy link to clipboard 
Print this post

  lizby said  Matherp sent made the longstring routines available in a link in the second page of this thread:
longstring code

I just downloaded them, so the link is still good. You just replace DOS_Misc.c and DOS_Misc.h and recompile.


Thank you, though they are actually no good to me in terms of supporting Z-MIM unless included in the official build. I've already contacted Geoff about the addition of DIR$() as he has generously agreed to take a look at my proposed code if/when I produce it.

Regards,

Tom
MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Atomizer_Zero
Senior Member

Joined: 04/07/2020
Location: United Kingdom
Posts: 134
Posted: 03:28pm 07 Jul 2020
Copy link to clipboard 
Print this post

  thwill said  
I'm new here myself, but it's possibly just a case of changing the value of HEAP_SIZE in Configuration.h and recompiling.

I'm afraid you will need to do that for yourself though as the license agreement that gives me (or anyone else who requests) access to the source code expressly excludes the rights to distribute modified code or binaries. And Geoff has understandable reasons for this: http://geoffg.net/OpenSource.html

Regards,

Tom


Fair enough. Thanks for the information. I guess in the grand scheme of things, I can just wait for the cmm2 instead of modifying mmbasic dos source code.
 
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