Well, yes, signed can show variances, and what is actually done 'in the wild' seems somewhat loose (as in your link)

There is also this, for FreePascal "Mod (modulus) divides two numbers and returns only the remainder. For instance, the expression "a:= 13 mod 4;" would evaluate to 1 (a=1), while "b := 12 mod 4;" would evaluate to 0 (b=0).
From the language reference:
"The sign of the result of a Mod operator is the same as the sign of the left side operand of the Mod operator. In fact, the Mod operator is equivalent to the following operation :"
I mod J = I - (I div J) * J
For example "c:= -13 mod 4;" results in c = -1 and "c:= 10 mod -3;" results in c = 1.
This is also what most other languages like C++ and Java do

From version 3.1.1 FreePascal also supports the mod operator for floating point values when you include the math unit.
"

Yes, but for SETMIN, I presume that is the lower bound, so you actually seek >= or GE which is the larger of a pair of values.
Now you have used a MIN root word, to select the largest of two values.
Compare that with the common WEB definitions of MIN ?
Better than SETMIN, would be SETGE, as Greater or Equal is the operation performed in setting the lower-boundary.

SETGE
SETLE
SETSGE
SETSLE

Their meaning doesn't pop out, though they are not that bad.

But SETMIN would set D to a minimum value, in case it was under. I think anyone should understand that. I mean, what else could SETMIN be suspected of doing?

@Chip,
with SET I have the perception that I am preparing (parametrizing) the environment for an other instruction.

I suppose someone could think that !< means >=. Kind of like !=. Too bad we have to resort to a NOT (!) character when all we really need is some kind of verb and a > or <. If there was something that meant the opposite of !, we could use it with the opposite >, <.

I think !< and !> make some immediate sense to the reader, though. #> and <# looked quite ambiguous.

Is that correct? That syntax is so simple and nice! We still need to decide on the PASM instructions.

some P1 code like this (from earlier) should ideally be simple-translatable to P2....
Elev := 1000 #> Elev <# 2000
can be
Elev := 1000 FGE Elev FLE 2000
or
Elev := Elev FGE 1000 FLE 2000
all are bound 1000..Elev..2000 (which is another syntax candidate )

x := x !< 5 !> 10
simple swap gives
x := 5 !< x !> 10
is this last one still 5..10 ?
FGE allows operand reversal, but does !< ?
I think it needs to become instead
x := 5 !> x !> 10

I think !< and !> make some immediate sense to the reader, though. #> and <# looked quite ambiguous.

#> and #< have no obvious decode, you have to go to the manual.

!< are more decodable, but it saysnot-less-than, which I think now makes operand order matter to the reader.
Actual field Spin usage seems to be a mix of both ways above (ie order agnostic) ?

Err, has everyone fully grasped this new !< !> syntax now imposes restrictions on the operator order ?
That restriction was not there on the old syntax.
If you say 'Hey, let's allow either order', in one case the opcode does not do what it literally says.
Which repeats the problem of backwards MIN, where what happens is not what the code says..

Err, has everyone fully grasped this new !< !> syntax now imposes restrictions on the operator order ?
That restriction was not there on the old syntax.
If you say 'Hey, let's allow either order', in one case the opcode does not do what it literally says.
Which repeats the problem of backwards MIN, where what happens is not what the code says..

Err, has everyone fully grasped this new !< !> syntax now imposes restrictions on the operator order ?
That restriction was not there on the old syntax.
If you say 'Hey, let's allow either order', in one case the opcode does not do what it literally says.
Which repeats the problem of backwards MIN, where what happens is not what the code says..

Please explain?

Already did above...
This is OK
Elev := 1000 #> Elev <# 2000
Which is equivalent to
Elev := 1000 FGE Elev FLE 2000
or, this can be re-ordered as
Elev := Elev FGE 1000 FLE 2000
all are bound 1000..Elev..2000 (which is another syntax candidate )

This is ok
x := x !< 5 !> 10
simple order swap gives
x := 5 !< x !> 10
but what does that now say ? 5 is NOT less Than X, which means 5 is >= X, and X=1 will output 1.
It is ok to re-code like this
x := 5 !> x !> 10
.. but here the operator flips when the order flips, which the old opcode did not require (nor does FGE).

## Comments

4,031Why not something that actually makes sense at quick glance

14,418Well, yes, signed can show variances, and what is

actuallydone 'in the wild' seems somewhat loose (as in your link)There is also this, for FreePascal

"Mod (modulus) divides two numbers and returns only the remainder. For instance, the expression "a:= 13 mod 4;" would evaluate to 1 (a=1), while "b := 12 mod 4;" would evaluate to 0 (b=0).

From the language reference:

"

The sign of the result of a Mod operator is the same as the sign of the left side operand of the Mod operator.In fact, the Mod operator is equivalent to the following operation :"I mod J = I - (I div J) * J

For example "c:= -13 mod 4;" results in c = -1 and "c:= 10 mod -3;" results in c = 1.

This is also what most other languages like C++ and Java do

From version 3.1.1 FreePascal also supports the mod operator for floating point values when you include the math unit.

"

815with SET I have the perception that I am preparing (parametrizing) the environment for an other instruction.

LIMGE/LE/SGE/SLE is more clear to me.

if you dislike LIM also CLIP/CLAMP is fine.

12,866I like these, too, and they cover both signed and unsigned. Now, does FLE replace MIN or MAX? Just kidding about that part.

MIN becomes FGE

MAX becomes FLE

MINS becomes FGES

MAXS becomes FLES

#> is really FGES (FGES would be an ugly spin operator)

<# is really FLES (FLES would be an ugly spin operator)

One other thing is that GE and LE are nomenclature used on signed comparisons. Unsigned often uses AE and BE, right? What about:

MIN becomes FAE

MAX becomes FBE

MINS becomes FGE

MAXS becomes FLE

We can avoid using 4-letter words, then.

22,692-Phil

12,866The only thing I can think of that would make sense, at first glace, for a Spin operator would be:

x AT_LEAST 5 AT_MOST 10

81514,418but you could do this in PASM

MIN becomes FGEU

MAX becomes FLEU

MINS becomes FGE

MAXS becomes FLE

(ie make signed the default)

and now FGE, FLE can become (less ugly) aliases to the spin signed operators

4,0314,03114,418what about the clarity of these ?

2,344or:

4,03122,692I could live with that, or perhaps better:

x !< 5 !> 10. Still like <# and #> better.-Phil

12,866I think this looks great.

22,6922,344Andy

12,866Okay. This will be the Spin syntax, then:

#> becomes !<

<# becomes !>

Is that correct? That syntax is so simple and nice! We still need to decide on the PASM instructions.

12,866I think !< and !> make some immediate sense to the reader, though. #> and <# looked quite ambiguous.

815if !< means "clamp to" ("lower limit is") a given number, than the result will be => of the specified number

14,418some P1 code like this (from earlier) should ideally be simple-translatable to P2....

Elev := 1000 #> Elev <# 2000

can be

Elev := 1000 FGE Elev FLE 2000

or

Elev := Elev FGE 1000 FLE 2000

all are bound 1000..Elev..2000 (which is another syntax candidate )

x := x !< 5 !> 10

simple swap gives

x := 5 !< x !> 10

is this last one still 5..10 ?

FGE allows operand reversal, but does !< ?

I think it needs to become instead

x := 5 !> x !> 10

2,344For me MIN,MAX work a bit like CMPSUB , only that it does not Subtract but Move.

So maybe: Just brainstorming...

CMPFLT, CMPSFLT, CMPFGT, CMPSFGT are alternatives (F = Force as Phil suggested)

14,418!< are more decodable, but it

saysnot-less-than, which I think now makes operand order matter to the reader.Actual field Spin usage seems to be a mix of both ways above (ie order agnostic) ?

11,105Much better than#

8,564+1

16,382Excellent. (I was going to put Excellent! but that could be misinterpreted;) )

16,382NOTLT D,#S

NOTGT D,#S

NOTLTS D,#S

NOTGTS D,#S

Otherwise FLE, FGE, FLES, FGES are fine.

14,418fully grasped this new !< !> syntax now imposes restrictions on the operator order ?That restriction was not there on the old syntax.

If you say 'Hey, let's allow either order', in one case the opcode does not do what it literally says.

Which repeats the problem of backwards MIN, where what happens is not what the code says..

16,38214,418This is OK

Elev := 1000 #> Elev <# 2000

Which is equivalent to

Elev := 1000 FGE Elev FLE 2000

or, this can be re-ordered as

Elev := Elev FGE 1000 FLE 2000

all are bound 1000..Elev..2000 (which is another syntax candidate )

This is ok

x := x !< 5 !> 10

simple order swap gives

x := 5 !< x !> 10

but what does that now say ? 5

is NOT less ThanX, which means 5 is >= X, and X=1 will output 1.It is ok to re-code like this

x := 5 !> x !> 10

.. but here the operator flips when the order flips, which the old opcode did not require (nor does FGE).