Shop OBEX P1 Docs P2 Docs Learn Events
SX/B pause command compiled into assembly = confusion — Parallax Forums

SX/B pause command compiled into assembly = confusion

Mag748Mag748 Posts: 269
edited 2005-01-09 06:06 in General Discussion
Attached is a list file of how SX/B compiled a few pause commands into assembly.
Can anyone explain how this code works?
I know this is one way to do a delay:

········mov delay1,#24
oloop···clr delay
wloop·· djnz delay,wloop
········djnz delay1,oloop

The list file code is really confusing to me.

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

Comments

  • BeanBean Posts: 8,129
    edited 2005-01-08 23:51
    The SX/B code is basically doing the same thing.
    Bean.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-09 04:15
    For many instructions SX/B uses relative jumps so that it doesn't have to create a keep track of a bunch of labels.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • Mag748Mag748 Posts: 269
    edited 2005-01-09 05:09
    the reason i am asking is because I just wanted to copy the compiled pause comand stuff into my assembly program so I wouldn't have to calculate the number of cycles and stuff. I guess it isn't that easy

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • James NewtonJames Newton Posts: 329
    edited 2005-01-09 05:44
    Yes, it is:

    http://www.sxlist.com/techref/piclist/codegen/delay.htm

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    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!



  • Mag748Mag748 Posts: 269
    edited 2005-01-09 06:06
    AH, Great. Thanks, that's awesome

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sign In or Register to comment.