Shop OBEX P1 Docs P2 Docs Learn Events
I found some "long 0-0" in the declairations area in PASM that I am not familar — Parallax Forums

I found some "long 0-0" in the declairations area in PASM that I am not familar

OctahedronOctahedron Posts: 18
edited 2010-02-14 23:04 in Propeller 1
I was looking in N&V Spin Zone article·on SIRCS·and was making my way though the DAT code and ran across some long declarations that I have not seen before.· Here is the complete declaration section of the code:

DONE···················long··· true
NEG_DETECT·········long··· %01100 << 26··················· ' ctr neg detector
FREE_RUN·············long··· %11111 << 26··················· ' ctr logic always mode
START_BIT···········long··· 0-0···························· ' counts in 80% of 2.4ms
ONE_BIT·············· long··· 0-0···························· ' counts in 80% of 1.2ms
MS_044··············· long··· 0-0···························· ' counts in 44ms··
irmask················· long··· 0-0···························· ' pin mask for ir input
okpntr················· long··· 0-0···························· ' pointer to ready flag
codepntr·············· long··· 0-0···························· ' pointer to ir code
bitspntr··············· long··· 0-0···························· ' pointer to bit count of code
irwork·················· res···· 1······························ ' workspace for ir input
bits····················· res···· 1······························ ' # bits in input
tmp1··················· res···· 1
tmp2··················· res···· 1
··························fit···· 492
Now I have seen and used·all of them except for the "long 0-0".· Does someone have a quick explanation?

Thanks for your time.

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

Comments

  • heaterheater Posts: 3,370
    edited 2010-02-14 19:41
    blabla long 0-0

    Is a convention that has grown up among Propeller programmers to indicate to the reader that the variable is subject to being changed as part of a self-modifying code sequence. You will often see this where source or destinations addresses of an instruction are modified to create indexed addressing and such. e.g

    MOVS get, #3 'Set source address of instruction at "get" to 3
    .
    .
    .
    get MOV A, #0-0 'When executed this instruction will have the source address modified.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • AleAle Posts: 2,363
    edited 2010-02-14 19:44
    They are just placeholders. I thought they where instructions with fields with 0-0 (used to indicate places that will be overwritten with addresses/values during execution).

    In those cases AFAICT they do not mean nothing special.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Visit some of my articles at Propeller Wiki:
    MATH on the propeller propeller.wikispaces.com/MATH
    pPropQL: propeller.wikispaces.com/pPropQL
    pPropQL020: propeller.wikispaces.com/pPropQL020
    OMU for the pPropQL/020 propeller.wikispaces.com/OMU
    pPropellerSim - A propeller simulator for ASM development sourceforge.net/projects/ppropellersim
  • OctahedronOctahedron Posts: 18
    edited 2010-02-14 21:30
    Thank you Ale and heater!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • JonnyMacJonnyMac Posts: 9,208
    edited 2010-02-14 23:04
    The code you list is something I wrote. Yes, the intention of 0-0 (that I picked up from another programmer here) is to indicate that this value will be modified by another section of code. In this specific case the ticks for a START_BIT, for example, are dependent on the system frequency. If you look in the initialization code in the object you'll see that these values are set using clkfreq and some divisor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon McPhalen
    Hollywood, CA

    Post Edited (JonnyMac) : 2/14/2010 11:09:12 PM GMT
Sign In or Register to comment.