Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 11:45 29 Nov 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 : PicoMite/PicoMiteVGA/WebMite V5.07.07 release candidates

     Page 7 of 13    
Author Message
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 01:53pm 22 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter,

You're going to be tempted to dismiss this one, but please don't I came across it perfectly legitimately without even pushing this particular boundary:

> ? Hex$(5,0)
Error : 0 is invalid (valid is 1 to 255)


On the CMM2, MMB4W and MMB4L specifying 0 for the number of chars is allowed and is the same as not specifying it at all.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3816
Posted: 02:16pm 22 Apr 2023
Copy link to clipboard 
Print this post

  TassyJim said  Manual needs an update

Likely to get one - when there's a release.

John
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 02:37pm 22 Apr 2023
Copy link to clipboard 
Print this post

Unsuprisingly BIN$(x, 0) and OCT$(x, 0) have the same behaviour.
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 03:04pm 22 Apr 2023
Copy link to clipboard 
Print this post

MMB4L (and I think the CMM2) can handle this, MMB4W and the PicoMite cannot:
> ? DateTime$(-1000)
Error : Epoch<0

Should(?) be: "31-12-1969 23:43:20"

"Interesting error message":
> Timer=9e12
Error : 2043514880 is invalid (valid is 0 to 1902192758)


Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 08:46pm 24 Apr 2023
Copy link to clipboard 
Print this post

Here is a bug/oddity I encountered in "real" code:
> list
Dim big$(1000) Length 128
Memory
End
> run
Program:
  1K ( 1%) Program (7 lines)
127K (99%) Free

Saved Variables:
 16K (100%) Free

RAM:
127K (81%) 2 Variables
  0K ( 0%) General
 29K (19%) Free


vs.

> list
foo()
Memory
End

Sub foo()
 Static big$(1000) Length 128
End Sub
> run
[6] Static big$(1000) Length 128
Error : Not enough memory


Explanation ?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:17pm 24 Apr 2023
Copy link to clipboard 
Print this post

Two more, apologies, I know they are subtle but if you could "fix" them it would avoid having to special case them in MMBasic code:

Dim f$ = "A:\"
> ? Mm.Info(Exists File f$) Or Mm.Info(Exists Dir f$)
0
> ? Mm.Info(Exists File f$)
0
> ? Mm.Info(Exists Dir f$)
0 <-- False
> ? Mm.Info(Exists File "A:\")
0
> ? Mm.Info(Exists Dir "A:\")
1 <-- True, for what should be the same string
>


I think it should be 1 in both cases; I don't think other MMBasic ports care whether you use / or \.

I'm guessing the "problem" is with the new string-escape sequences, I thought we had to opt in for those ?

Also on MMB4W, MMB4L, and I believe CMM2, Mm.Info(Exists Dir path$) does not require a drive path to have a trailing / or \.

> ? Mm.Info(Exists Dir "A:")
0
> ? Mm.Info(Exists Dir "B:")
0
>


Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:24pm 24 Apr 2023
Copy link to clipboard 
Print this post

It is a feature of the way Geoff has coded static. It allocates the memory for the sub copy and then frees it. I don't intend to play with this as it is core MMbasic
.
            if(StaticVar) {
               tv = findvar(argv[i], typeSave | V_LOCAL | V_NOFIND_NULL);     // check if the local variable exists
               if(tv != NULL) error("$ already declared", argv[i]);
               tv = findvar(argv[i], typeSave | V_LOCAL | V_FIND | V_DIM_VAR);         // create the variable
               if(vartbl[VIndexSave].dims[0] > 0 || (vartbl[VIndexSave].type & T_STR)) {
                   FreeMemory(tv);                                                                 // we don't need the memory allocated to the local
                   vartbl[VarIndex].val.s = vartbl[VIndexSave].val.s;                              // point to the memory of the global variable
               } else
                   vartbl[VarIndex].val.ia = &(vartbl[VIndexSave].val.i);                     // point to the data of the variable
               vartbl[VarIndex].type = vartbl[VIndexSave].type | T_PTR;           // set the type to a pointer
               vartbl[VarIndex].size = vartbl[VIndexSave].size;                   // just in case it is a string copy the size
               for(j = 0; j < MAXDIM; j++) vartbl[VarIndex].dims[j] = vartbl[VIndexSave].dims[j];  // just in case it is an array copy the dimensions
}
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:20am 25 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  It is a feature of the way Geoff has coded static. It allocates the memory for the sub copy and then frees it. I don't intend to play with this as it is core MMbasic


Right, M'eh . I was vacillating over using a global instead of a static there anyway, I guess that makes the decision for me.

BUG: Trying to load too large a program:
Error: Invalid address - resetting


Try this:
   big.zip

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:33am 25 Apr 2023
Copy link to clipboard 
Print this post

Which version - which method of loading?
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:42am 25 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  Which version - which method of loading?


5.07.07RC6

And I think "LOAD" but I'll have to come back to you about this evening because I've just put the PicoMite into a state where it has to be re-flashed.

PicoMite MMBasic Version 5.07.07RC6
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

[3295] Sub test_comment_if()
Error : Too many subroutines and functions


At which point it hangs.

And when you reset it, it just gets to the same point again (because that "invalid" program is in flash) and hangs again.

The unit-tests for my transpiler push the poor PicoMite beyond its capabilities it seems .

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:52am 25 Apr 2023
Copy link to clipboard 
Print this post

  Quote  And when you reset it, it just gets to the same point again (because that "invalid" program is in flash) and hangs again.


I used to deal with this by resetting flash in case of this sort of error but was persuaded that this wasn't wanted - perhaps I should put it back.
Please post the offending file so I can work with it

The load one is trivial and is easy to fix.
Edited 2023-04-25 19:53 by matherp
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 09:54am 25 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  I used to deal with this by resetting flash in case of this sort of error but was persuaded that this wasn't wanted - perhaps I should put it back.
Please post the offending file so I can work with it


Surely the principal problem is that it hangs at all if the program contains too many fun/sub ?

too_many_subs.zip

Strictly speaking this may not be *exactly* the same file as that's trapped on the A:/ drive of the PicoMite until this evening.

  matherp said  The load one is trivial and is easy to fix.


The best sort of bug.

Right, I really must do some real work, Ciao for now,

Tom
Edited 2023-04-25 19:59 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 09:59am 25 Apr 2023
Copy link to clipboard 
Print this post

In order to execute user functions/commands at the command line the sub/fun table has to be created. This means if it is full there is nowhere for the firmware to go. As I say, please post the offending file and I'll see what sort of work-around I can create
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:03am 25 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  In order to execute user functions/commands at the command line the sub/fun table has to be created. This means if it is full there is nowhere for the firmware to go. As I say, please post the offending file and I'll see what sort of work-around I can create


Ah, makes a certain sense.

See my edited response above for the offending file ... you edited your previous post whilst I was writing mine - what a tangled web we weave .

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 10:37am 25 Apr 2023
Copy link to clipboard 
Print this post

V5.07.07RC7

https://geoffg.net/Downloads/picomite/PicoMite_Beta.zip

Fixes various issues raised by Tom above
Tom: load this and it will delete the offending program but not delete your flash disk
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 10:50am 25 Apr 2023
Copy link to clipboard 
Print this post

  matherp said  Fixes various issues raised by Tom above


Thanks Peter, I will try and take it for a spin this evening.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 05:27pm 25 Apr 2023
Copy link to clipboard 
Print this post

Hi Peter,

Now running RC7, it prints the message about there being too many sub/funs, but then it restarts, backing up one line before printing the (c) message and half erasing the error message from the user:



Best wishes,

Tom
Edited 2023-04-26 03:28 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4047
Posted: 05:36pm 25 Apr 2023
Copy link to clipboard 
Print this post

I'm having a "senior moment", how do we change drive now?

PicoMite MMBasic Version 5.07.07RC7
Copyright 2011-2023 Geoff Graham
Copyright 2016-2023 Peter Mather

> drive "A:"
Error : Syntax
> drive "A"
Error : Syntax
> drive A
Error : Expected a string
> A:
Error : Syntax
> drive "B:"
Error : Syntax
> drive "B"
Error : Syntax
> drive B
Error : Expected a string
> B:
Error : Syntax
>


Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:40pm 25 Apr 2023
Copy link to clipboard 
Print this post

Just need to add a crlf but the concept works as I intended

The drive thing is me trying to satisfy your b: without a /
will fix
Edited 2023-04-26 03:51 by matherp
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9139
Posted: 05:54pm 25 Apr 2023
Copy link to clipboard 
Print this post

I've updated the download - no version change
 
     Page 7 of 13    
Print this page
© JAQ Software 2024