More MACRO-10 parsing improvements
This commit is contained in:
parent
3da33e3668
commit
fb83d1e503
8 changed files with 869 additions and 806 deletions
|
|
@ -1,4 +1,23 @@
|
|||
TITLE STORE TEXT CHARACTER BY CHARACTER
|
||||
; From the MACR0-10 ASSEMBLER PROGRAMMER'S REFERENCE MANUAL (June 1972):
|
||||
;
|
||||
; Example 4 (Figure 7-4) shows nested macros which use IRPC. The desired operation
|
||||
; is to take an ASCII text string and store the characters four per word, left-justified,
|
||||
; with the character count stored in the first nine bits of the first word.
|
||||
;
|
||||
; The TEXT macro counts the string characters and invokes the CODE macro to store the
|
||||
; characters four per word. The CODE macro invokes a SHIFT macro which left-justifies the
|
||||
; last word if it is not already left-justified. The first part of the example shows the
|
||||
; normal listing, then SALL is set to show what code the macros are generating.
|
||||
;
|
||||
; The original listing encodes the following two lines as follows:
|
||||
;
|
||||
; IFN ZZ,<DEFINE SHIFT ;;REMAINDER LEFT
|
||||
; IFE ZZ&777B8,> ;;IF NOT LEFT JUSTIFIED
|
||||
;
|
||||
; The April 1978 MACRO-10 manual says that a macro body "must be enclosed in angle brackets",
|
||||
; so I'm not sure how the above lines make sense.
|
||||
;
|
||||
TITLE STORE TEXT CHARACTER BY CHARACTER
|
||||
SUBTTL %1 5-APR-72
|
||||
|
||||
DEFINE TEXT (C)<
|
||||
|
|
@ -13,10 +32,10 @@
|
|||
IFN ZZ&777B8,<
|
||||
EXP ZZ ;;WORD FULL
|
||||
ZZ==0> ;;START AGAIN WITH 0
|
||||
ZZ=ZZ+9+"C"> ;;END OF IRPC
|
||||
ZZ==ZZ_9+"C"> ;;END OF IRPC
|
||||
IFN ZZ,<DEFINE SHIFT< ;;REMAINDER LEFT
|
||||
IFE ZZ&777B8,< ;;IF NOT LEFT JUSTIFIED
|
||||
ZZ=ZZ+9 ;;MOVE LEFT 9 BITS
|
||||
ZZ==ZZ_9 ;;MOVE LEFT 9 BITS
|
||||
SHIFT> ;;RECURSE
|
||||
> ;;END OF DEFINE
|
||||
SHIFT ;;START MOVING LEFT
|
||||
|
|
|
|||
Loading…
Reference in a new issue