Shop OBEX P1 Docs P2 Docs Learn Events
bstc doesn't like some code? — Parallax Forums

bstc doesn't like some code?

cbmeekscbmeeks Posts: 634
edited 2020-07-16 13:01 in Propeller 1
I was playing around with the waitvid.2048 examples but found that the library would not assemble.

The offending code is:
             call    #blank wc               ' back porch

With an error message of:
waitvid.320x240.driver.2048 - Error at (81,32) Expected End of Line
                call    #blank wc               ' back porch
_______________________________^

It doesn't like the "wc" at the end.

I'm re-learning some PASM so I can't remember what that's for. Anyone know why bstc doesn't like that?

Here is the command line I am using:
d:\Dropbox\bin\BST\bstc.exe -l -b -d COM5 -p0 waitvid.320x240.demo.spin

Thanks!

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-16 13:22
    There is no wc with a call. Isn't this just a case of RTM instead of assuming that there is a problem with the assembler?
    Besides, I don't understand what you are trying to achieve with a wc in a call. Perhaps before a return you might use a wc in an operation, but not in the call itself if this was even possible.

    I take it that this wc was in some code, but could you always make sure you attach the zip of the code rather than a single line so we can check it out? I'm trying to find the source you are using but shouldn't have to.

    Ok, I found the code and it does have a wc in there, but I'm not sure why.
  • Wuerfel_21Wuerfel_21 Posts: 4,458
    edited 2020-07-16 13:42
    CALL WC (aka JMPRET WC) performs an unsigned comparison between the RET instruction and the jump target. Since the jump target is a 9 bit constant and thus always smaller than the RET instruction, this effectively clears (or sets? not sure) the C flag. @kuroneko likes to use weird quirks like that.

    (You can also use WZ to clear the Z flag, I think?)
  • cbmeekscbmeeks Posts: 634
    edited 2020-07-16 13:43
    Yeah, this isn't my code.

    I should have specified the repo location but I (falsely) assumed everyone was familiar with the waitvid.2048 repo.

    Which is located here:
    https://github.com/konimaru/waitvid.2048

    And more specifically here:
    https://github.com/konimaru/waitvid.2048/tree/master/scanline/320x240

    I never really said there was anything wrong with the assembler. I just asked why it didn't like that line of code.
  • Wuerfel_21 wrote: »
    CALL WC (aka JMPRET WC) performs an unsigned comparison between the RET instruction and the jump target. Since the jump target is a 9 bit constant and thus always smaller than the RET instruction, this effectively clears (or sets? not sure) the C flag. @kuroneko likes to use weird quirks like that.

    (You can also use WZ to clear the Z flag, I think?)

    Thanks for the explanation. I remember when I used to use the official Parallax IDE, it seemed to work just fine with that code. So I'm not sure what I'm doing wrong.

    Oh well...no worries. Thanks. :-)

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-16 13:49
    Never assume we know exactly what you are talking about and this P1 stuff was written 7 years ago now. I barely remember my own stuff from then. However we are not bell hops eager for a tip so don't expect us to fall all over ourselves to help you. The bell hop may smile and say "yes sir, thank you sir" but we are more like other hotel patrons who go out of their way to help you. Even if it isn't up to your "yes sir" standard, we are helping and it is voluntary after all.

    However, I checked a later version of the P1 manual and it does say wc can be used. Well there you go. Now I will go and find out why bst doesn't like it (voluntarily).



  • Never assume we know exactly what you are talking about and this P1 stuff was written 7 years ago now. I barely remember my own stuff from then. However we are not bell hops eager for a tip so don't expect us to fall all over ourselves to help you. The bell hop may smile and say "yes sir, thank you sir" but we are more like other hotel patrons who go out of their way to help you. Even if it isn't up to your "yes sir" standard, we are helping and it is voluntary after all.

    However, I checked a later version of the P1 manual and it does say wc can be used. Well there you go. Now I will go and find out why bst doesn't like it (voluntarily).




    You know what? Don't bother...I'm not interested any more. I don't know why you always have to give a smart Smile answer when all I was doing was asking a simple question.

  • Looks like this wc was never in the manual until 2011 since it isn't really a proper wc, it just ends up setting the c flag. BST was last updated in 2010 so perhaps that accounts for the fact that it wasn't expecting a wc that wasn't in the original specs. Perhaps somebody could throw some more light on what happened there?

    Also I think that there is homespun or one of those that might work.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2020-07-16 13:59
    You are the one taking offense so very easily when you assumed we would all know magically what you were talking about without providing any links, and then getting all huffed about the hurried response. This forum is very helpful and polite so I don't know what you expect. Just roll with it.
  • cbmeekscbmeeks Posts: 634
    edited 2020-07-16 14:01
    You are the one taking offense so very easily when you assumed we would all know magically what you were talking about without providing any links, and then getting all huffed about the hurried response. This forum is very helpful and polite so I don't know what you expect.

    I took offense? You're the one that lashed out and said I was expecting everyone to have a "yes sir" attitude to my thoughtless question and saying I assumed everyone to read my mind. I can't win with with you. No matter what I ask you have to give lip about it. You are LITERALLY the reason I left this forum TWICE over the years and went elsewhere. I then start getting fond memories of the Propeller, come back and have to get it from you again.

    But like I said...don't bother. I'm just not interested anymore.

  • I reread my original reply to you but I'm struggling to find where I "lashed out" at you. Wasn't it a "what are you talking about" type of reply where I was was struggling to understand what you were referring to? Still I went off and found code that matched and tried it all out. Not helpful and lashing out? Go figure.
  • Please just leave me the hell alone? OK?
  • Wuerfel_21 wrote: »
    CALL WC (aka JMPRET WC) performs an unsigned comparison between the RET instruction and the jump target. Since the jump target is a 9 bit constant and thus always smaller than the RET instruction, this effectively clears (or sets? not sure) the C flag. @kuroneko likes to use weird quirks like that.

    (You can also use WZ to clear the Z flag, I think?)

    Funny that I never saw that before with the call instruction but then again kuroneko always liked to discover all that there was to know about PASM. Interesting though that bst just won't handle any wc wz after a call. The original Prop manual didn't specify a wc.
  • Cluso99Cluso99 Posts: 18,069
    edited 2020-07-16 23:40
    Hey guys,
    I don't think any offense was meant. Sometimes you can read into comments things that were not actually said.

    The WC is used to set the C flag as it's not likely that this instruction executed from the shadow ram at $1FF whereby the next instruction would be $000 (rollover) when C would be cleared.

    The WZ is set to Z if the return address is $000 which is again unlikely. So it is used to set NZ.

    WC & WZ are just artifacts of the P1 design and the documentation was probably updated as Peter suggested to specify what really happens, and then someone used it in their code. I have seen WC and WZ used on the DJNZ instructions. IIRC the P2 Tricks and Traps documents the P2 differences.
  • @cbmeeks - I'm sorry if I somehow offended you. As you can see, I was trying to be as helpful as possible, even if my manner seemed a little less courteous than what you might be accustomed to, it's my way of thinking out aloud with the "what!" and the "why?" and the "let's see" but unlike a letter where we take our time to think about what we write, I frequently need to correct my posts immediately after I've posted them. I didn't get a chance to do any such thing with my initial post because I realized then that this was code from somewhere else that must work, but it didn't make sense either.

    @Cluso99 - It's interesting that the source code says this wc "clears the c flag" yet the Prop manual says it sets the flag :)
  • @"Peter Jakacki" thanks for the apology and you have my apologies as well. Just going through some difficult times and it's easy to set me off these days. Water under the bridge.

Sign In or Register to comment.