                               CARDAC.HLP


CARDAC.BAS SIMULATES THE ACTION OF A PRIMITIVE COMPUTER
NAMED CARDIAC.  YOUR PROGRAM SHOULD BE ENTERED AS DATA
STARTING AT STATEMENT 10 AND ENDING BEFORE STATEMENT 50.  ADDRESS
AND INSTRUCTION INFORMATION MUST BE SEPARATED BY COMMAS.  AS
MANY PROGRAM ELEMENTS AS YOU WISH MAY BE ENTERED IN EACH
DATA STATEMENT.  FOR EXAMPLE, '10 DATA 20,006,21,106,ETC.'
AFTER YOU HAVE COMPLETED ENTERING YOUR CARDIAC
PROGRAM, CARDIAC DATA MAY BE ENTERED USING AN ENTRY OF
'99,800' AS A SEPARATOR BETWEEN THE PROGRAM AND THE DATA.
END YOUR CARDIAC 'DECK' WITH A '0'.  C PROGRAM MAY BE BOOTSTRAPED BY
ENTERING IT AS CARDIAC DATA FOLLOWING THE DATA SIGNAL '99,800'.

THESE ARE THE CARDIAC OP CODES:

0--READ
1--CLEAR AND ADD
2--ADD
3--IF ACCUMULATOR NEGATIVE TRANSFER TO ADDRESS
4--SHIFT
5--PRINT
6--STORE
7--SUBTRACT
8--TRANSFER CONTROL
9--HALT

THE FOLLOWING IS A SAMPLE CARDIAC PROGRAM THAT DIVIDES ONE NUMBER
INTO ANOTHER AND PRINTS THE QUOTIENT AND REMAINDER.  THE COMMENTS
ON THE RIGHT TELL WHAT EACH STEP IS DOING.

LOC  INSTRUCTION		COMMENT
===  ===========		======
01	090		READ THE FIRST NUMBER INTO LOCATION 90
02	091		READ THE SECOND NUMBER INTO LOCATION 91
03	590		PRINT THE FIRST NUMBER
04	591		PRINT THE SECOND NUMBER
05	190		CLEAR THE ACCUMULATOR AND MOVE THE NUMBER IN 
			LOCATION 90 (THE FIRST NUMBER) INTO THE ACCUMULATOR
06	791		SUBTRACT THE NUMBER IN LOCATION 91 (THE SECOND 
			NUMBER) FROM THE NUMBER IN THE ACCUMULATOR LEAVING
			THE RESULTS IN THE ACCUMULATOR
07	313		TEST THE ACCUMULATOR AND IF IT IS NEGATIVE JUMP TO
			LOCATION 13 AND CONTINUE EXECUTION FROM THERE
08	690		STORE THE RESULTS OF THE SUBTRACTION BACK IN 
			LOCATION 90
09	192		CLEAR THE ACCUMULATOR AND MOVE THE SUBTRACTION
			COUNT STORED IN LOCATION 92 INTO THE ACCUMULATOR
10	200		ADD THE CONTENTS OF LOCATION 00 (LOC 00 CON-
			TAINS A 1 ALL OF THE TIME) TO THE ACCUMULATOR
11	692		STORE THE CONTENTS OF THE ACCUMULATOR BACK IN LOC 92
12	805		JUMP BACK TO LOCATION 5
13	592		PRINT THE QUOTIENT
14	590		PRINT THE REMAINDER
15	900		HALT THE EXECUTION OF THE PROGRAM

TO ENTER THIS PROGRAM INTO THE COMPUTER USING 14 AND 3 AS THE DIVIDEND
AND DIVISOR THE FOLLOWING SEQENCE OF COMMANDS WOULD BE USED:
10  DATA 01,090,02,091,03,590,04,591,05,190,06,791,07,312,08,690,09,192
20  DATA 10,200,11,692,12,805,13,592,14,590,10,900
30  DATA 99,800,14,3,0

TO RUN THE PROGRAM YOU MUST TYPE 'R BASIC' IF THE COMPUTER 
PRINTS A '.' WHEN YOU HIT RETURN.  WHEN THE COMPUTER
PRINTS 'READY, FOR HELP TYPE HELP' OR 'READY' TYPE IN
'OLD D11:CARDAC'.  THE COMPUTER WILL RESPOND WITH ANOTHER 
'READY'.  TYPE IN YOUR DATA STATEMENTS (IE. PROGRAM AND
DATA) AND THEN TYPE 'RUN 210' OR 'RUNNH 210' AND YOUR PROGRAM
WILL BE EXECUTED.  FIRST YOU WILL BE ASKED IF YOU WANT A 'DUMP'. A DUMP IS
JUST A LISTING OF ALL 100 STORAGE LOCATIONS AND THEIR CONTENTS.  NEXT,
YOUR PROGRAM WILL BE LISTED AND RUN.
