Shop OBEX P1 Docs P2 Docs Learn Events
PASM - SRC value in not what I expect — Parallax Forums

PASM - SRC value in not what I expect

Tony B.Tony B. Posts: 356
edited 2011-07-29 21:39 in Propeller 1
I have been working learning PASM using the following attached code. I have been studing the Hex code as shown when you use the Compile Current - View code or F8 in the Propeller tool. Having studied the Hex code potions in the Hex code window I believe the register number for the SRC of the first OR instructions should be register number $12 or 18, but the parsed code shows $B or 11. When I check the register values for dira, outa, and count the values are correct. Some help understanding my error would be most appreciated.

Thanks,
Tony

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-07-29 19:40
    $0b is correct. Pinmask is located 11 longs from the entry point of the cog, which is where counting starts -- barring an intermediate org.

    -Phil
  • Tony B.Tony B. Posts: 356
    edited 2011-07-29 19:51
    So the counting starts with the first long of the PASM code, in other words the first OR instruction and not $0000. Am I understanding you correctly? My understanding was register counting started at $000. Does the cognew command just load the PASM code dismissing the Hex before and after?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-07-29 20:34
    The first long in a DAT section is at cog address zero, assuming either an org 0 or no org at all. The addresses you see when pressing F8 are not cog addresses; they're the hub addresses pertaining to where the code is loaded in hub RAM. But addressing in PASM relies on the locations the symbols will have when they're transferred to the cog for execution.

    -Phil
  • Tony B.Tony B. Posts: 356
    edited 2011-07-29 20:43
    Phil, Thank you! Your quick and clear responses have helped me learn something new and moved me forward in my Propeller and PASM discovery and knowledge.

    Just a curiosity question. Is there some where I could learn what the initializationHex code is as well as what Hex code SPIN generates for its instruction set?

    Thanks,
    Tony
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-07-29 21:02
    The Spin bytecodes are not documented officially, but they have been independently reverse-engineered. Here's a site that offers some insight:

    -Phil
  • Tony B.Tony B. Posts: 356
    edited 2011-07-29 21:39
    Thanks again Phil
Sign In or Register to comment.