
;JSF STANDARD MACROS 6/17/72
IF2,.INEOF		;.INSRT INTO PROG NEAR BEGINNING, PREFERABLY ONLY DURING PASS 1

	;RANDOM SYMBOLS

SIGN=400000	;IT SAVES A LITTLE TYPING
JOV=JFCL 10,
JCRY0=JFCL 4,
JCRY1=JFCL 2,
JFOV=JFCL 1,
;FLOAT=FSC 233	;FLOAT THE INTEGER IN SELECTED AC
.FORMAT 30,2704_24.	;MAKE A, FORMAT TREAT A LIKE AC
.FORMAT 34,00222704_12.	;CHANGE A,B FORMAT TO TREAT A LIKE AC
.AOP .OPER@ 0,.RDATIM	;GET DATE AND TIME OF ASSEMBLY
ASTIME=.AVAL1	;TIME (SIXBIT /HHMMSS/) OF ASSEMBLY
ASDATE=.AVAL2	;DATE (SIXBIT /YYMMDD/) OF ASSEMBLY

	;FLAG DEFINITION FORMAT
	;FLAG==XHF AC,VALUE

RHF==0
LHF==TLN-TRN

DEFINE SETF FLAG
TRO+FLAG TERMIN

DEFINE CLEARF FLAG
TRZ+FLAG TERMIN

DEFINE TESTF COND,FLAG
TRN!COND+FLAG TERMIN

DEFINE TMODF COND,FLAG
TR!COND+FLAG TERMIN

	;FOLLOWING MACRO GENERATES POINTER TO BYTE POINTER TO THE JSF-TYPE FLAG "FLAG"

DEFINE FLGBP FLAG
<.OP FAD <32000,,FLAG>,0 >_3+220*<<FLAG>&LHF>-(3700)+<<FLAG>_<-27>>&17 TERMIN

;SWDEF NAME=EXPR	;SET "NAME" TO "EXPR" IFF "NAME" NOT DEFINED

DEFINE SWDEF ASSGT/
IRPS DUMMY,,[ASSGT]
IFNDEF DUMMY,ASSGT
.ISTOP
TERMIN
TERMIN

	;FOLLOWING MACROS TAKE ADVANTAGE
	;OF ARGUMENT EVALUATION AT EXPANSION TIME

DEFINE CONCAT A,B
A!B!TERMIN

DEFINE DEF A,B,C,D,E,F,G,H,I,J,K
DEFINE A!B!C!D!E!F!G!H!I!J!K!TERMIN
TERMIN

EQUALS DEF2,DEF	;FOR OLD PROGRAMS

DEFINE PRINTA A,B,C,D,E,F
IF1,[PRINTC Á!B!C!D!E!F
Ý
TERMIN


DEFINE PRINTB A,B,C,D,E,F
PRINTC Á!B!C!D!E!F
Š
TERMIN

	;(RIGHT) BYTE POINTER, POS ARG IS # BITS TO RIGHT OF BYTE

DEFINE POINTR POS,SIZ
<POS>_12.+<SIZ>_6,,TERMIN

	;(LEFT) BYTE POINTER, 1STBIT ARG IS # BITS TO LEFT OF BYTE

DEFINE POINTL 1STBIT,SIZ
<36.-<SIZ>-<1STBIT>>_12.+<SIZ>_6,,TERMIN

	;BYTE POINTER TO BYTE BEFORE FIRST IN WORD

DEFINE POINTZ SIZ
36.-<36./<SIZ>*<SIZ>>_12.+<SIZ>_6,,-1 TERMIN

	;(PLURAL) BYTE POINTER ARRAY TO LDB FROM INDEXED

DEFINE POINTS SIZ
REPEAT 36./<SIZ>,<36.-<SIZ>*<.RPCNT+1>>_12.+<SIZ>_6,,TERMIN

	;(ILDB) BYTE POINTER ARRAY TO ILDB FROM

DEFINE POINTI SIZ
REPEAT 36./<SIZ>,<36.-<SIZ>*.RPCNT>_12.+<SIZ>_6,,TERMIN

	;(BOTH) BYTE POINTER ARRAY TO EITHER LDB FROM OR ILDB FROM (OBSOLESCENT)

DEFINE POINTB SIZ
REPEAT 36./<SIZ>+1,<36.-<SIZ>*.RPCNT>_12.+<SIZ>_6,,TERMIN

	;ASSEMBLE INTO A CERTAIN LOCATION

DEFINE TMPLOC LCTN,CRUFT/
.ZZ==.
LOC LCTN
CRUFT
.=.ZZ
TERMIN

	;DECREMENT A 7 BIT BYTE POINTER

DEFINE DBP7 AC
ADD AC,[070000,,0]
TLNE AC,400000
SUB AC,[430000,,1]
TERMIN

	;DECREMENT 7 BIT BYTE POINTER AND JUMP

DEFINE DBP7J AC,ADR
ADD AC,[70000,,0]
JUMPGE AC,ADR
SUB AC,[430000,,1]
JRST ADR
TERMIN

	;ASSEMBLE FILE SPECIFIED BY TYPEIN (OBSOLESCENT)

DEFINE ..INSRT FILENAMES
IF1,[PRINTC FILENAMES PLEASE.
]
.INSRT @:JSF;FILENAMES
TERMIN

	;REPEAT AN INSTRUCTION WITH VARIOUS ADDRESSES

DEFINE INSIRP A,B
IRPS %%ADR,,[B]
A,%%ADR
TERMIN
TERMIN

	;NON-TS DEFINITIONS

PICON==2200	;IN RH(CONO PI,), TURN ON CHANNEL(S)
PICOFF==1200	;TURN OFF CHANNEL(S)
PICIRQ==4200	;REQUEST INTERRUPT ON CHANNEL(S)

	;DEFINE IO DEVICE SYM SUCH THAT DDT WILL TYPE IT OUT

DEFINE	IODEV LINE/OLDEND,IODEVC,OIODEV
	IODEVC==0
	IF1,EQUALS OIODEV,IODEV
	DEFINE IODEV ASSGT,OVAL
		IFNB [OVAL]ASSGT==OVAL
		IFB [OVAL]ASSGT
		IRPS %DEV,,[ASSGT]
		DEF IOD,\IODEVC,[
		%DEV=<BLKI %DEV,>-BLKI
		]
		.ISTOP
		TERMIN
	IODEVC==IODEVC+1
	TERMIN
	EQUALS OLDEND,END
	EXPUNGE END
	DEFINE END
		IF1,EQUALS IODEV,OIODEV
		IF2,[REPEAT IODEVC,[
		CONCAT IOD,\.RPCNT
		]]
		EQUALS END,OLDEND
		EXPUNGE OLDEND,IODEVC,OIODEV
		END!TERMIN
	IODEV LINE
TERMIN

IFNDEF SWRQ,.INEOF	;THAT'S ALL IF HE DOESN'TTAKE NOTICE OF TYPEIN
IFE SWRQ,.INEOF		;THAT'S ALSO ALL IF HE DOESN'T WANT TYPEIN

DEFINE INSERT LINE/
  IRPS %NAME,,[LINE]
    DEFINE %NAME DEFALT/
      .INSRT DSK:DEFALT  LINE
    TERMIN
  .ISTOP
  TERMIN
TERMIN

	PRINTA SWITCHES?
	EQUALS NO,.INEOF	;NO IS VALID ANSWER
%ZQ.$X:	.INSRT TTY:
LOC %ZQ.$X
	EXPUNGE NO,%ZQ.$X
PRINTA OK.;	;ACKNOWLEDGE NO OR .INEOF (USERS LIKE SIGNS OF LIFE)

DEFINE INSERT DEFALT/GENSYM
  IRPS %NAME,,[DEFALT]
    IFNDEF %NAME,[
      DEFINE %NAME
	.INSRT DSK:!TERMIN
    ]
    DEFINE GENSYM
      EXPUNG GENSYM
      %NAME!!TERMIN
    .ISTOP
    TERMIN
  GENSYM DEFALTîTERMIN

	;THAT'S ALL
