Problem with SX/B Compiler
A simple little program as follows:
Compiling with SX-Key v3.2.3 (the latest version, under Windows XP) comes up
with this error message:
foo.SXB(54)Line 16, Error 16, Pass 1: UNKNOWN COMMAND "LET".
Oh really??? I thought it might be the LE in LED1 bringing up the "LET"
so I changed all LED1's to LAD1 and I get the same error message. <sigh>
The SX/B compiler seems to be a little loose on compiling as I've had
other strange things happen like undefined variables being permitted by the
compiler only to have the assembler burp on an undefined symbol called <TEMP>
(which I don't use in my code). I'll report them when I find 'em as I start my
adventure into SX/B coding.
What's up?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = AE5AE = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
001 DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
002 FREQ 4_000_000
003 ID "Foo"
004
005 Program Start
006
007 LED1 VAR RB.0
008
009 FOO VAR BYTE
010
011 Start:
012 FOO = 165
013 RANDOM FOO
014
015 Main:
016 LED1 = FOO & 1
017 PAUSE 500 ' delay
018 RANDOM FOO
019 GOTO Main ' repeat forever
020
021 END
Compiling with SX-Key v3.2.3 (the latest version, under Windows XP) comes up
with this error message:
foo.SXB(54)Line 16, Error 16, Pass 1: UNKNOWN COMMAND "LET".
Oh really??? I thought it might be the LE in LED1 bringing up the "LET"
so I changed all LED1's to LAD1 and I get the same error message. <sigh>
The SX/B compiler seems to be a little loose on compiling as I've had
other strange things happen like undefined variables being permitted by the
compiler only to have the assembler burp on an undefined symbol called <TEMP>
(which I don't use in my code). I'll report them when I find 'em as I start my
adventure into SX/B coding.
What's up?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = AE5AE = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
Comments
Led1 = foo.0
... because any bit ANDed with 1 will remain unchanged, therefore you can simply copy the target bit to the output LED.
Please DO post any errors you get with the compiler. We will try to explain and/or correct them.
Bean.
Post Edited By Moderator (Chris Savage (Parallax)) : 11/2/2007 3:46:08 PM GMT
that generated the message about an undefined symbol, <TEMP>.
Still, that error message about an unknown command "LET" could
sure be a tad more informative. :-\
Let me take this a little further -- how would I assign the low three bits of 'foo' to the
low three bits of an I/O port, say RB?
Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = AE5AE = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
Post Edited (Fe2o3Fish) : 11/1/2007 3:47:08 PM GMT
RB = foo & %00000111
or, if you didn't want to disturb the other bits of RB, then:
RB.0 = foo.0
RB.1 = foo.1
RB.2 = foo.2
or, here's another way:
tmpB1 = foo & %00000111
RB = RB & %11111000
RB = RB | tmpB1
a SX/B-specific syntax for doing the three bits.
(note to self: think RISC when doing SX/B programming)
Thanks John^H^Hn!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock = AE5AE = rusty@fe2o3.lonestar.org
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking