Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-08 - 43,50500/struct.lst
There are no other files named struct.lst in the archive.
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 1
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS

     1						UNIVERSAL  STRUCT  --  STRUCTURED PROGRAMMING MACROS
     2						SUBTTL	DEFINITIONS
     3
     4
     5					;;	VERSION 1(0)-2
     6
     7					;;	WRITTEN BY ROBERT P. NIX  --  11/21/78
     8
     9
    10					;;	STRUCT -- A SET OF STRUCTURED PROGRAMMING MACROS FOR
    11					;;		THE DECSYSTEM-10 ASSEMBLER.
    12
    13					;;	THE CALLS:
    14
    15
    16					;		%IF <CONDITIONS> ; THEN
    17					;		  -- CODE --
    18					;		%ELSE
    19					;		  -- CODE --
    20					;		%ENDIF
    21
    22					;			- OR -
    23
    24					;		%IF <CONDITIONS> ; THEN
    25					;		  -- CODE --
    26					;		%ENDIF
    27
    28
    29					;		%WHILE <CONDITIONS> ; DO
    30					;		  -- CODE --
    31					;		%ENDWHILE
    32
    33
    34					;		%REPEAT
    35					;		  -- CODE --
    36					;		%UNTIL <CONDITIONS>
    37
    38
    39					;		%CASE
    40					;		 %WHEN <CONDITIONS> ; DO
    41					;		  -- CODE --
    42					;		 %WHEN <CONDITIONS> ; DO
    43					;		  -- CODE --
    44					;		%ENDCASE
    45
    46
    47					;		%LOOP
    48					;		  -- CODE --
    49					;		%EXITIF <CONDITIONS>
    50					;		  -- CODE --
    51					;		%ENDLOOP
    52
    53
    54					;;	<CONDITIONS> IS DEFINED AS:
    55
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 1-1
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS

    56					;		<[CAI, SKIP OR OTHER SKIPPING COND],AFIELD,BFIELD,COND>
    57					;		<<CONDITIONS>,AND,<CONDITIONS>>
    58					;		<<CONDITIONS>,OR,<CONDITIONS>>
    59					;		<NOT,<CONDITIONS>>
    60
    61
    62
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 2
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS FOR MACROS NEEDED INTERNALLY TO SUBSYSTEM

    63						SUBTTL	DEFINITIONS FOR MACROS NEEDED INTERNALLY TO SUBSYSTEM
    64
    65
    66						LALL
    67
    68
    69						DEFINE	COND	(UCOND,T,F,%T1,%F1) <
    70					..CCNT== 0
    71						IRP	UCOND,< ..CCNT== ..CCNT+1 >
    72						IFE	..CCNT-4,<
    73						  ACOND	(UCOND,T,F)  >
    74						IFE	..CCNT-2,<
    75						  ..CC== 0
    76						  IRP	UCOND,<
    77						  ..CC== ..CC+1
    78						  IFE	..CC-2,<
    79						    COND (UCOND,F,T) > > >
    80						IFE	..CCNT-3,<
    81						  ..CC== 0
    82						  IRP	UCOND,<
    83						  ..CC== ..CC+1
    84						  IFE	..CC-1,<
    85						    COND (UCOND,%T1,%F1) >
    86						  IFE	..CC-2,<
    87						    IFIDN <UCOND><AND>,<
    88					%F1:	JRST	F
    89					%T1:	>
    90						    IFIDN <UCOND><OR>,<
    91					%T1:	JRST	T
    92					%F1:	>
    93						 >
    94						  IFE	..CC-3,<
    95						    COND (UCOND,T,F) > > > >
    96
    97
    98						DEFINE	ACOND	(I,A,B,C,T,F) <
    99						I'C	A,B
   100						JRST	F
   101						JRST	T	>
   102
   103
   104						DEFINE	BLDSYM	(CONST,ARG) <
   105					CONST'ARG== .
   106								>
   107
   108
   109						DEFINE	ORGSYM	(CONST,ARG) <
   110						.ORG	CONST'ARG
   111								>
   112
   113
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 3
STRUCT	MAC	21-Nov-78 13:57		SUBTTL	DEFINITIONS FOR %IF, %ELSE, %ENDIF

   114						SUBTTL	SUBTTL	DEFINITIONS FOR %IF, %ELSE, %ENDIF
   115
   116
   117
   118						DEFINE	%IF	(UCOND,%T,%F) <
   119						IFNDEF	.ILVL,<.ILVL== 0>
   120						COND	(<UCOND>,%T,%F)
   121					%F:	JRST	@.+1
   122						BLDSYM	(.IF,\.ILVL)
   123						BLOCK	1
   124					%T:
   125						.ILVL== .ILVL+1
   126								>
   127
   128
   129						DEFINE	%ELSE	(%ELS,%END) <
   130						IFNDEF	.ILVL,<PRINTX "ATTEMPTED %ELSE W/O %IF">
   131						.ILVL== .ILVL-1
   132						IFL	.ILVL,<PRINTX "ATTEMPTED %ELSE W/O %IF">
   133						IFGE	.ILVL,<
   134						JRST	@'%END
   135						ORGSYM	(.IF,\.ILVL)
   136						EXP	%ELS
   137						.ORG
   138						BLDSYM	(.IF,\.ILVL)
   139					%END:	BLOCK	1
   140					%ELS:
   141						.ILVL== .ILVL+1
   142								> >
   143
   144
   145						DEFINE	%ENDIF	(%END) <
   146						IFNDEF	.ILVL,<PRINTX "ATTEMPTED %ENDIF W/O %IF">
   147						.ILVL== .ILVL-1
   148						IFL	.ILVL,<PRINTX "ATTEMPTED %ENDIF W/O %IF">
   149						IFGE	.ILVL,<
   150					%END:
   151						ORGSYM	(.IF,\.ILVL)
   152						EXP	%END
   153						.ORG
   154								> >
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 4
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS FOR %WHILE, %ENDWHILE

   155						SUBTTL	DEFINITIONS FOR %WHILE, %ENDWHILE
   156
   157
   158						DEFINE	%WHILE	(UCOND,%T,%F) <
   159						IFNDEF	.WLVL,<.WLVL== 0>
   160						BLDSYM	(.WTO,\.WLVL)
   161						COND	(<UCOND>,%T,%F)
   162					%F:	JRST	@.+1
   163						BLDSYM	(.WLV,\.WLVL)
   164						BLOCK	1
   165					%T:
   166					.WLVL==	.WLVL+1		>
   167
   168
   169						DEFINE	%ENDWH	(%BACK,%EN) <
   170						IFNDEF	.WLVL,<PRINTX "ATTEMPTED %ENDWHILE W/O %WHILE">
   171						.WLVL== .WLVL-1
   172						IFL	.WLVL,<PRINTX "ATTEMPTED %ENDWHILE W/O %WHILE">
   173						IFGE	.WLVL,<
   174						ORGSYM	(.WTO,\.WLVL)
   175					%BACK== .
   176						.ORG
   177						JRST	%BACK
   178					%EN==	.
   179						ORGSYM	(.WLV,\.WLVL)
   180						EXP	%EN
   181						.ORG		> >
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 5
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS FOR %REPEAT, %UNTIL

   182						SUBTTL	DEFINITIONS FOR %REPEAT, %UNTIL
   183
   184
   185						DEFINE	%REPEA <
   186						IFNDEF	.RLVL,<.RLVL== 0>
   187						BLDSYM	(.RTO,\.RLVL)
   188					.RLVL== .RLVL+1		>
   189
   190
   191						DEFINE	%UNTIL	(UCOND,%T,%F,%TO) <
   192						IFNDEF	.RLVL,<PRINTX "ATTEMPTED %UNTIL W/O %REPEAT">
   193					.RLVL==	.RLVL-1
   194						IFL	.RLVL,<PRINTX "ATTEMPTED %UNTIL W/O %REPEAT">
   195						IFGE	.RLVL,<
   196						COND	(<UCOND>,%T,%F)
   197						ORGSYM	(.RTO,\.RLVL)
   198					%TO==	.
   199						.ORG
   200					%F:	JRST	%TO
   201					%T:			> >
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 6
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS FOR %CASE, %WHEN, %ENDCASE

   202						SUBTTL	DEFINITIONS FOR %CASE, %WHEN, %ENDCASE
   203
   204
   205						DEFINE	%CASE	(%CONT,%NXT) <
   206						IFNDEF	.CLVL,<.CLVL== 0>
   207						JRST	%CONT
   208						BLDSYM	(.CBO,\.CLVL)
   209						BLOCK	1
   210						BLDSYM	(.CNX,\.CLVL)
   211					%NXT:	BLOCK	1
   212					%CONT:	JRST	@'%NXT
   213					.CLVL== .CLVL+1
   214								>
   215
   216
   217						DEFINE	%WHEN	(UCOND,%T,%F,%BO,%NXT,%TOP) <
   218						IFNDEF	.CLVL,<PRINTX "ATTEMPTED %WHEN W/O %CASE">
   219					.CLVL==	.CLVL-1
   220						IFL	.CLVL,<PRINTX "ATTEMPTED %WHEN W/O %CASE">
   221						IFGE	.CLVL,<
   222						ORGSYM	(.CBO,\.CLVL)
   223					%BO==	.
   224						.ORG
   225						JRST	@'%BO
   226					%TOP==	.
   227						ORGSYM	(.CNX,\.CLVL)
   228						EXP	%TOP
   229						.ORG
   230						COND	(<UCOND>,%T,%F)
   231					%F:	JRST	@'%NXT
   232						BLDSYM	(.CNX,\.CLVL)
   233					%NXT:	BLOCK	1
   234					%T:
   235					.CLVL== .CLVL+1
   236								> >
   237
   238
   239						DEFINE	%ENDCA	(%BO) <
   240						IFNDEF	.CLVL,<PRINTX "ATTEMPTED %ENDCASE W/O %CASE">
   241					.CLVL==	.CLVL-1
   242						IFL	.CLVL,<PRINTX "ATTEMPTED %ENDCASE W/O %CASE">
   243						IFGE	.CLVL,<
   244					%BO==	.
   245						ORGSYM	(.CBO,\.CLVL)
   246						EXP	%BO
   247						.ORG
   248						ORGSYM	(.CNX,\.CLVL)
   249						EXP	%BO
   250						.ORG
   251								> >
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 7
STRUCT	MAC	21-Nov-78 13:57		DEFINITIONS FOR %LOOP, %EXITIF, %ENDLOOP

   252						SUBTTL	DEFINITIONS FOR %LOOP, %EXITIF, %ENDLOOP
   253
   254
   255						DEFINE	%LOOP <
   256						IFNDEF	.LLVL,<.LLVL== 0>
   257						BLDSYM	(.LT,\.LLVL)
   258						.LLVL== .LLVL+1
   259								>
   260
   261
   262						DEFINE	%EXITI	(UCOND,%T,%F,%OUT) <
   263						IFNDEF	.LLVL,<PRINTX "%EXITIF W/O %LOOP">
   264						.LLVL== .LLVL-1
   265						IFL	.LLVL,<PRINTX "%EXITIF W/O %LOOP">
   266						IFGE	.LLVL,<
   267						COND	(<UCOND>,%T,%F)
   268					%T:	JRST	@'%OUT
   269						BLDSYM	(.LB,\.LLVL)
   270					%OUT:	BLOCK	1
   271					%F:
   272						.LLVL== .LLVL+1
   273								> >
   274
   275
   276						DEFINE	%ENDLO	(%TOP,%BO) <
   277						IFNDEF	.LLVL,<PRINTX "%ENDLOOP W/O %LOOP">
   278						.LLVL== .LLVL-1
   279						IFL	.LLVL,<PRINTX "%ENDLOOP W/O %LOOP">
   280						IFGE	.LLVL,<
   281						ORGSYM	(.LT,\.LLVL)
   282					%TOP== .
   283						.ORG
   284						JRST	%TOP
   285					%BO:
   286						ORGSYM	(.LB,\.LLVL)
   287						EXP	%BO
   288						.ORG
   289								> >
   290
   291
STRUCT  --  STRUCTURED PROGRAMMING MACROS	MACRO %53(1054) 13:58 21-Nov-78 Page 9
STRUCT	MAC	21-Nov-78 13:57		END OF MODULE

   292						SUBTTL	END OF MODULE
   293
   294
   295						end

NO ERRORS DETECTED

PROGRAM BREAK IS 000000
CPU TIME USED 00:00.473

9P CORE USED

ACOND	    98#
BLDSYM	   104#
COND	    69#
ORGSYM	   109#
%CASE	   205#
%ELSE	   129#
%ENDCA	   239#
%ENDIF	   145#
%ENDLO	   276#
%ENDWH	   169#
%EXITI	   262#
%IF	   118#
%LOOP	   255#
%REPEA	   185#
%UNTIL	   191#
%WHEN	   217#
%WHILE	   158#