Shop OBEX P1 Docs P2 Docs Learn Events
SX Programing — Parallax Forums

SX Programing

ArchiverArchiver Posts: 46,084
edited 2001-11-13 04:43 in General Discussion
Can Someone tell me how hard it is to learn SX? I am a newbe at
programing (PBasic only). I would like to learn more.

Thanks

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-11-12 17:47
    It isn't so bad. Check out my texts on SX programming that several
    schools use to teach SX assembly:

    http://www.parallaxinc.com/html_files/downloads/downloads_sx.htm (go to
    the bottom).

    Regards,

    Al Williams
    AWC
    * Your Stamp on the Internet?
    http://www.al-williams.com/awce/netporter.htm


    >
    Original Message
    > From: iamturbo2000@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=vTYRk99cbNJGigXqYBlGz2uILs5dsXGXQog5A_bk-mhOWN_IPossYEEUEkwFeNbnZxSAXF-eKbgboxdw]iamturbo2000@y...[/url
    > Sent: Monday, November 12, 2001 11:40 AM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] SX Programing
    >
    >
    > Can Someone tell me how hard it is to learn SX? I am a newbe at
    > programing (PBasic only). I would like to learn more.
    >
    > Thanks
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-12 21:33
    --- In basicstamps@y..., iamturbo2000@y... wrote:
    > Can Someone tell me how hard it is to learn SX? I am a newbe at
    > programing (PBasic only). I would like to learn more.
    >
    > Thanks

    Having done a lot of both, I think I can give some measure of the
    difference. The language itself (assembler language) is somewhat
    harder to understand and to write than Basic. You need to be MUCH
    more aware of the physical hardware you are using and exactly how it
    works. Much of this is hidden from you in a product like the Stamp. I
    would rate the language itself as maybe twice or three times as hard.

    The real issue for most beginners is that all the functionality you
    are used to having in a language like Basic, you must do yourself in
    assembler language. You can find some canned routines to do serial
    communication, for example, but you must adapt them to work for you
    in your program. Things like pulse outputs, communication with
    external devices, even doing math, require code that you write or
    borrow from somewhere. Only the most rudimentary operations are done
    directly by the SX processor. For example add/subtract of 8 bit
    values is all you get. Multiply/divide? Do it yourself. There are
    dozens of functions in Basic that have no direct equivalent.

    This means that you will be MUCH less productive in getting actual
    results in assembler than you will in Basic. I would guess a ratio of
    about 20 to one or more, in terms of useful functions provided per
    hour of work. And debugging of assembler can be notoriously difficult
    because you can easily destroy data anywhere in the processor with
    ease. I say all this, not to discourage you, but to make you aware of
    what you are in for, so you can decide whether it is worthwhile for
    the task you are trying to accomplish.

    What is the upside of assembler? Some types of functionality can ONLY
    be done in assembler because of the speed requirements. If your need
    is such that assembler is really a good fit, you may find some things
    can be run 10 to 100 times faster or more in assembler.

    For example, we sell a control board that was designed for model
    railroad use. One function of this system must read an input signal
    and selectively output an image of this signal to as many as four
    other pins. And it has to do this about half a million times per
    SECOND, while also doing full duplex serial communication and five or
    six other functions, all simultaneously. There is no way this could
    be done other than in assembler language.

    If you have a need for increased speed, but don't want to climb the
    assembler learning curve, there are some BASIC compilers available
    that will run somewhat faster than Stamp BASIC. I'm not sure if there
    is one that targets the SX chip or not, but there are BASIC compilers
    for PICs and Atmel chips, and C compilers for many chips. But be
    aware: compiled programs MAY run somewhat faster than interpreted
    programs (like we have in the Stamp), but the difference is not
    necessarily all that much. In some cases, a good interpreter on a
    fast processor will actually be better than a compiled program on a
    slower processor. And, in the limited arena where assembler must be
    used, nothing can even come close to it for speed.

    Chuck
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-13 02:35
    I agree with Al that is always valuable to get "under the hood" and learn
    assembly. But if you're facing a development product deadline, there are
    major advantages in investing in a C compiler which supports the SX among
    other microcontrollers.
    This is just my .02 after years of programing Assembly and now writing a lot
    of C/C++.
    Dennis
    Original Message
    From: "Al Williams" <alw@a...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, November 12, 2001 9:47 AM
    Subject: RE: [noparse][[/noparse]basicstamps] SX Programing


    > It isn't so bad. Check out my texts on SX programming that several
    > schools use to teach SX assembly:
    >
    > http://www.parallaxinc.com/html_files/downloads/downloads_sx.htm (go to
    > the bottom).
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * Your Stamp on the Internet?
    > http://www.al-williams.com/awce/netporter.htm
    >
    >
    > >
    Original Message
    > > From: iamturbo2000@y... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=h1NEkTh-pp01Gl7lTlpSXpcEMaPa1bYG-Nezh0V1gu2_yjERpYHoUVgmTgAk2JWCvtiffcxJaCUlmC_M_LjJu2Y]iamturbo2000@y...[/url
    > > Sent: Monday, November 12, 2001 11:40 AM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] SX Programing
    > >
    > >
    > > Can Someone tell me how hard it is to learn SX? I am a newbe at
    > > programing (PBasic only). I would like to learn more.
    > >
    > > Thanks
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > > from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-13 04:17
    Al, those books are great! I have learned much from them and really
    appreciate them and they can be downloaded for free.
    I myself though had knowledge of basic, C, Java befor I delved in and
    an extensive background in Plc logic (Allen Bradley and such), they
    all work hand in hand.
    As for the original question just read and take some time to do the
    examples and it will come to you. Much cheaper to buy an sx than a
    stamp. But I will confess, I use the stamp for rapid development
    when I need to see results now.
    Timothy Hosey
    E/EE Tech

    Thanks again Al for the great books.



    --- In basicstamps@y..., "Al Williams" <alw@a...> wrote:
    > It isn't so bad. Check out my texts on SX programming that several
    > schools use to teach SX assembly:
    >
    > http://www.parallaxinc.com/html_files/downloads/downloads_sx.htm
    (go to
    > the bottom).
    >
    > Regards,
    >
    > Al Williams
    > AWC
    > * Your Stamp on the Internet?
    > http://www.al-williams.com/awce/netporter.htm
    >
    >
    > >
    Original Message
    > > From: iamturbo2000@y... [noparse][[/noparse]mailto:iamturbo2000@y...]
    > > Sent: Monday, November 12, 2001 11:40 AM
    > > To: basicstamps@y...
    > > Subject: [noparse][[/noparse]basicstamps] SX Programing
    > >
    > >
    > > Can Someone tell me how hard it is to learn SX? I am a newbe at
    > > programing (PBasic only). I would like to learn more.
    > >
    > > Thanks
    > >
    > >
    > > To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@y...
    > > from the same email address that you subscribed. Text in the
    > > Subject and Body of the message will be ignored.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
  • ArchiverArchiver Posts: 46,084
    edited 2001-11-13 04:43
    Thanks Timothy. Be sure to thank Parallax for making so much material
    like this freely available.

    Al Williams
    AWC
    * Easy RS-232 Prototyping
    http://www.al-williams.com/awce/rs1.htm

    >
    Original Message
    > From: thosey@w... [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=dn5oY76lzXDs-74b_-lc4Enl0d21fclqILcH5WMbiuM5IsOPCe6H7QjmjnJTDit3iKCSW32BBxaVWkcFiVdxUw]thosey@w...[/url
    > Sent: Monday, November 12, 2001 10:17 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Re: SX Programing
    >
    >
    > Al, those books are great! I have learned much from them and really
    > appreciate them and they can be downloaded for free.
    > I myself though had knowledge of basic, C, Java befor I delved in and
    > an extensive background in Plc logic (Allen Bradley and such), they
    > all work hand in hand.
    > As for the original question just read and take some time to do the
    > examples and it will come to you. Much cheaper to buy an sx than a
    > stamp. But I will confess, I use the stamp for rapid development
    > when I need to see results now.
    > Timothy Hosey
    > E/EE Tech
    >
    > Thanks again Al for the great books.
    >
    >
    >
    > --- In basicstamps@y..., "Al Williams" <alw@a...> wrote:
    > > It isn't so bad. Check out my texts on SX programming that several
    > > schools use to teach SX assembly:
    > >
    > > http://www.parallaxinc.com/html_files/downloads/downloads_sx.htm
    > (go to
    > > the bottom).
    > >
    > > Regards,
    > >
    > > Al Williams
    > > AWC
    > > * Your Stamp on the Internet?
    > > http://www.al-williams.com/awce/netporter.htm
    > >
    > >
    > > >
    Original Message
    > > > From: iamturbo2000@y... [noparse][[/noparse]mailto:iamturbo2000@y...]
    > > > Sent: Monday, November 12, 2001 11:40 AM
    > > > To: basicstamps@y...
    > > > Subject: [noparse][[/noparse]basicstamps] SX Programing
    > > >
    > > >
    > > > Can Someone tell me how hard it is to learn SX? I am a newbe at
    > > > programing (PBasic only). I would like to learn more.
    > > >
    > > > Thanks
    > > >
    > > >
    > > > To UNSUBSCRIBE, just send mail to:
    > > > basicstamps-unsubscribe@y...
    > > > from the same email address that you subscribed. Text in the
    > > > Subject and Body of the message will be ignored.
    > > >
    > > >
    > > > Your use of Yahoo! Groups is subject to
    > > > http://docs.yahoo.com/info/terms/
    > > >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the
    > Subject and Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
Sign In or Register to comment.