Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0078/libsim/boolfu.mac
There is 1 other file named boolfu.mac in the archive. Click here to see a list.
COMMENT * SIMULA specification;
OPTIONS(/E:QUICK,boolfunc);
INTEGER PROCEDURE boolfunc(f,x,y); INTEGER f,x,y;
COMMENT Bitwise Boolean function fu(f) of (x,y).
For definition of fu(f), see below.
;

!*;! MACRO-10 code !*;!

	TITLE	boolfunc
	ENTRY	boolfunc
	SUBTTL	SIMULA utility, Lars Enderin May 1977

;!*** Copyright 1977 by the Swedish Defence Research Institute. ***
;!*** Copying is allowed.					***

	;! Local definitions ;!

	f==<result==0>
	x==1
	y==2
	XTAC==2

fu:	SETZ		;! f=00 (2R0000) - FALSE
	AND	y(XTAC)	;! f=01 (2R0001) - x AND y
	ANDCA	y(XTAC)	;! f=02 (2R0010) - NOT x AND y
	SETM	y(XTAC)	;! f=03 (2R0011) - y
	ANDCM	y(XTAC)	;! f=04 (2R0100) - x AND NOT y
	SETA		;! f=05 (2R0101) - x
	XOR	y(XTAC)	;! f=06 (2R0110) - x XOR y
	IOR	y(XTAC)	;! f=07 (2R0111) - x OR y
	ANDCB	y(XTAC)	;! f=08 (2R1000) - NOT x AND NOT y (NAND)
	EQV	y(XTAC)	;! f=09 (2R1001) - x EQV y
	SETCA		;! f=10 (2R1010) - NOT x
	ORCA	y(XTAC)	;! f=11 (2R1011) - NOT x OR y (IMP)
	SETCM	y(XTAC)	;! f=12 (2R1100) - NOT y
	ORCM	y(XTAC)	;! f=13 (2R1101) - x OR NOT y
	ORCB	y(XTAC)	;! f=14 (2R1110) - NOT x OR NOT y (NOR)
	SETO		;! f=15 (2R1111) - TRUE always

	OPDEF	RET	[POPJ 17,]
	X1==1

boolfunc:
	MOVE	x(XTAC)
	HRRZ	X1,f(XTAC)
	ANDI	X1,17
	XCT	fu(X1)
	MOVEM	result(XTAC)
	RET
	END;