Shop OBEX P1 Docs P2 Docs Learn Events
Wrong code generation of the SX/B — Parallax Forums

Wrong code generation of the SX/B

JensJens Posts: 3
edited 2006-04-29 17:08 in General Discussion
Hi,

I fear I found an error in the SX/B compiler. Please have a look at the following code snippet:

·MOV bTemp,#%00100001·········· ;·bTemp = %00100001
·MOV bCode,bTemp··············· ;·bCode = bTemp··············· ' read code
·AND bCode,#%00001111·········· ;·bCode = bCode & %00001111····' low nibble contains morse code
·MOV bCodeSize,bTemp··········· ;·bCodeSize = bTemp
·MOV __PARAM1,bCodeSize········ ;·bCodeSize = bCodeSize >> 4···' number of dots/dashes per char
·AND __PARAM1,#$0F
·SWAP __PARAM1
·MOV bCodeSize,__PARAM1

I want to shift the higher nibble of the bCodeSize to the lower nibble. In the result of code generation the compiler masked the __PARAM1 first with the $0f and then swaped the nibble, isn't it?

Regards,

Jens

·······

Comments

  • BeanBean Posts: 8,129
    edited 2006-04-28 11:17
    Jens,
    You are correct. The code should do the SWAP first, then the AND. I'm pretty sure this has come up before, so it should be fixed in the next version.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com


    COMING SOON "SD DATA LOGGER" www.sddatalogger.com

    "I reject your reality, and substitute my own." Mythbusters
    ·
  • JensJens Posts: 3
    edited 2006-04-28 16:15
    Hi Bean,

    Not a problem. I changed the code, using the swap command directly instead of shifting the bits.

    Regards,

    Jens
  • SawmillerSawmiller Posts: 276
    edited 2006-04-28 23:54
    on the subject of the next rev of sx/b .... when is it ?

    everyones talking about the propeller, and rightly so, but if you look around this forum, you can see the lack of posting for the last lil bit.

    i really cant justify going out and buying another dev board for 140 dollars, when i just bought the sxtech a while ago.. am enthralled with the promise i see in the sx chips paticularly the $10 sx48 boards, would like to see the propeller come that way too.. but at the same time i am anxiuosly awaiting the next rev so i can easily use 16 bit basic.. i pointed out a problem with sx/b about· 2 months ago and they said that the next rev was coming soon........

    dan
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-29 00:01
    Sorry, gang, we've been really busy with the Propeller (we're a small company, all of us wear more than one hat) -- I promise, it won't be too much longer.... And the C compiler work is progressing, and all SX chips are available in RoHS-compliant packages. We have not forgot about the SX, we just have a lot more on our plates than we did a year ago.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • JamesxJamesx Posts: 132
    edited 2006-04-29 03:13
    Jon:

    Sounds like the trials and tribulations of a successful company. Congratulations!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-04-29 17:08
    We are very lucky that way, but then, we have the greatest customers in the world -- good luck for us all around. We sincerely do appreciate everyone's patience with us.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.