;
;       Test atypical usages of .SET
;
;       In this case, the idea is to create a string descriptor that
;       has many elements contributing to it, so a .ASCID isn't
;       appropriate.  The problem is that you cannot use a forward
;       reference in an expression, so the normal mechanism of setting
;       the length to be the end point less the start point of the
;       string (not yet defined) won't quite work.
;
;       However, you can simply store a forward referenced word as
;       the length and leave it undefined.  The Assembler can handle
;       this since it's a single value to keep up with.
;
;       Later, after defining the starting and ending addresses of
;       the string, you can set the length variable to have an explicit
;       value from an expression containing only resolved symbols.  The
;       assembler, now knowing the value of the symbol, backpatches the
;       value into the right place in the descriptor.
;
;       This sort of work by the writer of the ASM code can explicitly
;       overcome many of the limitations on expressions containing one
;       or more forward references.
;

                .print  "To test, EXAM ASCII DESC TST to see the whole"
                .print  "string as a descriptor."

;       At this point, the entire descriptor will contain zeros and
;       the assembler will have a list of backpatches to make.

tst:            .word   tst_len, 0
                .long   tst_addr

;       Now we can define the value of tst_addr, so the address of the
;       descriptor gets filled in. Then we write the bytes to memory.

tst_addr:       .ascii "This is a string of text"
                .byte   0d,0a

;       Finally, define the value of the length now that the starting
;       and ending addresses are both known.  Note use of "." which 
;       means "here".

                .set    tst_len = . - tst_addr - 1

