Shop OBEX P1 Docs P2 Docs Learn Events
Assembly Language for the Basic Stamp 2 Series? — Parallax Forums

Assembly Language for the Basic Stamp 2 Series?

Walts_WorkerWalts_Worker Posts: 5
edited 2014-06-22 07:01 in BASIC Stamp
Hello... Maybe you'v received this question before...

I was wondering if there is an assembler that uses and accepts assembly language instructions for the Basic Stamp 2 series?· Also, is there an Assembly Language instruction set?· The biggest one... Can I have access to them? yeah.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I am different, I knew that long ago.· I give everyone the trust and respect that's due to them as a human and possible friend.· They build or tear away at that by what they say and do.

Night`Wolf :--)

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-19 06:11
    It is not possible to program stamps in assembly, to do that you would have to use an SX (SX/B is a PBASIC like language for non-assembly portions)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-12-19 14:31
    In other words, YES there is an Assembly Language Instruction set. Please refer to SASM documents is the SX-Ubicom section. And it is free. You can download the programing software too and much of the documentation.

    The tuturial books are available, but you will have to consider purchasing at least Gunther's and I am not sure it Al Williams' is free or not.

    NO it is not possible to direct program a BasicStamp with it, BUT you can easily program an SX-28 or SX-48 and this will cost far less than the BasicStamp and with speed and effiencies beyond the BasicStamp product line.

    BUT, you need to buy an SX-Blitz or SX-Key Programing device to actually program the chip.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-12-19 15:56
    Well, the BS2 is implemented using a PIC processor -- I keep forgetting which one. However, that PIC processor has been pre-programmed with a PBasic language instruction interpreter. Thus there is no way to get access to the assembly language interface in the BS2 PIC.

    Now, Parallax does make available the Ubicom SX-28 (and -48, and -54) processors, so you CAN program in assembly if you like, and they make available the SX/B IDE for the SX processors, which accept a PBasic like syntax and compiles into straight assembly, so you can use that.

    Bottom line -- the PBasic language has been designed to be simple and easy to use, and reasonably efficient on its PIC processor, and very very reliable. There's lots of other assembly-only resources, and higher-level language compilers for the PIC processor -- but they all have a higher cost of entry.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-19 16:35
    Gents -

    Just as a matter of clarification, one additional point should probably be made. PBASIC is an interpretive language, and as such has no native code (machine executable instructions) per se, which can be directly executed on the underlying processors; be it a Microchip PIC processor, or a Ubicom SX processor.

    As is the general case with many interpretive languages, p-codes (pseudo-operation codes), or "tokens" are constructed by the Compiler/Interpreter or Stamp IDE in this case, and these p-codes are eventually passed to the execution time interpreter engine, which acts on these p-codes in a pre-determined manner. There are many "sets" of extremely dynamic routines and sub-routines contained with the interpreter engine. These are essentially invoked by the content and sequence of the p-codes, and will reflect the operation of the program, as the programmer has planned it in his program.

    Thus, it is the runtime engine which is actaully handling the execution of the commands, and the commands being executed are a sub-set (the p-codes) of the human readable source code which the programmer has written and compiled. Both the tokens and the runtime engine are proprietary products of Parallax.

    As you can see from this process, at no stage is there any assembler language, or even directly executable binary code. Due to the nature of the process, in that it can be multi-step, transportable object codes are possible and they can be stored on disk and even distributed, for later execution. By this manner, field upgrades can be sent out, without the fear of disclosure of the original human readable source. It is indeed, the best of all worlds for an interpretive system!

    I hope that adds some clarity to the process, and doesn't cause more confusion.

    Regards,

    Bruce Bates
  • Walts_WorkerWalts_Worker Posts: 5
    edited 2005-12-20 21:51
    Wow, thanks to each and everyone of you for the information! You see... I was "Born and raised" on Assembler language and am use to the "Full Control" you have with them and am not use to the difficulties of higher level languages. I started with the 6502, 8088, 8086, Z80 etc. Then I found the 8048, then the 8051, then the 8096! Now I've found "The Stamps!" And they're very nice... Though I have looked at the SX's and they're even nicer! The problem I've been having is with the "Assembler" or "Compiler"(?) as the 'help manuel' says to do it one way, but then you find out that the "Compiler?" says it's wrong and is expecting something else... [noparse]:([/noparse] We'll... Life is all about adaptation... So I'll guess I'll have to adapt for a while[noparse]:)[/noparse] I really wish I could have Assembler again... I'm use to having the complete format and especially the complete control thingie[noparse]:)[/noparse]

    Thanks again,

    Walt's Worker
    CSC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I am different, I knew that long ago.· I give everyone the trust and respect that's due to them as a human and possible friend.· They build or tear away at that by what they say and do.

    Night`Wolf :--)
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-20 22:13
    If you use our SX microcontroller, you can program it in any manner you like: assembly (native - free), BASIC (SX/B - comes with IDE, also free), and soon we'll have a low-cost C compiler for the SX as well. We have a couple good books on assembly language programming for the SX, and one (by Al Williams) is available as a free download.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-12-20 22:41
    Im not sure what you mean about the inconsistancies between help files and the compiler, there are two compilers, but you should use SASM (PASM is the old Parallax compiler), also theres a difference between assembly compilation and the SX/B. If you are trying to write assembler inside SX/B you need to demark it as such (like you do when embedding assembly in other high level languages). But if you are in assembler mode of of the IDE, you can write your programs in straight up assembly. Also with the new version of the IDE they weight heavily on explaining the Basic portion in the help files, but omitted the assembly. Refer to the SX User's manual in the downloads section for info on the assembly commands availible, or Gunther's book.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·1+1=10
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2005-12-21 17:31
    Also note that the SX chips and Basic Stamps don't use the same compiler, they are seperate downloads.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-12-21 18:49
    Thanks for pointing that out -- the IDEs are indeed different. The BASIC Stamp IDE only does PBASIC, the SX-Key IDE will allow one to program in assembly or in SX/B (BASIC).· Note, too, that programming the SX requires an SX-Key.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Kevin WoodKevin Wood Posts: 1,266
    edited 2005-12-22 04:48
    .I guess it wouldn't be too bad to mention that the SX-Key IDE includes SXSIM, an SX simulator that allows you to get started learning assembly without the hardware. There is a sticky post with details on the latest version.
  • GenesisGenesis Posts: 42
    edited 2005-12-22 05:22
    As an "old-time assembly language guy" I'm finding it interesting to say the least programming the BS series......

    It is both damnedly easy and damnedly frustrating. For many things though it allows prototyping and development speeds that I could only DREAM OF when I wrote in assembler....

    They're very different beasts.....
  • kramnotrubkramnotrub Posts: 1
    edited 2014-06-20 13:45
    Go get yourself a PIC 16F57 (used by the BASIC Stamp) and program it with assembly.

    Here is the PIC 16F57 instruction set. http://ww1.microchip.com/downloads/en/DeviceDoc/41213D.pdf
  • ercoerco Posts: 20,256
    edited 2014-06-20 14:00
    Welcome to the forum and thanks for your most helpful reply, kramnotrub!

    Unfortunately, the OP is long gone; this is an old thread is from 2005. Shows how durable these posts are! :)

    Please keep posting, this is a friendly and helpful forum.
  • pilot0315pilot0315 Posts: 876
    edited 2014-06-21 16:57
    Does any one know of some books on assembly language that are relatively easy to understand
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-22 07:01
    Well, books on Assembly language tend to address just one product or group of products.

    The smaller micro-controllers tend to be a shorter story and easier to understand. Guenther's book for the SX chips was wonderful for me. I even have two copies (one really beaten up by use and a clean unused copy).

    You might be able to buy that in out-of-print books, but you would also need the SX-Key for programing and some SX chips.

    http://www.abebooks.co.uk/servlet/BookDetailsPL?bi=11096260035&searchurl=kn%3DPARALLAX%26amp%3Bsts%3Dt%26amp%3Btn%3DpROGRAMMING%2Bsx

    http://www.sxlist.com/techref/ubicom/index.htm

    I mention it first because it is a Parallax product though officially at End of Life.

    ===========

    The second choice from Parallax is the Propeller chip and all the free material written for the Propeller's PASM.

    http://forums.parallax.com/showthread.php/132966-Propeller-Assembly-for-beginners

    http://propeller.wikispaces.com/Assembly+Programming

    +++++++++++++++
    If you want something other than Parallax products, like a PIC... you have to Google around for other choices. If you want to do AVR, like the Arduino.. it could be very demanding.
Sign In or Register to comment.