New user of SX/B compiler -- question
nonny
Posts: 8
Hello:
Just hooked up the SX/B kit and trying out the compiler.· I have a Basic STAMP2 program that
I had previously used to record a pulse train from a SONY CD Jukebox.· I thought this might be
a good test for trying a working program in the SX/B compiler.
However, I cannot get a successful assembly because the compiler continues to give me errors
on a statement that follows exactly the model shown on the documentation, to wit:
SIO······ Var········· RC.7
In addition, even though I have entered:
············reset········start
start:·····GOSUB······read_ir
It continues to say that start is "not defined"
Can anyone suggest a way around this?
nonny
·········
Just hooked up the SX/B kit and trying out the compiler.· I have a Basic STAMP2 program that
I had previously used to record a pulse train from a SONY CD Jukebox.· I thought this might be
a good test for trying a working program in the SX/B compiler.
However, I cannot get a successful assembly because the compiler continues to give me errors
on a statement that follows exactly the model shown on the documentation, to wit:
SIO······ Var········· RC.7
In addition, even though I have entered:
············reset········start
start:·····GOSUB······read_ir
It continues to say that start is "not defined"
Can anyone suggest a way around this?
nonny
·········
Comments
change to:
start:
· GOSUB read_ir
Bean.
Fixed that one quickly. Thanks for the fast response.
nonny
is on it's own line.
I misread the error statements at the bottom after the new assembly.
nonny
Bean.
I just noticed that you used "reset start" for SX/B use "PROGRAM start"
Bean.
with the " PROGRAM start" is still highlighted and the error
line is reproduced at the bottom.
Thanks for your help.
nonny
; Simple program to read Sony pulse train
; from CD Jukebox player. Working program
; originally used on Basic Stamp2
; adapted for SX28.
device SX28L,turbo,osc4mhz,bor42
IRC_CAL IRC_SLOW
freq 4_000_000
PROGRAM start ;goto 'start' on reset
org 0
irsense var RC.7
irinput var IN0
irstartlow con 1100
irthreshold con 450
irstarthi con 1300
raw var Byte(28)
start var Byte
value var Byte
index var Byte
start:
GOSUB read_ir
DEBUG ?value
STOP
GOSUB dump
.
.
.
C:\Parallax\SX-Key\readonlySRC(12)Line 12,Error1,Pass 1: Bad instruction statement
· Have you looked through the SX/B help file ?
· Jon has written several very good examples.
Here is what I can see right-off-the-bat.
In SX/B the apostroe is the comment symbol not the semicolon.
There is no DEBUG command in SX/B, use SEROUT
IN0 is not a pin
STOP is not an SX/B command. Use END
ORG is not as SX/B command. Use ADDRESS if needed (but you don't need it, SX/B handles it)
Also you don't show where you are using the constants, but most commands only allow BYTE size values.
Bean.
Post Edited (Bean) : 2/2/2005 2:17:34 PM GMT
I have the SX/B option checked on SX-Key v3.0 that I downloaded from Parallax home page.
There didn't seem to be any SX/B compiler on the CD I got with the ordered SX/B kit, so I downloaded
the one suggested by the home page. Now after making the changes you suggest, I get a ton of errors.
I realized that not every PBasic instruction in the STAMP2 program would necessarily conform to the SX/B
compiler, but I just wanted to see how far compatibility would go --- or am I wrong in assuming that the
SX/B compiler would accept some PBASIC commands?
Maybe I had better start over from scratch...............
nonny
I have been using RUN then ASSEMBLE but it appears that it is another compiler
since it insists that ";" is the comment prefix. All the other commands bring up
the same compiler. Evidently, that is the problem. I have searched the CD I
received with the SX/B kit, but the only compiler there is not the SX/B one.
I asked for help from the PARALLAX website to get the SX/B compiler and they
listed a link which downloaded the same compiler, only a newer version 3.0.
The IDE has the SX/B help files, examples, etc., but I apparently there is no
way to invoke the SX/B compiler, or at least, nothing obvious to me.
I must be doing something completely idiotic here -- can anyone give me the
procedure to get the SX/B compiler activated?
nonny
You MUST use version 3.0 of the IDE to use SX/B.
You can download it from the parallax website.
From the FILE menu choose "NEW (SX/B)"
When you hover over the compile icon on the toolbar the popup should say "compile" instead of "assemble".
Bean.
Post Edited (Bean) : 2/2/2005 6:58:47 PM GMT
You can't find the SX/B compiler because it's built into the SX-Key IDE executable. When run the SX-Key 3.0 or higher for the first time, it looks for the SX/B compiler on disk. If it doesn't find it, it tells you it is going to install it. The default installation will be in:
C:\Program Files\Parallax Inc\SX-Key v3.0\Compilers\SXB
Go look for it on your hard drive. The IDE checks for the presence of the SX/B compiler every time it starts up. If it finds the directory but not the program, it will tell you. If the compiler should be updated, it will offer to update it
In order to have installed the SX-Key IDE, you already had to have answered some of these dialogs. If SX/B wasn't installed, it would tell you everytime you ran the program. I have attached a couple of the dialogs that the IDE shows regarding SX/B.
As for invoking it, you don't have to do anything more complicated than make sure that you have choose to start an SX/B project. If you load an existing piece of SX/B source, an SX/B editor will automatically be created for it. When you click the button for a new editor, the IDE will tell you which is the current default and offer to let you have that style or the alternate. I have attached a dialog that show this as well.
Depending on which type of editor you are looking at, going to the "Run" menu will display either "Assemble" or "Compile" depending on which type it is.
I would assume that would have already encountered one or more of these dialogs.
Thanks, PeterM
PS - If you decide that the standard file extensions of ".SRC" for assembly and ".SXB" for SX/B files aren't to your liking and decide not to use them, then the IDE won't know what type of file it is when it's loaded. Don't change them
I just installed SX-Key 3.0 this morning. It was the first time SX-Key was installed on my system. I do not recell receiving any of those dialog boxes, and yet SX/B was installed. Is it possible that the dialog boxes only are displayed during an upgrade from a prior version?
Jim
It works on new installs or updates. I just tested it by running on a VMware machine running Win98 (where the SXKey had never been installed) and the very first message that comes up is that the IDE will install SX/B. Have you run the program yet? The messages don't come from the install program, they come from the IDE itself.
If you want to test this, try renaming the SX/B directory to anything else and then run the IDE. You'll get a dialog telling you that SX/B is missing and that it will be installed. Deleting the SX/B directory or the SX/B executable will give the same results. There are similar messages for the SX/B help file.
Thanks, PeterM
Just to double check myself, I deinstalled SX-Key. I also went through the registry and cleaned up a whole bunch of stale entries related to SX-Key. I then reinstalled it, accepting all the defaults. I ran SX-Key, and accepted all the defaults for initial start up. Note: I did not change the SX/B - SASM option from the default SASM setting. I then loaded and compiled a sample SX/B program. Nowhere did any of the dialog boxes about SX/B appear. And yet it is installed and seems, to function fine. I say seems to because I haven't actually ordered an SX system yet. A minor little detail about money, or something like that.
Jim
Please do me a favor and try the following:
1 - Go into the following directory and delete the "\SXB" directory
C:\Program Files\Parallax Inc\SX-Key v3.0\Compilers\SXB
2 - Run the version 3.0 SXKey IDE
3 - Tell me if any dialogs appear
4 - Tell me if the "\SXB" directory re-appears on your hard drive and has the SX/B compiler and help files in it.
Thanks, PeterM
I deleted the SXB directory and then ran the IDE. The dialog boxes received were:
1) Preparing to install, followed by a variant with a progress bar.
2) The error dialog attached.
I searched my system and there was no file named "SX-Key Editor v3.0.msi" to be found. I then of course could not continue so I pressed cancel.
3) I received the second attached dialog box.
I clicked ok and the process played around with the installation in progress dialog box and progress bars for another couple seconds then ended. Afterwards there was no SXB directory, nor was there a "Compilers" directory either. I did not delete the Compilers directory, the failed install process did.
Let me know if you'd like another testing done.
Jim
Sorry, you need to open Explorer and double click on the executable itself. I'm not sure what voodoo the Parallax installer is doing, but if you use the shortcut created by the installer, Windows invokes the installer again instead of just running the program.
Thanks, PeterM
When I double clicked on the actual executable (sxkey.exe), the SX/B install dialog boxes are display and the SX/B directory and associated subdirectories and programs are create.
So it will recreate, and I suppose automatically update, the SX/B compiler, but only if the user runs the sxkey.exe without any arguments. This is most unlikely unless specific instructions are given to do so. Most users will simply click the icon on the desktop or select it from the Start menu as I did.
Hope that helped. Let me know if there is anything else I can do.
Jim
Actually, it has nothing to do with running the SXKey without arguments. If you create your own shortcut from the executable itself, running that shortcut will do the exact same things that running the executable itself will do.
Thanks, PeterM
After deleting the SXB directory, I ran SX-Key by selecting the icon that the install process placed in the "Start" menu tree. This is appears to be nothing but a shortcut to the sxkey.exe. So I don't understand how running sxkey.exe from the explorer is different that running it from the Start menu. But after much experimenting it is clear that there is something funky about the shortcut that the installer process creates. Any number of various forms of manually created shortcut will cause the SXB directory to be recreated. Whereas the default icon will not.
I can see where this will cause some consternation on the part of a user if they are told "Just run SK-Key and it will recreate the SX/B compiler for you." Using the default installed environment, it won't.
Jim
Do a "properties" check on the shortcuts created by the installer and a shortcut you create for the SXKey IDE. You'll see that the installer shortcuts are not "normal," since you can't edit the target or icon, and you can't get the properties page to show you the target. I have nothing to do with the installer, so a lot of this was news to me as this thread developed.
I need to contact the Jeff at Parallax again and ask him a few more questions. In any event, all of this began with a user trying to invoke the SX/B compiler and wondering where it was since he couldn't find it on the original CD. The short answer is still, "It's installed automatically and you invoke it by creating an SX/B project and hitting the "Compile" button."
As for the rest of this, well it's all interesting stuff...
Thanks, PeterM
Yup, that's what I meant about something being "funky" about the installed shortcuts.
But you're right. The key part, no pun intended, is that SX/B is auto-magically installed with 3.0 and the user doesn't need to do anything the use it.
Jim
a lot of manipulation of the source document. It still insists on treating the source document as an assembly
source unless I continue to re-save it with an SXB extension until the extension "sticks".
After creating the source document with the editor, the automatic save seems to always put an SRC extension and that extension must invoke the assembler instead of the compiler.
Needlessly to say, creating an SX/B document and then invoking the compiler doesn't seem to be a very intuitive
or simple process. It can be worked around, but without some knowledge of "internal manipulation" it would be
frustrating for a novice user.
I may have missed a step or something in installatiion, but I can't seem to get automatic SX/B operation. I have
simply reverted to all assembly programming.
nonny
When you reinstalled, did you deinstall first, or just rerun the installation. In my experimentations with sx-key I deinstalled the old version using the control panel's add/remove programs. Then I reran the installation and it "just works" using all the defaults. A couple of questions.
If you click on the new document icon (it's the first icon on the tool bar, looks like a blank sheet of paper) do you get a dialog box prompting you about the language type? Granted the phrasing of the question, and the yes/no buttons are non-intuitive, but if you just follow the prompt and click "No" for SX/B, it should create the new file as an SX/B source. Clicking the save icon (third from left on tool bar, looks like a floppy) should automatically save the new program with an .SXB extension. This is how it works on my clean install of sx-key.
What happens when you attempt the above steps?
Jim
I will do as you suggest and report the results, however, I am in the midst of a time-insistant
project and will have to wait a few days to implement it.
I will download the newest version from the home page when I deinstall and then reinstall to
make sure I have the correct version.
Thanks again for the time and effort.....
nonny
I'm not entirely thrilled with the phrasing of those dialog boxes either. Got any suggestions? There's always another version of the IDE that will be released in the future...
Thanks, PeterM
Post Edited (PJMonty) : 2/7/2005 11:02:12 PM GMT
I know what is trying to be conveyed by the dialog box, but the "No" pick is kind of counterintuitive for me. The dialog boxes appears to be trying to be helpful, but what is the likelihood that a user will be creating both SASM and SXB interchangeably. (I don't know. I really wondering.) I can think of two alternatives that might be a little clearer.
The new source file will be the default editor type of Assembler.
If you wish to create an SX/B source please click cancel and select File, New (SX/B).
[noparse][[/noparse]Continue] [noparse][[/noparse]Cancel] [noparse][[/noparse] ] Don't show this dialog box again
Default editor type is Assembler.
You can also create an SX/B source file instead. The default can
be changed in the IDE parameters of the Configure menu option.
[noparse][[/noparse]SASM] [noparse][[/noparse]SX/B] [noparse][[/noparse] ] Don't show this dialog box again
Or words to the above affect.
In both of the above cases, if the user selects "don't show" clicking the new icon will automatically create a new source in the default type. I guess that would also mean that the "don't" show" option should be a parameter in the IDE section of the Configure screen.
I think the second choice is closer to what the IDE is doing now and will help the "click but don't read" crowd select the right choice.
Jim