Shop OBEX P1 Docs P2 Docs Learn Events
When debugging, how to jump over steps of a PAUSE ? — Parallax Forums

When debugging, how to jump over steps of a PAUSE ?

John KauffmanJohn Kauffman Posts: 653
edited 2006-03-15 06:42 in General Discussion
My SX/B program has some commands of Pause 200. When I run Debug it takes hundreds (?) of steps to get through the pauses and on to the commands of interest.

What is the best practice to avoid all of that stepping through PAuse? So far I have tried the following techniques:
·
-········ REM out the pauses prior to running a Debug.
-········ Make all the pause length arguments a single variable so I can set that to zero (changes all the pauses with one change)
-········ Change the walk speed during debugging to ‘run’ past the pause steps and ‘plod’ through the interesting steps (this ends up like a video game).
·
Are there other techniques?
·
Ideally, I’d like a directive or command like: DEBUG IGNORE PAUSE

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-03-14 23:31
    You could define a constant used to skip those sections when you want to debug.· You'd have to change the constant for normal operation, but this is a simple step:

    Yes······ ·CON··· 1
    No······ · CON··· 0
    DebugOn··· CON··· Yes

    ...

    · IF DebugOn·= No·THEN
    ··· PAUSE 200
    · ENDIF

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BeanBean Posts: 8,129
    edited 2006-03-15 00:03
    John,
    You are only allowed one break point, BUT if you put the breakpoint in a subroutine you can have as many as you want.
    And since the debugger actually stops on the instruction AFTER the breakpoint, you are stopped right at the instruction after the call to the BreakPoint subroutine.

    Here is an example program. Start the debugger and hit RUN, it will stop at "a = 5", now you can step until you get into the PAUSE command, then just hit RUN again, the debugger will stop at "a = 10" and so on. (I hope that made sense...).
    DEVICE SX28, OSCXT1, TURBO, STACKX, OPTIONX
    FREQ 4_000_000
     
    a VAR Byte
     
    BreakPoint SUB
     
    PROGRAM Start
     
    Start:
      BreakPoint
      a = 5
      PAUSE 200
      BreakPoint
      a = 10
      PAUSE 200
      BreakPoint
      a = 20
      PAUSE 200
      GOTO Start
     
    BreakPoint:
      BREAK
      RETURN
    
    


    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012

    "SX-Video OSD module" Now available from Parallax for only·$49.95
    http://www.parallax.com/detail.asp?product_id=30015

    Product web site: www.sxvm.com

    "Wise men know when they're right. The wisest also·know when they're wrong."
    ·
  • John KauffmanJohn Kauffman Posts: 653
    edited 2006-03-15 00:56
    Jon: thanks for IF THEN option
    Bean: that makes perfect sense.

    Thanks to both.
  • John BondJohn Bond Posts: 369
    edited 2006-03-15 06:42
    Hey Bean, I like the idea of putting the BreakPoint in a subroutine. It never occured to me

    John Bond
Sign In or Register to comment.