Shop OBEX P1 Docs P2 Docs Learn Events
PASM to SASM diffuculties. — Parallax Forums

PASM to SASM diffuculties.

FredoFredo Posts: 10
edited 2005-09-14 13:16 in General Discussion
I continue to experience problems getting a perfectly well behaved PASM program to operate correctly under SASM.

The "Eric_1" code here is a re-arrangement of the original PASM code. Items have been moved and renamed to accomodate SASM. It is heavily cannibalized and many sections are "commented out' the result of trouble shooting. I expect what is left to clear RA,RB & RC (without defining them), set RB.3 low & latch-up in the loop 'Teste'. An LED connected between +5V and RB3 is the indicator.

There is also a rather long data table imported as RETW's with an 'INCLUDE' statement. A review of the assembled code shows ths to be as expected.

I test this by compiling, then driving it with the sxKey clock. I pull down the clock and repeatedly click on 'reset'. I expect the light to light each time.

The results are:

If the 'INCLUDE' statement is commented out, the light lights... every time.

If the 'INCLUDE' statement is included, the light lights sometimes. Sometimes not. Sometimes it flickers randomly and goes out. Sometimes it flickers randomly and stays on.

I am doing something fundamental incorrectly and I hope some one of you out there can point this out to me. Thanks,

Fred Ornellas



goes out. ... every time.

Comments

  • BeanBean Posts: 8,129
    edited 2005-09-14 02:16
    Fred,
    I looked at your code. Sorry I couldn't make heads or tails out of it.
    You need to simplify the code as much as possible leaving only the bare minimum that still causes the problem.
    You may even discover the problem yourself while doing this.(I know I have done that several times).
    Bean.

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

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available soon!! Video overlay(OSD) module...

    "I'm a man, but I can change, if I have to, I guess"
    Red Green
    ·
  • FredoFredo Posts: 10
    edited 2005-09-14 13:03
    I tried to point out that most of this code (98%) is NOT functional in this copy... just there. When I simplify it to resolve this issue, the symptom goes away. I think there are less than 15 instructions I expect to run in this submission. Don't try to make sense of the overall code, follow the path from 'reset' and you will soon see it terminate in an endless loop at 'Teste'.
    What I don't understand, but I think is a clue, is why the presence or absence of the table (which loads where I want it and does not execute here) should have any impact on the performance of the 15? instructions.
    Please, I have a stripped version which contains only the instructions which execute here. It works fine. I'm not sure how it would help. Take another look. Thanks,

    Fred Ornellas
  • FredoFredo Posts: 10
    edited 2005-09-14 13:16
    Bean,

    On second thought, here is the stripped version. The only variant in the two paths is clearing of the three I/O registers. It does not exhibit this problem. Perhaps this is a clue.

    Fred
Sign In or Register to comment.