AUGS/AUGD queries

TonyBTonyB Posts: 73
edited April 28 in Propeller 2 Vote Up0Vote Down
I've been trying to understand AUGS/AUGD and I have a few questions. Here are the two opcodes with slightly different spacing from normal:

1. Do AUGS/AUGD apply to all instructions that use S/D or only a few?

2. I assume N is loaded into a 23-bit register/latch used only by AUGS/AUGD and AUG flags are set, which are cleared sometime during the following instruction after the AUG address register has been read and it is safe to be interrupted. Is that correct?

3. If the address space is only 20-bit, how can a combined 32-bit address be used?

4. I have modified the opcodes above, replacing the Ns with 23 unique lower-case letters for clarity (I hope):
EEEE 11110 abcdefghijklmnopqrstuvw 	AUGS    #a...w
EEEE 11111 abcdefghijklmnopqrstuvw 	AUGD    #a...w
How are the individual abc...uvw bits combined with SSSSSSSSS or DDDDDDDDD exactly?

Are the following examples from the documentation
%000000000000AAAAAAAAAAA_AAAAAAAAA	AUGS, 20-bit immediate
equivalent to
%000000000000mnopqrstuvw_SSSSSSSSS	AUGS, 20-bit immediate
%000000001jklmnopqrstuvw_SSSSSSSSS	AUGS, PTRx expression

If so, how or where are abcdefghi used?


  • 7 Comments sorted by Date Added Votes
  • I think AUGS/AUGD are only for use with immediate instructions. The effect of:
        AUGS #%abcd...uvw
        ADD  x, #%SSSSSSSSS
    is to add the 32 bit value %abcd...uvwSSSSSSSSS to x. It's particularly useful in HUB or LUT execution, as an easy way of generating 32 bit constants without requiring a COG register. As such, AUGS will be used a lot more often than AUGD, since more instructions have immediate sources than immediate destinations.

    AUGS is not to be confused with ALTS, which completely replaces the source field of the next instruction. It's also not usually necessary to explicitly write the AUGS, since the assembler can do it for you. The above code is the same as:
        ADD x, ##%abcd...uvwSSSSSSSSS
    where the '##' tells the assembler to emit an AUGS before the ADD in order to achieve a full 32 bit immediate.

  • Thank you, that probably answers both Q3 and Q4. I was thinking too much about addresses.
  • TonyBTonyB Posts: 73
    edited April 30 Vote Up0Vote Down
  • TonyBTonyB Posts: 73
    edited April 30 Vote Up0Vote Down
  • jmgjmg Posts: 10,042
    TonyB wrote: »
    Please ignore the above, I've had a better idea.
    You cannot delete a post, but you can edit it down as small as '.'

  • evanhevanh Posts: 3,899
    To answer question #1 more precisely, an AUGx instruction gets apply to the next instruction that can use it rather than always the following instruction. Instructions that can use it are ones that have immediate (#) addressing mode only for the respective S and D operands.

    So, for example, NOP has no operands so will not consume any proceeding AUGx setup. The AUGx setup carries for a future instruction ... An AUGS #5000 preceding an ADD D,S won't consume the setup but a subsequent ADD D,#5 will add #5005 to D and consume the setup. I don't think there is any limit to the number of instructions it can carry for.

    The two AUGx's (AUGS/AUGD) themselves can both be setup without interference. I don't know if there is a special order required or they are just considered special and therefore it don't matter.

    And lastly, I think, for any hand set AUGx's in Pnut, the text values are treated as whole absolute so when converted to machine code get their bottom 9 bits trimmed. Easier to use ## instead.
    $50,000 buys you a discrediting of a journalist
  • evanhevanh Posts: 3,899
    As a pointer, HubRAM read/write opcodes use S operand so again you'd want to use AUGS to set a 32-bit Hub address, branching instructions use D operand so AUGD for them to reach across large spaces in HubRAM.

    On that note, setting up HubRAM burst mode operation (RDFAST/WRFAST/FBLOCK) can nicely use both AUGS and AUGD together.
    $50,000 buys you a discrediting of a journalist
Sign In or Register to comment.