Shop OBEX P1 Docs P2 Docs Learn Events
Lookup issue on SXB 2.00.31? [solved] — Parallax Forums

Lookup issue on SXB 2.00.31? [solved]

YendorYendor Posts: 288
edited 2010-05-11 16:11 in General Discussion
Bean, could you look at this?

From the help file:

· idx = 3
· LOOKUP idx, $00, $01, $02, $04, $08, $10, $20, $40, $80, LEDs
has·LEDs = 40 after completion instead of·$04

Here's the compiled source code: Shouldn't the Skips be Jumps?

·· 215· 0052· 0C03······· MOV idx,#3···················· ;· idx = 3
······· 0053· 0034
·· 216·················
·· 217· 0054· 0294······· MOV W,++idx··················· ;· LOOKUP idx, $00, $01, $02, $04, $08, $10, $20, $40, $80, LEDs
·· 218· 0055· 0028······· MOV __PARAM1,W···············
·· 219· 0056· 0215······· MOV W,leds···················
·· 220· 0057· 02E8······· DECSZ __PARAM1···············
·· 221· 0058· 0702······· SKIP·························
·· 222· 0059· 0C00······· MOV W,#$00···················
·· 223· 005A· 02E8······· DECSZ __PARAM1···············
·· 224· 005B· 0602······· SKIP·························
·· 225· 005C· 0C01······· MOV W,#$01···················
·· 226· 005D· 02E8······· DECSZ __PARAM1···············
·· 227· 005E· 0702······· SKIP·························
·· 228· 005F· 0C02······· MOV W,#$02···················
·· 229· 0060· 02E8······· DECSZ __PARAM1···············
·· 230· 0061· 0602······· SKIP·························
·· 231· 0062· 0C04······· MOV W,#$04···················
·· 232· 0063· 02E8······· DECSZ __PARAM1···············
·· 233· 0064· 0702······· SKIP·························
·· 234· 0065· 0C08······· MOV W,#$08···················
·· 235· 0066· 02E8······· DECSZ __PARAM1···············
·· 236· 0067· 0602······· SKIP·························
·· 237· 0068· 0C10······· MOV W,#$10···················
·· 238· 0069· 02E8······· DECSZ __PARAM1···············
·· 239· 006A· 0702······· SKIP·························
·· 240· 006B· 0C20······· MOV W,#$20···················
·· 241· 006C· 02E8······· DECSZ __PARAM1···············
·· 242· 006D· 0602······· SKIP·························
·· 243· 006E· 0C40······· MOV W,#$40···················
·· 244· 006F· 02E8······· DECSZ __PARAM1···············
·· 245· 0070· 0702······· SKIP·························
·· 246· 0071· 0C80······· MOV W,#$80···················
·· 247· 0072· 0035······· MOV leds,W···················

Post Edited (Yendor) : 5/11/2010 4:14:06 PM GMT

Comments

  • BeanBean Posts: 8,129
    edited 2010-05-11 12:28
    Yendor,
    No, the skips should work.
    Jump would have made the code bigger because you need the @label which takes an extra instruction for each condition.

    Is it not working for you ?

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • YendorYendor Posts: 288
    edited 2010-05-11 12:54
    Thanks for looking.

    It's not working for some reason, and haven't had a chance to look too deeply at the assempbly code.

    Here's the file with the example - take a look in SX sim, when you get a chance.

    I looked·with 1.51, and it works okay.· Just not sure wut's goin' on with 2.00.31 and a few others.

    See if you agree, or if I'm doing something wrong.

    Thanks!
  • YendorYendor Posts: 288
    edited 2010-05-11 16:11
    Bean,

    My apologies - There's an issue with the SKIP instruction in SXSim 2_08_05

    2_08_06 fixed the problem.

    As Emily Litella (Gilda Radner) of SNL fame would say... "Nevermind" [noparse]:o[/noparse])

    Thanks again!
Sign In or Register to comment.