Paste: JKLatch in Unnamed Forth

Author: zzing
Mode: forth
Date: Fri, 29 Apr 2011 03:16:21
Plain Text |
JKLATCH
INPUT: J K
OUTPUT: Q

: TOGGLE Q @ NOT Q = ;
: RESET 0 Q = ;
: SET 1 Q = ;
: JKLATCH J @ K @ AND 
	IF TOGGLE
	ELSE J @ K @ = 
		IF
		ELSE J @ 1 = 
			IF SET
			ELSE RESET
			THEN
		THEN
	THEN ;

Annotation: Alteration, more like c4th

Author: zzing
Mode: forth
Date: Fri, 29 Apr 2011 03:36:43
Plain Text |
MODULE: JKLATCH
INPUT: J K
OUTPUT: Q

: TOGGLE Q @ NOT Q = ;
: RESET 0 Q = ;
: SET 1 Q = ;
: JKLATCH J @ K @ AND 
	IF TOGGLE ;
	THEN J @ K @ = 
		IF ;
		THEN J @ 1 = 
			IF SET
			THEN RESET ;
		;
	;
	

New Annotation

Summary:
Author:
Mode:
Body: