Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:06 10 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 : PicoMite 6.00.02 prospectus

     Page 2 of 2    
Author Message
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10229
Posted: 08:15am 16 Jan 2025
Copy link to clipboard 
Print this post

  Quote  If you like, I can develop the code for it so that it would be a drop in lump of code for 6.00.02.


That would be great. Thanks Geoff.

  Quote  While progressing from 6.00.01 official release to 6.00.02 and the further future, would it be an idea to add new features to 6.00.02, but continue to update 6.00.01 with bug fixes (as happened with webmite). I refer to fixes that have no user manual impact, real bug fixes.


No: sorry. I'm not prepared to support two development streams. For 6.00.02 I will revert to uploading firmware to the development link on Geoff's site.
Edited 2025-01-16 18:19 by matherp
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2436
Posted: 01:44pm 16 Jan 2025
Copy link to clipboard 
Print this post

  twofingers said  
  matherp said  I've also played with this - does it make sense?
Note that BYVAL is effectively a unary operator ...

Do we need that? Isn’t that identical to
a%=7
Print double((a%))
Print a%
Print double(a%)
Print a%

Function double(i%)
 i%=i%*2
 double=i%
End Function


this also works:  

Print double(--a%)

but unfortunately this does not:  

Print double(+a%)


my vote would be for +a% for the reasons that:

+ using it adds just a single token to the program's length rather than two tokens,

+ applying the same rule to + as is applied to - would reduce the size of and simplify the interpreter,

+ it is mathematically correct.

one could even argue that the error produced:

>
> Print double(+a%)
Error: Expression syntax
>

represents a... bug.   if - is accepted as a valid unary operator that changes sign, then surely + must be accorded the same status, as a unary operator that does not change sign.

as a bug fix, this could even be a good excuse for releasing a new revision of mx170 mmbasic    


cheers,
rob   :-)


addendum: look what works on the mx170:

>
> ?+-+2
-2
> ? ---2
-2
> ? +--2
2
> ?--+2
2
>


addendum 2: looks like the code that evaluates expressions for print accepts '+' as a unary operator, but the function parser does not.
Edited 2025-01-16 23:58 by robert.rozee
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2436
Posted: 01:59pm 16 Jan 2025
Copy link to clipboard 
Print this post

addendum3: nope, it is that + as a unary operator works on numerics, but not variables
Edited 2025-01-17 00:03 by robert.rozee
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10229
Posted: 02:03pm 16 Jan 2025
Copy link to clipboard 
Print this post

  Quote  Print double(+a%)
Error: Expression syntax


Not on a PicoMite, works as expected


 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2436
Posted: 02:05pm 16 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  
  Quote  Print double(+a%)
Error: Expression syntax


Not on a PicoMite, works as expected


hmmm. it truly is a bug - but just in the mx170 version!  

geoff?


cheers,
rob   :-)


>
> a=7
> ?double(a)
14
> ?double(+7)
14
> ?double(+a)
Error: Expression syntax
>
> ? mm.ver
5.0501
>

Edited 2025-01-17 00:09 by robert.rozee
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10229
Posted: 02:10pm 16 Jan 2025
Copy link to clipboard 
Print this post

This also works on the PicoMite

Print double(--++-+a%)
 
robert.rozee
Guru

Joined: 31/12/2012
Location: New Zealand
Posts: 2436
Posted: 02:20pm 16 Jan 2025
Copy link to clipboard 
Print this post

  matherp said  This also works on the PicoMite

Print double(--++-+a%)


now that's just showing off!!  

did a check with 5.05.05 and got the same failure:

[2] Print double(+a%)
Error : Expression syntax
>
> Micromite MKII MMBasic Ver 5.05.05
Copyright 2011-2021 Geoff Graham

>



cheers,
rob  :-)
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4301
Posted: 02:28pm 16 Jan 2025
Copy link to clipboard 
Print this post

For what it is worth I vaguely recollect the behaviour of the + unary operator being fixed during earlier PicoMite firmware development (and me copying the fix to MMB4L) so the syntax problem may be present on CMM2 + MMB4W depending on whether Peter backported it.

Best wishes,

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

Joined: 11/12/2012
Location: United Kingdom
Posts: 10229
Posted: 02:40pm 16 Jan 2025
Copy link to clipboard 
Print this post

The "fix" was incidental to an optimisation I did on the CMM2 to handle unary operators faster.  It is in MMB4W and CMM2
 
zeitfest
Guru

Joined: 31/07/2019
Location: Australia
Posts: 574
Posted: 11:14pm 16 Jan 2025
Copy link to clipboard 
Print this post

After the greenwash....
 
     Page 2 of 2    
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