Try the SX/B 2.0 Public Beta NOW!! 2.00.31 April 8, 2010
Bean
Posts: 8,129
As you know SX/B 2.0 has been in private beta testing for quite some time.
Although the documentation and help file still has a little·work, we decided to release the beta version to the public so we may get some feedback on it. I have attached version 2.00.07. The first official release will be 2.01.
Unzip the attached file. Put the files in your C:\Program Files\Parallax Inc\SX-Key v3.2.92\Compilers\SXB directory (overwritting the existing files).
Please read the "What's New" pdf file to get an idea of what has changed.
To the private beta testers: I really appreciate all your help in the development of SX/B 2.0, you are now free to post all of your SX/B 2.0 projects or demo code to the public forum. Let everyone see what this puppy can do!
I know there will be questions, please feel free to post them. I'd encourge any of the beta testers to answer any question you'd like.
Enjoy,
Bean (On behalf of the whole SX/B Beta Tester team)
[noparse][[/noparse]Edit] Jan·30. 2009 Posted version 2.00.08
Version 2.00.08
· FIXED: ENDSUB always generates a RETP (in case RETURN is in conditional code).
· FIXED: ENDFUNC without a return didn't adjusts stack pointer.
· FIXED: Optimize wordvar = wordvar + constant (where constant < 256, and/or constant = 1)
[noparse][[/noparse]EDIT] Feb 9, 2009 Posted version 2.00.09
Version 2.00.09
· OPTIMIZED: "FOR byteVar = x TO 1 STEP -1" now generates "DJNZ temp,@__FOR"
· FIXED:· "w = $0F & fsr" and "w = fsr & $0F"
·
[noparse][[/noparse]EDIT] Feb 11, 2009 Posted version 2.00.10
Version 2.00.10
· CHANGED: Compiler conditionals are now NOT evaluated when nested.
··· But $ELSE and $ENDIF will affect only the outermost loop.
[noparse][[/noparse]EDIT] Feb 13, 2009 Posted version 2.00.11
Version 2.00.11
· FIXED: byteVar = ~byteVar· error introduced in version 2.00.09 to handle "W"
[noparse][[/noparse]EDIT] Feb 17, 2009 Posted version 2.00.12
Version 2.00.12
· Fixed: HEXVAL & HEXSTR should not subtract one when first parameter is a constant
· Changed: "MODE = const" or "M = const" on SX28 generates "MODE const" (Saves 1 instruction)
[noparse][[/noparse]EDIT] Feb 20, 2009 Posted version 2.00.13
Version 2.00.13
· ADDED: WCON (Word CONstant) diretive // SUB, FUNC, RETURN, DATA
· ENHANCED: SUB declaration· "MySub SUB 2,3,WORD,BYTE"
··········· FUNC declaration "MyFunc FUNC 2,2,3,WORD,WORD,BYTE"
[noparse][[/noparse]EDIT] Feb 24, 2009 Posted version 2.00.14
Version 2.00.14
· FIXED: Use LSB if you give a WORD to a SUB or FUNC that requires a BYTE
··· Make one routine to pass parameters for SUBs or FUNCs
· FIXED: MySub __WPARAM12 ' Does not load __PARAM1 and __PARAM2
[noparse][[/noparse]EDIT] Feb 25, 2009 Posted version 2.00.15
Version 2.00.15
· FIXED: Error for FUNC with no parameters
[noparse][[/noparse]EDIT] Feb 25, 2009 Posted version 2.00.16
Version 2.00.16
· FIXED: Word constant as SUB or FUNC parameter is not counted as 2 bytes
[noparse][[/noparse]EDIT] Mar 26, 2009 Postsed version 2.00.17
Version 2.00.17
· FIXED: FUNC cannot have 5 parameters "STOAB FUNC 1,5,5"
[noparse][[/noparse]EDIT] Mar 26, 2009 Posted version 2.00.18
Version 2.00.18
· FIXED: negative constants as SUB parameters (assumes positive < 256)
[noparse][[/noparse]EDIT] Apr 1, 2009 Posted version 2.00.19
Version 2.00.19
· FIXED: SUB 5,5
[noparse][[/noparse]EDIT] Apr 11, 2009 Posted version 2.00.20
Version 2.00.20
· FIXED: localWord = WordFunc ' __PARAM0 error
·[noparse][[/noparse]EDIT] Apr 17, 2009 Posted version 2.00.21
Version 2.00.21
· FIXED: RCTIME timing was off by 2 cycles per loop
[noparse][[/noparse]EDIT] May 11, 2009 Posted version 2.00.22
Version 2.00.22
· FIXED: COUNT using a WORD variable for result
[noparse][[/noparse]EDIT] May 11, 2009 Posted version 2.00.23
Version 2.00.22
· FIXED: CRASH on SUB definition
[noparse][[/noparse]EDIT] May 13, 2009 Posted version 2.00.24
Version 2.00.24
· FIXED: localWord = localWord SHR localByte ' "INC FSR" and "DEC FSR" are swapped
· FIXED: localWord = lsb,msb ' Only lsb is set
[noparse][[/noparse]EDIT] June 8, 2009 Posted version 2.00.25
Version 2.00.25
· FIXED: PUT var1, var2 to var3 ' Lowercase "to" didn't work properly
[noparse][[/noparse]EDIT] June 15, 2009 Posted version 2.00.26
Version 2.00.26
· FIXED: W = byteVar OR byteVar
· FIXED: W = byteVar - byteVar
[noparse][[/noparse]EDIT] June 26, 2009 Posted version 2.00.27
Version 2.00.27
· CHANGED: Word subtractions leave carry correct when finished (PJV)
· CHANGED: WORD division added "SZ" to avoid incorrect result 1 / $FF02 = 1 should be zero
[noparse][[/noparse]EDIT] July 13, 2009 Posted version 2.00.28
Version 2.00.28
· ENHANCED: Conditional compiler directives can now be nested (32 levels).
· FIXED: wordVar = Const - Const ' Should NOT do the math
[noparse][[/noparse]EDIT] July 16, 2009 Posted version 2.00.29
Version 2.00.29
· FIXED: Bug introduced in 2.00.28 with WordVar = WordVar - Const
· FIXED: WordVar = WordVar + Const > 255
[noparse][[/noparse]EDIT] July 31, 2009 Posted version 2.00.30
Version 2.00.30
· ADDED: TASKS INIT [noparse][[/noparse], MAXTASKS]
·········· Sets up TASK variables so you can place TASK RUN after TASKS SET
· FIXED: On SX48 TRIS_A = localbyte generated an error
· OPTIMIZED: localbyte = Register (Doesn't use PARAM1 now)
[noparse][[/noparse]EDIT] April 8, 2010 Posted version 2.00.31
Version 2.00.31
· FIXED: WordVar1 = Const - WordVar2
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
Post Edited (Bean) : 4/9/2010 1:23:57 AM GMT
Although the documentation and help file still has a little·work, we decided to release the beta version to the public so we may get some feedback on it. I have attached version 2.00.07. The first official release will be 2.01.
Unzip the attached file. Put the files in your C:\Program Files\Parallax Inc\SX-Key v3.2.92\Compilers\SXB directory (overwritting the existing files).
Please read the "What's New" pdf file to get an idea of what has changed.
To the private beta testers: I really appreciate all your help in the development of SX/B 2.0, you are now free to post all of your SX/B 2.0 projects or demo code to the public forum. Let everyone see what this puppy can do!
I know there will be questions, please feel free to post them. I'd encourge any of the beta testers to answer any question you'd like.
Enjoy,
Bean (On behalf of the whole SX/B Beta Tester team)
[noparse][[/noparse]Edit] Jan·30. 2009 Posted version 2.00.08
Version 2.00.08
· FIXED: ENDSUB always generates a RETP (in case RETURN is in conditional code).
· FIXED: ENDFUNC without a return didn't adjusts stack pointer.
· FIXED: Optimize wordvar = wordvar + constant (where constant < 256, and/or constant = 1)
[noparse][[/noparse]EDIT] Feb 9, 2009 Posted version 2.00.09
Version 2.00.09
· OPTIMIZED: "FOR byteVar = x TO 1 STEP -1" now generates "DJNZ temp,@__FOR"
· FIXED:· "w = $0F & fsr" and "w = fsr & $0F"
·
[noparse][[/noparse]EDIT] Feb 11, 2009 Posted version 2.00.10
Version 2.00.10
· CHANGED: Compiler conditionals are now NOT evaluated when nested.
··· But $ELSE and $ENDIF will affect only the outermost loop.
[noparse][[/noparse]EDIT] Feb 13, 2009 Posted version 2.00.11
Version 2.00.11
· FIXED: byteVar = ~byteVar· error introduced in version 2.00.09 to handle "W"
[noparse][[/noparse]EDIT] Feb 17, 2009 Posted version 2.00.12
Version 2.00.12
· Fixed: HEXVAL & HEXSTR should not subtract one when first parameter is a constant
· Changed: "MODE = const" or "M = const" on SX28 generates "MODE const" (Saves 1 instruction)
[noparse][[/noparse]EDIT] Feb 20, 2009 Posted version 2.00.13
Version 2.00.13
· ADDED: WCON (Word CONstant) diretive // SUB, FUNC, RETURN, DATA
· ENHANCED: SUB declaration· "MySub SUB 2,3,WORD,BYTE"
··········· FUNC declaration "MyFunc FUNC 2,2,3,WORD,WORD,BYTE"
[noparse][[/noparse]EDIT] Feb 24, 2009 Posted version 2.00.14
Version 2.00.14
· FIXED: Use LSB if you give a WORD to a SUB or FUNC that requires a BYTE
··· Make one routine to pass parameters for SUBs or FUNCs
· FIXED: MySub __WPARAM12 ' Does not load __PARAM1 and __PARAM2
[noparse][[/noparse]EDIT] Feb 25, 2009 Posted version 2.00.15
Version 2.00.15
· FIXED: Error for FUNC with no parameters
[noparse][[/noparse]EDIT] Feb 25, 2009 Posted version 2.00.16
Version 2.00.16
· FIXED: Word constant as SUB or FUNC parameter is not counted as 2 bytes
[noparse][[/noparse]EDIT] Mar 26, 2009 Postsed version 2.00.17
Version 2.00.17
· FIXED: FUNC cannot have 5 parameters "STOAB FUNC 1,5,5"
[noparse][[/noparse]EDIT] Mar 26, 2009 Posted version 2.00.18
Version 2.00.18
· FIXED: negative constants as SUB parameters (assumes positive < 256)
[noparse][[/noparse]EDIT] Apr 1, 2009 Posted version 2.00.19
Version 2.00.19
· FIXED: SUB 5,5
[noparse][[/noparse]EDIT] Apr 11, 2009 Posted version 2.00.20
Version 2.00.20
· FIXED: localWord = WordFunc ' __PARAM0 error
·[noparse][[/noparse]EDIT] Apr 17, 2009 Posted version 2.00.21
Version 2.00.21
· FIXED: RCTIME timing was off by 2 cycles per loop
[noparse][[/noparse]EDIT] May 11, 2009 Posted version 2.00.22
Version 2.00.22
· FIXED: COUNT using a WORD variable for result
[noparse][[/noparse]EDIT] May 11, 2009 Posted version 2.00.23
Version 2.00.22
· FIXED: CRASH on SUB definition
[noparse][[/noparse]EDIT] May 13, 2009 Posted version 2.00.24
Version 2.00.24
· FIXED: localWord = localWord SHR localByte ' "INC FSR" and "DEC FSR" are swapped
· FIXED: localWord = lsb,msb ' Only lsb is set
[noparse][[/noparse]EDIT] June 8, 2009 Posted version 2.00.25
Version 2.00.25
· FIXED: PUT var1, var2 to var3 ' Lowercase "to" didn't work properly
[noparse][[/noparse]EDIT] June 15, 2009 Posted version 2.00.26
Version 2.00.26
· FIXED: W = byteVar OR byteVar
· FIXED: W = byteVar - byteVar
[noparse][[/noparse]EDIT] June 26, 2009 Posted version 2.00.27
Version 2.00.27
· CHANGED: Word subtractions leave carry correct when finished (PJV)
· CHANGED: WORD division added "SZ" to avoid incorrect result 1 / $FF02 = 1 should be zero
[noparse][[/noparse]EDIT] July 13, 2009 Posted version 2.00.28
Version 2.00.28
· ENHANCED: Conditional compiler directives can now be nested (32 levels).
· FIXED: wordVar = Const - Const ' Should NOT do the math
[noparse][[/noparse]EDIT] July 16, 2009 Posted version 2.00.29
Version 2.00.29
· FIXED: Bug introduced in 2.00.28 with WordVar = WordVar - Const
· FIXED: WordVar = WordVar + Const > 255
[noparse][[/noparse]EDIT] July 31, 2009 Posted version 2.00.30
Version 2.00.30
· ADDED: TASKS INIT [noparse][[/noparse], MAXTASKS]
·········· Sets up TASK variables so you can place TASK RUN after TASKS SET
· FIXED: On SX48 TRIS_A = localbyte generated an error
· OPTIMIZED: localbyte = Register (Doesn't use PARAM1 now)
[noparse][[/noparse]EDIT] April 8, 2010 Posted version 2.00.31
Version 2.00.31
· FIXED: WordVar1 = Const - WordVar2
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134
March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
Post Edited (Bean) : 4/9/2010 1:23:57 AM GMT
Comments
Try to guess what it will do before you run it...
You can run this in SX-Sim if you change "TASKS RUN,100" to "TASKS RUN,1" and uncheck "Check RETI" in SX-Sim. Make sure you have the I/O panel open.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
Post Edited (Bean (Hitt Consulting)) : 1/29/2009 1:55:56 AM GMT
I have a few comments off the top of my head about some big differences that could "trap" you, esp. if re-compiling an old SX/B program in 2.x:
- the startup code is much different and much shorter, and the power-up vs. reset handling is different.
- locations of pseudo-shadow registers for saving/restoring __PARAM variables during interrupts have moved; if you have hand-defined memory locations in an older program, check the locations on re-compile (if it matters vis a vis bank numbering, etc)
You may want to duplicate or copy your existing SX/B 1.5x compiler so you can switch back. The 1.51x compiler is online, but it can be very useful to quickly switch back and forth when necessary.
There are enough new features that I would hazard to guess the beta testers and Bean himself each have their "favorites", in the sense of what has proven to be the most useful, or coolest or whatever. For some, tasks are the niftiest thing. Ditto local variables for subs/funcs. IFUSES seems to be popular with folks who have large included libraries. I've been leveraging larger arrays, Word assignments in any locations, the freeing of registers if NOCODE/NOPRESERVE is used, top down banking (for code optimization), and all the new "primitive" commands like GETBIT, PUTBIT, CREAD, I2CSPEED and I2C clock-stretching compatibility, etc.
In any case, remember it's a public beta -- not a "perfect" release, so have a heart vis-a-vis Bean's workload and Jon's documentation-in-progress.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
Post Edited (Zoot) : 1/28/2009 7:43:45 PM GMT
Ken Gracey
Parallax, Inc.
I've started simple so far :
If you have a WORD data type and add one to it the code generated is:
· ADD seconds_LSB,#1 & 255······ ;··· seconds = seconds + 1
· ADDB seconds_MSB,C···········
· ADD seconds_MSB,#1 >> 8······
the simple and easy optimisation is that you check for the high-byte of the second constant add being zero. If it is (it often will be) then you save two words (33%)
If you wish to get really cute you can special-case the increment case (it isn't that rare - consider i++) and us
· inc seconds_lsb
· addb seconds_msb,z
I don't know to what extent performance really matters - but I figured 50% on a common case might be worth it ...
HTH
David
If you use "INC seconds" in SX/B I think you will get the optimized code.
But your point is valid, that "seconds = seconds +1" could check for "+1" and generate the INC code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
It also seems to be more efficient in memory space:
I've compiled the same program with the two SX/B revisions
SX/B v. 1.51.03: program size = $FD2
SX/B v. 2.0: program size = $F95
The difference (61 words) is a lot of saved space for the SX chip.
Just one comment: It would be nice to add a directive that allows the compiler to clear the watchdog timer in the time consuming commands.
For instance, when the watchdog is enabled, commands like serin with no (or long) timeout cannot be used "as is", otherwise the watchdog resets the SX.
Paolo.
Another place we often found juice was in loops ... it is harder (I don't know if your compiler is one pass or two pass) but the case of a FOR loop where the loop variable is not used (or changed) can be treated specially. You can load the UPPER bound into the index variable and then use djnz; saves a couple of words and makes the loop faster.
Start:
mov no,#10
loop:
djnz no,Loop
I've had a look at the code for the WORD case ... I'm pretty sure there was a trick there too ... but I cannot presently remember it (senior moment - sorry [noparse]:([/noparse] )
David
Secondly, Bean -- I did not think pure optimization was your goal (or we'd have AUTOBANK ON|OFF and AUTOPAGE ON|OFF -- heh heh), though it seems you always have an eye towards optimzation ... ???
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php
It is a one-pass compiler.
We try not to use any "tricks" in the compiled code so it can be easily followed by assembly newbies.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
With regard to your point about the step bounds and method; provided the variable is not being used they are irrelevant - you can pre-compute the number of iterations that will occur and set your outer variable accordingly.
In fact the savings in the case you mention are even higher as a -3 is much more expensive than an INC.
I don't think top-down (recursive decent) or bottom up (lalr et al) is really the issue. It comes down to whether they compile into some kind of intermediate representation and then generate code or whether they generate the code 'line-by-line'. If the latter then this form of 'global' optimisation is almost impossible - if the former then it is relatively easy.
David
"Clarity is king" for us newbies. Clarity, leading to ease of use and almost instant use, is also what made BASIC the most popular language on this particular planet.
Everything that can be done to make assembler clear is a step in the right direction. In many cases, speed of execution should be sacrificed for clarity for it does no good to be fast if no one uses it due to the fact that it is difficult to learn. (Pardon the double negative!)
It may be sacrilege, but I cannot help but believe the Propeller will never Spin financially due to the very issues mentioned above.
Pardon my newbie preaching on this particular issue. But, in the broad sense of programming, a newbie I ain't.
Great work.
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
However [noparse]:)[/noparse] given I finally remembered I will just note the 2 word for-loop 'trick' - where you do -
MOV seconds_LSB,#1 ; for seconds = 1 to 1000
CLR seconds_MSB
__FOR_seconds_1:
INC seconds_LSB ; next
ADDB seconds_MSB,Z
CJB seconds_MSB,#(1000 >> 8),@__FOR_seconds_1
CJA seconds_MSB,#(1000 >> 8),@__NEXT_seconds_1
CJBE seconds_LSB,#(1000 & 255),@__FOR_seconds_1
__NEXT_seconds_1:
you can -
mov no1,#4
mov w,#1000-3*256+1
skip
oloop:
mov w,#255
mov no,w
loop:
djnz no,Loop
djnz no1,oloop
saves about 50% of the code and reduce timings somewhat ....
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Shawn Lowe
When all else fails.....procrastinate!
Post Edited (Shawn Lowe) : 1/30/2009 6:33:54 PM GMT
Thanks so much, really enjoying reading about sx/b 2.0. The STR and TASK commands are just %$#@ awesome!!!
I found a small (but confusing) typo in your PDF. It is on page 10.
For the "GET and PUT command examples you have this same sentence twice:
"And you want to put values from an array into these variables. You can now use:"
I think one of those should say get instead of put [noparse]:D[/noparse]
Post Edited (T'Saavik) : 1/30/2009 12:14:40 AM GMT
I actually saw a typo or two in there myself. I'll give it a once over before I post the next update.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
You are correct it is the 'seasoned veterans' who are most likely to spot genuine problems in the products core capabilities; however it is the 'newbies' who are most likely to spot defects in usability, documentation and examples.
In fact it is generally deemed good practice in the compiler world to insist upon at least a few 'virgins' to be included in the beta phase as they are the ones most likely to unearth problems in the 'out of the box' experience.
David
· I don't mind if you want to post them in this thread.
· Suggestions and comments are welcome, demands are not
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
·The next time you need a hero don't look up in the sky...Look in the mirror.
·
Well, I REQUEST to know why JonnyMac charges nothing for this variable in an SX28 but wants ten bucks for it in an SX48! [noparse]:)[/noparse]
--Bill
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You are what you write.
The advantages of having your stack go DOWN (rather than up) are -
a) One local variable per procedure can be accessed without adding an offset
b) If ever you want to check for stack underflow you are checking against 0 which is cheap
c) For the user debugging the variable offsets go from 0 -> n rather than from $2f->$2f-n
You may also wish to consider giving yourself NAMED (rather than enumerated) parameters to a subroutine; and then automatically copy them in at subroutine startup ... eg
get_button func(byte button),byte
func get_button
'implicit button var byte declaration
resu var byte
'implicit button = __PARAM1
resu = Buttons >> button
resu = resu & 1
return resu
endfunc
Maybe this just isn't very BASIC [noparse]:)[/noparse] <Spot the aging Pascal programmer [noparse]:)[/noparse] >
David
However I think it may be better suited to an IDE change rather than a compiler update.
I'm not sure who made the IDE so I'll just give my suggestion and see if it can be attempted.
Is it possible to be able to realias some of the operators and syntax to better customize the IDE/language to each user?
For example, I'm repeatedly attempting to use ( and ) for my if statements and attempting to use [noparse][[/noparse] and ] for array elements.
Using <> for NOT instead of != is also an issue of minor annoyance for me.
Is it possible to make some kind of preprocessor macro or IDE configuration available to allow us to realias such things to better
suit programmers of other languages?
I'm not complaining, I'm just making a request.
JonnyMac: I completely understand what your saying and I will refrain from making suggestions for things I only half understand
in the future.
-- You would still be limited to at most 16 bytes per subroutine though
Now... just to demonstrate that I'm gifted and can talk out of both sides of my mouth (grin), SX/B does have a few operators that do the same thing, & and AND, for example -- maybe adding a few more is not out of the question. The possible danger, however, in adding C-like operators is that C programmers may want to start doing things like:
tmpB1 = tmpB1 + tmpB2++
Even if SX/B supported the post-increment operator this would be illegal in SX/B as SX/B only supports one expression per line.
Keep in mind that Bean controls the compiler -- I just put it to use and have a great time!
a)
Normally when an array in indexed you obviously have to restore the bank register afterwards (which you do with BANK 0).In the particular case where someone has @d the array after the zeroeth bank - ie -
ports var byte(3) @$05
you don't need to do the restore
b)
Presently you auto-spot an array index being used on the left and right and side of an equals and common up the index computation (very nice). eg -
Ports(MyIdx) = Ports(MyIdx) | Value
Unless Value is a constant you·temp-store it before the index computation (in _param1). You are obviously concerned that accessing Value from a variable will screw up the IND register you are computing. However, if the value is a variable from the first 32 bytes you can perform the same optimisation that you do for the constants. This saves you two instructions.
David
I read the below in·the instructions for installing SX/B 2.0,
"Unzip the attached file. Put the files in your C:\Program Files\Parallax Inc\SX-Key v3.2.92\Compilers\SXB directory (overwritting the existing files)."
Will this overwrite my current version of SX/B 1.50?
I'd like to keep SX/B 1.50 while learning 2.0
Alex
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If at first you don't succeed, then skydiving is not for you.
Remember also that the current non-beta release is always available in a sticky thread at the top of the SX forum, so you can always download whichever one you want and use it even if you don't have a local copy.
Note that the current non-beta release is 1.51.03, not 1.50
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
1uffakind.com/robots/povBitMapBuilder.php
1uffakind.com/robots/resistorLadder.php