Shop OBEX P1 Docs P2 Docs Learn Events
Microcontroller instruction set differences — Parallax Forums

Microcontroller instruction set differences

dufflingduffling Posts: 73
edited 2005-04-05 16:59 in General Discussion
Im currently learning to program the Sx in assembly ,

and recently looked at the PIC range of controllers ..
my question is :

I noticed some slight differences in some of the instructions comparing programs for the PIC and the SX

Is this a compiler difference , or the actual instruction set on the microcontroller ?

I Guess its normal to have to learn a slightly different set when working with different chips ..



·

Comments

  • kb2hapkb2hap Posts: 218
    edited 2005-04-04 11:35
    Its that way with all microcontrollers whether your using a PIC SX Atmel Motorola ect. There are alot of similiar instructions that do similar things...its assembly. You'll notice some differences like a setb in the SX compared to a sbi in the Atmels everyone may do it slightly different. Once you learn one, the learning curve for the others is much shorter.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • JonbJonb Posts: 146
    edited 2005-04-04 13:09
    I've read on sxlist that there are even programs to convert pic assembler to sasm... no clue how that works or how well it works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Post Edited (Jonb) : 4/4/2005 1:12:37 PM GMT
  • PJMontyPJMonty Posts: 983
    edited 2005-04-04 19:02
    JonB,

    Yes, SXList does have a convertor on the site. I have used it a couple of times and found it to be excellent. It's really handy when you find that perfect piece of PIC code and want to use it on the SX. Here's the URL:

    www.sxlist.com/cgi-bin/mpasm2sasm2.exe
      hanks, PeterM
  • KenMKenM Posts: 657
    edited 2005-04-04 19:32
    Too bad there is no converter to go from SX to PIC.

    I am currently working on a very simple project where the micro must be a dip package and 8 pins max.

    So I went to a PIC 12F509.

    As previously mentioned, the code nmenonics are similar.

    One glaring difference I do see however is documentation. The microchip spec sheet for the device had lots of information on what needs to be done, but little or no information on how to do it.

    This is where Parallax shines, the "how to" portion. Free easy to understand examples of "how to".

    $0.02
  • James NewtonJames Newton Posts: 329
    edited 2005-04-04 20:21
    KenM said...

    Too bad there is no converter to go from SX to PIC.

    There is an SX to PIC converter. It is called "ParaPIC" and was written by Tony Nixon years ago. It is a windows based app (can't be called from the command line) and it requires the use of the old Parallax assembler (havent tested it with SASM) to make a list file. It also has a few bugs and is generally a pain to work with.

    If you decide you want to try... the search on sxlist.com or google will be your friend.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    James Newton, Host of SXList.com
    james@sxlist.com 1-619-652-0593 fax:1-208-279-8767
    SX FAQ / Code / Tutorials / Documentation:
    http://www.sxlist.com Pick faster!



  • pjvpjv Posts: 1,903
    edited 2005-04-05 05:08
    Say PJMonty;

    Thanks a BUNCH for the code conversion link. It's exactly what I needed now!

    I just spent the last 3 days converting some math routines by hand, well actually it's not TOO bad using a spread sheet to sort, then make global grouped instruction changes, but is still takes a ton of time.

    This thing just converted 1800 bytes in one second! What a find!

    Thanks for sharing.

    I thought I had done a good job browsing the SX LIST, but it seems there are a whole more bunch of treasures hidden there.

    Guess I better figure out how to run that search engine.

    KUDOS TO JAMES NEWTON !!!!!!

    Many thanks all,

    Peter (pjv)
  • StephenStephen Posts: 53
    edited 2005-04-05 16:59
    Here's a spreadsheet I created years ago to help see the differences...
Sign In or Register to comment.