Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-03 - decus/20-0090/kismet.mac
There is 1 other file named kismet.mac in the archive. Click here to see a list.
	TITLE	KISMET PROGRAMED BY ROBERT WILSON




IF1<PRINTX	K>
IF2<PRINTX	M>


;;;ACCUMULATORS
AC=15
AC1=6
AC2=14
AC3=16

DA=1
DB=2
DC=3
DD=4
DE=5

INST=7
C=10
DIV=11
REM=12
RAD=13
F=0
P=17
;;;DEFINITIONS


DEFINE	ROLL
	<CALLI	DA,23
	CAME	DA,RANTST
	JRST	.+6
	AOS	RANCNT
	MOVE	DC,RANCNT
	ADDI	DA,117
	SOJG	DC,.-1
	JRST	.+3
	MOVEM	DA,RANTST
	SETZM	RANCNT
	IMUL	DA,DA
	TLZ	DA,760000
	XOR	DA,[013702175435]
	TLZ	DA,760000
	JUMPE	DA,.-2
	MOVSI	DC,-7
	MOVNI	DD,6
	MOVE	DB,DA
	ROT	DB,13
	XOR	DB,DA
	ROT	DB,-6
	LSHC	DA,6
	AOJN	DD,.-5
	MOVEM	DA,RNDDAT(DC)
	ADD	DC,[000001000001]
	JUMPL	DC,.+1
	MOVE	F,RNDDAT
	IDIVI	F,10
	CAIL	DA,1
	CAIL	DA,7
	JRST	.-36>

DEFINE	ROLLA
	<ROLL
	MOVEM	DA,DICE>


DEFINE	ROLLB
	<ROLL
	MOVEM	DA,DICE+1>


DEFINE	ROLLC
	<ROLL
	MOVEM	DA,DICE+2>


DEFINE	ROLLD
	<ROLL
	MOVEM	DA,DICE+3>


DEFINE	ROLLE
	<ROLL
	MOVEM	DA,DICE+4>
DEFINE	COLOR
	<MOVE	AC,DA
	ADD	AC,DB
	MOVE	AC1,DB
	ADD	AC1,DC
	MOVE	AC2,DC
	ADD	AC2,DD
	MOVE	AC3,DD
	ADD	AC3,DE
	CAME	DA,DB
	CAIN	AC,7
	JRST	.+2
	JRST	.+14
	CAME	DB,DC
	CAIN	AC1,7
	JRST	.+2
	JRST	.+10
	CAME	DC,DD
	CAIN	AC2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/
? DOES NOT COMPUTE
/]
	ADDI	RAD,2
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	JRST	CAT
CATG:	JRST	ACES
	JRST	DEUCES
	JRST	TREYS
	JRST	FOURS
	JRST	FIVES
	JRST	SIXES
	JRST	PAIR
	JRST	KIND3
	JRST	STRT
	JRST	FLUSH
	JRST	FH
	JRST	FHSC
	JRST	KIND4
	JRST	YARB
	JRST	KSMT
HELP:	OPEN	1,[0
		SIXBIT/SYS/
		IBUF]
	JRST	NOHELP
	LOOKUP	1,[SIXBIT/KISMET/
		SIXBIT/HLP/
		0
		0]
	JRST	NOHELP
GETCHR:	JSP	AC1,LOAD
	TTCALL	1,AC
	JRST	.-2
LOAD:	SOSGE	IBUF+2
	JRST	FILBUF
	ILDB	AC,IBUF+1
	JRST	@AC1
FILBUF:	IN	1,
	JRST	LOAD
	CLOSE	1,
	RELEAS	1,
	MOVEI	RAD,1
	JRST	ROLL1
NOHELP:	TTCALL	3,[ASCIZ/?
? HELP IS UNAVAILABLE.
/]
	CALLI	1,12
ACES:	HLRZ	AC,TEST
	MOVEI	AC1,0
	SKIPE	AC
	JRST	ACEERR
	CAIN	DA,1
	ADDI	AC1,1
	CAIN	DB,1
	ADDI	AC1,1
	CAIN	DC,1
	ADDI	AC1,1
	CAIN	DD,1
	ADDI	AC1,1
	CAIN	DE,1
	ADDI	AC1,1
	CAIN	AC1,0
	JRST	NOACES
OUTACE:	ADDI	AC1,60
	TTCALL	3,[ASCIZ/YOUR SCORE FOR #1-ACES IS /]
	TTCALL	1,AC1
	TTCALL	3,[BYTE(7) 15,12,0]
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	SUBI	AC1,57
	HRLM	AC1,TEST
	MOVEI	F,0
	PUSHJ	P,CATTST
	CAIE	F,1
	JRST	ROLL1
	JRST	TOTAL
ACEERR:	TTCALL	3,[ASCIZ/YOU HAVE ALREADY USED THIS CATEGORY. CHOOSE AGAIN /]
	ADDI	RAD,1
	C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[ASCIZ/YOU HAVE ALREADY USED THIS CATEGORY. CHOOSE AGAIN /]
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	JRST	CAT+1
NOFLSH:	TTCALL	3,[ASCIZ/YOU DO NOT HAVE A 'FLUSH'. DO YOU WANT A ZERO?/]
	TTCALL	4,AC
	TTCALL	11,
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	CAIE	AC,131
	JRST	CAT
	MOVEI	AC,0
	JRST	OUTFL
FH:	HLRZ	AC1,TEST+5
	SKIPE	AC1
	JRST	FHERR
	FHOUSE
	JRST	NOFH
	SUM
	ADDI	AC,17
OUTFH:	MOVE	DIV,AC
	TTCALL	3,[ASCIZ/YOUR SCORE FOR #11-FULL HOUSE IS /]
	PUSHJ	P,DECOUT
	TTCALL	3,[BYTE(7) 15,12,0]
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	ADDI	AC,1
	HRLM	AC,TEST+5
	MOVEI	F,0
	PUSHJ	P,CATTST
	CAIE	F,1
	JRST	ROLL1
	JRST	TOTAL
FHERR:	TTCALL	3,[ASCIZ/YOU HAVE ALREADY USED THIS CATEGORY. CHOOSE AGAIN /]
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	JRST	CAT+1
NOFH:	TTCALL	3,[ASCIZ/YOU DO NOT HAVE A 'FULL HOUSE'. DO YOU WANT A ZERO?/]
	TTCALL	4,AC
	TTCALL	11,
	ADDI	RAD,1
	CAIL	RAD,67
	PUSHJ	P,ENDPAG
	CAIE	AC,131
	JRST	CAT
	MOVEI	AC,0
	JRST	OUTFH
FHSC:	HRRZ	AC1,TEST+5
	SKIPE	AC1
	JRST	FHSERR
	COLOR
	JRST	NOFHSC
	FHOUSE
	JRST	NOFHSC
	SUM
	ADDI	AC,24
OUTFHS:	MOVE	DIV,AC
	TTCALL	3,[ASCIZ/YOUR SCORE FOR #12-FULL HOUSE (SAME COLOR) IS /]
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L	1,[12]
	AOJL	RAD,.-1
	PUSHJ	P,ENDPAG+7
	JRST	FINISH
ENDPAG:	SUBI	RAD,67
	MOVMS	RAD,
	MOVEI	F,4
	SUBI	F,RAD
	TTCALL	1,[12]
	SOJGE	F,.-1
	SETZ	F,
	TTCALL	3,[ASCIZ/
------------------------------------------------------------------------
/]
	TTCALL	1,[13]
	MOVEI	RAD,0
	POPJ	P,
CATTST:	MOVEI	AC,6
	HRRZ	AC1,TEST(AC)
	CAIN	AC1,0
	POPJ	P,
	HLRZ	AC1,TEST(AC)
	CAIN	AC1,0
	POPJ	P,
	SOJGE	AC,.-6
	HLRZ	AC1,TEST+7
	CAIN	AC1,0
	POPJ	P,
	MOVEI	F,1
	POPJ	P,
DECIN:	SETZ	AC,
	TTCALL	4,AC1
	CAIN	AC1,15
	JRST	.-2
	CAIE	AC1,12
	CAIN	AC1,33
	POPJ	P,
	IMULI	AC,12
	SUBI	AC1,60
	ADD	AC,AC1
	JRST	DECIN+1
DECOUT:	IDIVI	DIV,12
	PUSH	P,REM
	SKIPE	DIV
	PUSHJ	P,DECOUT
	POP	P,AC3
	ADDI	AC3,60
	TTCALL	1,AC3
	POPJ	P,
	RELOC	140
FINISH:	CALLI	1,12
DICE:	BLOCK	5
IBUF:	BLOCK	3
PDL:	BLOCK	50
TEST:	BLOCK	10
NAME:	SIXBIT/ACES/
	SIXBIT/DEUCES/
	SIXBIT/TREYS/
	SIXBIT/FOURS/
	SIXBIT/FIVES/
	SIXBIT/SIXES/
	SIXBIT/2 PAIR/
	SIXBIT/3 KIND/
	SIXBIT/STRAIT/
	SIXBIT/FLUSH/
	SIXBIT/FHOUSE/
	SIXBIT/FHSC/
	SIXBIT/4 KIND/
	SIXBIT/YARB/
	SIXBIT/KISMET/
RANTST:	0
RANCNT:	0
RNDDAT:	BLOCK	7
	END	KISMET