Replying to:12Me21I believe that the
FIX16 function can be replaced with
N<<16>>16.
Additionally, single characters of a string can be accessed using square brackets rather than
MID$.
Also I think your sorting function could be written as something like:
DIM LENS[LEN(STN$)]
FOR I=0 TO LEN(STN$)-1
LENS[I]=LEN(STN$[I])
NEXT
SORT LENS,STN$,STV
Oh, a few more things. SB has logical and/or operators (the standard && ||), and you can compare strings using < >= etc.
Replying to:12Me21I believe that the
FIX16 function can be replaced with
N<<16>>16.
Additionally, single characters of a string can be accessed using square brackets rather than
MID$.
Also I think your sorting function could be written as something like:
DIM LENS[LEN(STN$)]
FOR I=0 TO LEN(STN$)-1
LENS[I]=LEN(STN$[I])
NEXT
SORT LENS,STN$,STV
Does using "&&" instead of "AND" have any effect on performance?
So basically rasm is a version of the MOVfuscator but in SB :P
Replying to:12Me21I believe that the
FIX16 function can be replaced with
N<<16>>16.
Additionally, single characters of a string can be accessed using square brackets rather than
MID$.
Also I think your sorting function could be written as something like:
DIM LENS[LEN(STN$)]
FOR I=0 TO LEN(STN$)-1
LENS[I]=LEN(STN$[I])
NEXT
SORT LENS,STN$,STV
If the first value is false, it doesn't have to evaluate the second value. (And the opposite for ||)
Ah cool! I hope people learn stuff from this!
Replying to:12Me21I believe that the
FIX16 function can be replaced with
N<<16>>16.
Additionally, single characters of a string can be accessed using square brackets rather than
MID$.
Also I think your sorting function could be written as something like:
DIM LENS[LEN(STN$)]
FOR I=0 TO LEN(STN$)-1
LENS[I]=LEN(STN$[I])
NEXT
SORT LENS,STN$,STV
It's just generally more sane to use the right operator for the job. Bitwise AND/OR have to do more work, but it's just more clear to use the logical/conditional operators to people reading your code. Two bonuses in one.
Why not use ' for comments like SB? It looks better in the editor. You could make it another option and leave in the "original" comment character for compatibility.
Replying to:snail_Why not use ' for comments like SB? It looks better in the editor. You could make it another option and leave in the "original" comment character for compatibility.
That's just an annoying thing to deal with. The code wouldn't be compatible with other versions of the assembler, and plus, basically every assembly language uses ; for comments.
Replying to:snail_Why not use ' for comments like SB? It looks better in the editor. You could make it another option and leave in the "original" comment character for compatibility.
I haven't looked too far into it, but I'm convinced with a few basic tweaks, you can implement 90% (or more) of an assembler in SB using just a COMMON DEF library. You'd be limited in features and syntax, I guess, but it's a possibility because many assembly languages are so simple. Using ' for comments is one step towards this.
Why not get rid of RSSB prefix before things? If all you need is the arguments?
Looks nicer that way imo.
Awesome work, thanks for this! Now lets just hope I can actually understand it and learn a thing or two.
Some things remain unclear, which make this very difficult to program.
For example, does the CPU handle negative numbers, or only 0-65535? If it does what format does it use? Two’s complement?