Shop Learn
Is There Something Like a P2 PASM Tutorial? — Parallax Forums

Is There Something Like a P2 PASM Tutorial?

at the moment I am struggling with some assembler code. One problem, that I have, is that I do not really understand the P2 PASM assembler syntax. For example ## or #. Is there a document, explaining such things?
I am working with TIA
At the moment I think, that it follows the "normal" syntax.

I do know: - Excellent !!!

Thanks in advance for some hints!


  • evanhevanh Posts: 11,685
    edited 2021-09-06 16:09

    # means "immediate addressing" mode. Which means the ALU's data value (operand) is supplied from program code. With RISC instructions, that usually means it's part of the instruction itself. As such, on the Prop2, it is limited to 9-bit size.

    ## is Pasm2's extended, 32-bit, version of immediate addressing. It is given a distinct syntax because it causes the assembler to generate extra instructions in the assembled program. Namely AUGD and AUGS, depending on which operand is being extended to 32-bit.

    It was originally documented in the Pnut zip in a file called "instructions.txt". The info has since been added near the end of the silicon google doc:

    If a constant larger than 9 bits is desired in an instruction, use "##",
    instead of "#" to invoke AUGS/AUGD:
        AND     address,##$FFFFF
        DJNZ    reg,##far_away
  • RaymanRayman Posts: 12,185

    I don't think there is... There is a P1 assembly tutorial though...

    Not the same, but very similar. Mostly, the P2 adds a bunch of extra instructions...

  • Thank you evanh and Rayman!

Sign In or Register to comment.