Trailing-Edge
-
PDP-10 Archives
-
-
There are no other files named in the archive.
PDP-8 SIMULATOR
===============
--------
ABSTRACT
========
THE PDP-8 SIMULATOR HAS TWO MAIN PARTS, THE
FIRST ACCEPTS INPUT IN PAL III LANGUAGE AND ASSEMBLES IT, AND
THE SECOND EXECUTES THE INPUT PROGRAM.
AT EACH STAGE OF OPERATION, INPUT, ASSEMBLY OR EXECUTION
THE SIMULATED PDP-8 MEMORY CAN BE EXAMINED, IN OCTAL DIGITS.
THE SIMULATOR ASSEMBLES AND EXECUTES MANY OF THE PAL III
INSTRUCTIONS, BUT ONLY A PORTION OF THE INPUT-OUTPUT INSTRUCTIONS,
AND NONE OF THE MICROPROGRAMMING FACILITIES ARE AVAILABLE.
COMMUNICATION AND INTERACTION WITH THE SIMULATOR ARE DONE
THROUGH THE TELETYPE , WHICH IS ALSO THE ONLY PERIPHERAL DEVICE
HANDLED BY THE SIMULATOR.
PROGRAMS CAN BE STORED AND RECALLED USING THE
DISK OPERATIONS FACILITIES.
THIS PROGRAM WAS WRITTEN IN MACRO-10 ON THE BRANDEIS
UNIVERSITY PDP-10 COMPUTER. WE WISH TO THANK THE COMPUTER STAFF
AND PROFFESOR MAX CHRETIEN FOR THEIR COOPERATION.
DESCRIPTION, PRINCIPLES OF OPERATION AND GENERAL FEATURES OF
PDP-8 SIMULATOR,
MACRO-10 PROGRAM, WRITTEN ON BRANDEIS' PDP-10 COMPUTER BY
ODED SHMUELI '77
KWABENA AKUFO '77
ADVISOR: MAX CHRETIEN
PROF. OF PHYSICS
BRANDEIS UNIVERSITY
DATE: OCTOBER 1975
C O N T E N T S
= = = = = = = =
1. BASIC PRINCIPLES
2. USERS' VIEW (SIMPLIFIED)
3. GENERAL FEATURES
4. CONCLUSION
APPENDIX A. SAMPLE PROGRAM IN PAL III
APPENDIX B. GENERAL FLOWCHART
APPENDIX C. PROCEDURAL USE OF SIMULATOR INCLUDING
(I) PROGRAM INPUT
(II) EXAMINATION OF LOCATIONS
(III) WRITING ON, AND READING FROM DISK
(IV) EXECUTION AND EXAMINATION OF RESULTS
(V) MODIFICATION OF PROGRAM
(VI) READING OF A STORED PROGRAM FROM DISK,
EXECUTING IT.
APPENDIX D. AVAILABLE INSTRUCTIONS
APPENDIX E. PROGRAM LISTING OF THE PDP-8 SIMULATOR
BASIC PRINCIPLES
THE PROGRAM IS MADE UP OF TWO MAIN PARTS. THE FIRST
PART CONSISTS OF AN INPUT UNIT FOR PAL III PROGRAMS AND AN
ASSEMBLER. THE OUTPUT OF THE ASSEMBLER IS IDENTICAL TO
THAT OF THE PDP-8 ASSEMBLER, AND IS STORED IN AN ARRAY
CALLED PDP-8.
THE SECOND PART OF THE PROGRAM, WHICH IS INDEPENDENT
OF THE FIRST, SIMULATES THE ACTUAL EXECUTION OF A PALL III
PROGRAM ON THE PDP-8. THIS PART CAN HANDLE MEMORY REFERENCE
INSTRUCTIONS, OPERATE MICROINSTRUCTIONS, AND INPUT/OUTPUT
1
TRANSFER INSTRUCTIONS. MICROPROGRAMMING AND AUTOINDEXING
FACILITIES ARE NOT AVAILABLE. SINCE THE TELETYPE IS THE
ONLY MEDIUM OF COMMUNICATION BETWEEN THE USER AND THE
SIMULATOR, THE INTERRUPT FACILITY OF THE PDP-8 IS NOT NEEDED
AND THEREFORE NOT SIMULATED EXCEPT FOR THE TELETYPE, WHICH IS
AN ACTUAL MEDIUM OF COMMUNICATION.
USERS' VIEW
A GOOD WAY TO DESCRIBE THE USE OF THIS SIMULATOR IS
THROUGH THE USE OF ILLUSTRATIONS FOLLOWED BY A GENERAL
DISCUSSION.
PROBLEM: WRITE A PROGRAM TO SUM THE NUMBERS 2,-3,10
REFER APPENDIX A FOR SAMPLE PROGRAM.
1.
REFER TO APPENDIX D FOR LIST OF INSTRUCTIONS AVAILABLE ON
THE SIMULATOR.
-2-
STEP 1.
IN THE MONITOR MODE TYPE
.EX PDP/M,TR.MAC
STEP 2.
THE USER WILL RECEIVE THE FOLLOWING MESSAGES AT THE
START OF THE EXECTION OF THE SIMULATOR PROGRAM:
.EX PDP/M.TR.MAC
LINK: LOADING
[LNKXCT PDP EXECUTION]
TYPE 1,2,3,4,5,6,7,A,B,C,D
B: COMPILE, C OR D: EXECUTE, 3: COPY FROM DISK, 6: WRITE N DISK
4: TO START WRITING PROGRAM WITH * (DESTROYS OTHER PROGRAMS ON FILE)
5: START PROGRAM INPUT (PRESERVES OTHER PROGRAMS ON FILE
UPPER CASE 1(!): INTERRUPT FACILITY TO EXAMINE COMPILATION ANYWHERE
CENT
FOLLOWING THE WORD 'CENT' AT THE END OF THE ABOVE
MESSAGES, TYPE '4'.
ADDITIONAL MESSAGES WILL BE OUTPUT.
4INITIALIZATION WILL BE DONE NOW
PD8 TABLE NUMBERED
INPUT PROGRAM
AFTER THE MESSAGE 'INPUT PROGRAM', THE USER SHOULD
TYPE AN ASTERISK(*) AND WAIT FOR THE OUTPUT OF A BLANK.
THEN TYPE THE STARTING LOCATION OF THE PROGRAM AND
RETURN THE CARRIAGE.
THE USER GETS THE MESSAGE
* 200
LC VALUE (*) KNOWN IS IN LC
THE USER WILL THEN START INPUT OF THE PROGRAM IN THE FOLLOWING WAY:
(1) LABELS,IF THEY EXIST SHOULD ALWAYS CONSIST OF TWO
CHARACTERS.IF THE LINE CONTAINS NO LABEL , CONTROL I
SHOULD BE TYPED. IN EITHER CASE , THE USER SHOULD WAIT UNTIL BLANKS
ARE OUTPUT AND THEN RESUME INPUT BY TYPING EITHER A COLON(:) OR COMMA(,).
COLON(:)INDICATES THAT WHAT FOLLOWS IS A MNEMONICS.
COMMA(,)INDICATES A NUMBER TO FOLLOW.
(2) MNEMONICS SHOULD BE A VALID PAL III INSTRUCTION ,
OTHERWISE THE USER WILL RECEIVE AN ERROR MESSAGE AND WILL BE
ENCOURAGED TO TRY AGAIN.
(3) INDIRECT ADRESSING IS DONE BY TYPING 'I' AFTER
THE MNEMONICS.
(4) IF THERE IS AN OPERAND IT MUST BE TWO CHARACTERS
LONG. AT THE END OF INPUT OF THE OPERAND THE TELETYPE WILL
AUTOMATICALLY MOVE TO TO THE NEXT LINE TO ACCEPT FURTHER INPUT.
IN CASE THERE IS NO OPERAND , THE USER SHOULD TYPE A CARRIAGE RETURN.
NUMBERS ARE OCTAL AND SHOULD BE PRECEDED WITH EITHER A PLUS
OR A MINUS SIGN. IN THE CASE OF A MINUS , THE SIMULATOR
ACKNOWLEDGES RECEIPT BY OUTPUTTING "(MINUS)". AFTER A NUMBER ,
THE USER SHOULD FIRST TYPE ONE CARRIAGE RETURN TO INDICATE
THE END OF INPUT OF THE NUMBER AND THEN TYPE A SECOND ONE TO
RETURN TO THE NEXT LINE.
(NOTE: ZERO MUST BE PRECEDED BY A PLUS SIGN.)
-3-
COMPILATION OF PROGRAM STARTS BY TYPING UPPERCASE P(@) AT THE
BEGINING OF A NEW LINE. THE USER RECEIVES THE FOLLOWING MESSAGE:
: DCA
: HLT
CC ,+43
D5 ,-(MINUS)21
@
COMPILATION STARTS
!!! TO INTERRUPT, ANYTHING TO CONTINUE
IF THE USER TYPES ANYTHING OTHER THAN UPPERCASE 1(!),
THE USER GETS TO 'CENT'.(THE PROGRAM CONTROL CENTER)
TO EXECUTE, THE USER SHOULD TYPE 'C'.
THE SIMULATOR RESPONDS IN THE FOLLOWING MANNER:
,CENT
CSTART EXEC. AT LABEL:
THE USER HAS TO SUPPLY A LABEL WHICH SHOWS WHERE
EXECUTION IS TO BEGIN.
!!! TO INTERRUPT, ANYTHING TO CONTINUE/CENT
CSTART EXEC. AT LABEL: KK
AC AT END OF EXECUTION: 000000000000
! TO DEBUG ANYTHING TO CONTINUE
DEBUGGING FACILITIES ENABLE USER TO EXAMINE
LOCATIONS IN THE SIMULATED PDP-8. AFTER EXECUTION, SHOULD THE
USER TYPE UPPERCASE 1(!) THE SIMULATOR RESPONDS AS
FOLLOWS:
!!!!!...INTERUPTION...!!!
INPUT LOW LC TO TRANSLATE
400
-5-
THE USER SHOULD TYPE THE OCTAL VALUE OF THE
LOCATION, AT WHICH EXAMINATION IS TO BEGIN, IN THE PDP-8
THE SIMULATOR RESPONDS BY TYPING:
UP LC TO TRANS.
400
USER SHOULD TYPE THE OCTAL VALUE OF THE LOCATION UP
TO WHEREVER EXAMINATION IS TO BE DONE.
THE COMPUTER WILL THEN GIVE AN OCTAL LISTING OF
THOSE LOCATIONS AND THEIR CONTENTS. (SEE APPENDIX C)
TO COME BACK TO CENT. TYPE UPPERCASE L(\)
-6-
GENERAL FEATURES
LOOKING AT APPENDIX B, ONE WILL NOTICE THE DISK
OPERATIONS AND THE VARIETY OF POSSIBILITIES IN INPUT,
EXAMINATION, EXECUTION AND DEBUGGING OF A PROGRAM. WE
SHALL DISCUSS CERTAIN IMPORTANT PROCEDURES.
THE USE OF STATE S1 AND S3
THE '4', SHOULD NOT BE IN MOST CASES TYPED
TWICE (AT CENT), SINCE ONE FEATURE OF STATE S1 IS TO ZERO
THE WHOLE SIMULATED PDP-8 MEMORY. THUS SHOULD THE USER
WISH TO RETURN TO INPUT MODE, STATE S3, TO INPUT NEW PROGRAMS
OR TO CHANGE EXISTING ONES, A '5' SHOULD BE TYPED (AT CENT)
INSTEAD OF '4'.
IN GENERAL, '4' IS TYPED ONLY ONCE AT THE VERY
BEGINING OF THE USE OF THE SIMULATOR, AND AFTERWARDS '5' IS
USED TO RESUME INPUT.
READING AND WRITING ON DISK FILES
THE USER SHOULD NOTE THE FOLLOWING:
WHENEVER THE USER WRITES ONTO THE DISK FILE TO STORE
A PROGRAM, WHATEVER IS ON THE DISK FILE, IS REPLACED BY
THE WHOLE OF THE CURRENT SIMULATED PDP-8 MEMORY.
SIMILARLY, READING STORED PROGRAMS FROM DISK FILE
REPLACES ALL OF THE CURRENT SIMULATED PDP-8 MEMORY BY
WHATEVER IS ON THE DISK FILE.
THUS, IF THERE IS A PROGRAM ON THE DISK FILE WHICH THE
USER WISHES TO USE WITH OTHER PROGRAMS THAT ARE YET TO
BE INPUT, THE USER SHOULD EMPLOY THE FOLLOWING PROCEDURE,
-7-
(A) COPY FROM DISK
(B) TYPE THE NEW PROGRAMS OR MAKE CORRECTIONS TO
THE PREVIOUSLY DISK STORED PROGRAM.
DEBUGGING
=========
THE USER SHOULD BE AWARE THAT ONCE COMPILATION IS
DONE, THE MNEMONIC SOURCE PROGRAM IS NO LONGER STORED.
THUS DEBUGGING IS DONE IN CLOSE CONNECTION WITH THE PDP-8
MACHINE LANGUAGE. USING UPPERCASE 1(!), THE USER CAN EXAMINE
ANY LOCATION IN THE SIMULATED PDP-8 MEMORY.
EXAMPLES ARE PROVIDED IN APPENDIX C.
CORRECTIONS TO PROGRAM
======================
SHOULD A NEED TO MAKE CORRECTIONS IN A PROGRAM ARISE,
THE USER TYPE '5' AT CENT.
AFTER RECEIVING THE MESSAGE, 'INPUT PROGRAM', THE
USER SHOULD TYPE * (LOCATION NUMBER) TO RECEIVE;
LC VALUE (*) KNOWN IS IN LC
THEN THE LOCATION CAN BE REPLACED SIMPLY BY TYPING THE NEW LINE.
REPLACEMENTS CAN BE DONE FOR ANY OTHER LOCATIO WITH
NO NEED TO GO BACK TO CENT.
CONSULT APPENDIX C FOR FURTHER DETAILS AND EXAMPES
-8-
CONCLUSION
A FINAL REMARK CONCERNS THE REACTION TIME OF THE
TELETYPE. WHEN THE COMPUTER IS VERY BUSY, THE USER ADVISED TO TYPE
THE PROGRAM VERY SLOWLY AND ALWAYS TO USE A RELIABLE TELETYPE.
THE USE OF THE PRINTING TELETYPE IS PREFERRED TO THAT
OF THE CRT TELETYPE.
THE MOST IMPORTANT PART OF THIS PAPER IS APPENDIX B
AND THE USER IS ADVISED TO HAVE A COPY OF IT CLOSE BY
WHILE USING THE SIMULATOR PROGRAM. WE ARE AWARE THAT USERS MIGHT
FIND IT DIFFICULT TO ADJUST TO A SYSTEM THAT HAS MNEMONICS INPUT
FACILITIES, MACHINE LANGUAGE DEBUGGING FACILITIES AND IN
WHICH COMPILING, LOADING, DEBUGGING AND EXECUTION ARE BASICALLY
DONE CONTINUOUSLY AND AT ANY DESIRED SEQUENCE.
NEVERTHELESS, WE FEEL IT IS A GOOD INTRODUCTION TO
BOTH MACHINE LANGUAGE AND SYSTEM PROGRAMMING.
THROUGH THIS PROJECT WE HAVE GAINED A NEW INSIGHT
INTO SOFTWARE DESIGN PROBLEMS, HOWEVER PRIMITIVE AND LIMITED
THE OPERATING SYSTEM THAT WE HAVE CREATED IS.
CIRCLE : A CHARACTER TO TYPE WHEN IN CENT.
ELIPSE : A CHARACTER TO TYPE TO SWITCH STATES
S S : BY TYPING C YOU GET FROM
STATE S TO STATE S
: INDICATES AUTOMATIC TRANSITION AFTER COMPLETION OF MISSION.
CENT: ANY TYPING IN THE 'CENT' STATE SHOULD BE DONE
FOLLOWING THE OUTPUT OF THE WORD 'CENT'.
! : IN CENT, S3 :TYPING UILL PRODUCE TRANSLATION
MESSAGES BEGINING "LOW LC TO TRANSLATE".
AT ALL OTHER STATES UPPERCASE 1(!) SHOULD BE TYPED ONLY WHEN
MESQAGE GIVES THE USER OPTION TO DO SO.
APPENDIX D
THE FOLLOWING ARE PAL III INSTRUCTIONS THAT CAN BE USED
ON THE SIMULATOR.
MEMORY REFERENCE INSTRUCTIONS
AND
TAD
ISZ
DCA
JMS
JMP (JMP .-1 NOT ALLOWED)
GROUP 1 OPERATE MICROINSTRUCTIONS
NOP
CLA
CLL
CMA
CML
RAR
RAL
RTR
RTL
IAC
GROUP 2 OPERATE MICROINSTRUCTIONS
SMA
SZA
SPA
SNA
SNL
SZL
SKP
HLT
TELETYPE KEYBOARD READER
KCF
KSF
KCA
KRS
KRB
TELETYPE TELEPRINTER
TFL
TSF
TCF
TPC
TLS
00020 APPENDIX C
00040
00060
00080
00100 * 200
00200 LC VALUE (*) KNOWN IS IN LC
00300
00400 ST : CLA
00500 : CLL
00580 : TAD RQ
00590 : DCA RG
00600 : TLS
00700 : TAD MC
00800 : DCA CT
00900 NX : TAD I RG
01000 : JMS TY
01100 : ISZ RG
01200 : ISZ CT
01300 : JMP NX
01400 : HLT
01500 TY ,+0
01600 T2 : TSF
01700 : JMP T2
01800 : TLS
01900 : CLA
02000 : JMP I TY
02100 MC ,-(MINUS)15
02200 CT ,+0
02300 RG ,+0
02350 RQ ,+400
02400 *400
02500 LC VALUE (*) KNOWN IS IN LC
02600
02700 JJ ,+312
02800 OO ,+317
02900 HH ,+310
03000 N1 ,+316
03100 B1 ,+240
03200 A1 ,+301
03300 N2 ,+316
03400 DD ,+304
03500 B2 ,+240
03600 MM ,+315
03700 A2 ,+301
03800 RR ,+322
03900 YY ,+331
04000 @
04100 COMPILATION STARTS
04200
04300 !!! TO INTERRUPT, ANYTHING TO CONTINUE/CENT
04400 CSTART EXEC. AT LABEL: ST
04500
04550 JOHN AND MARY
04600 AC AT END OF EXECUTION : 000000000000
04700 ! TO DEBUG ANYTHING TO CONTINUE/END OF DEBUG
05000 UPPER CASE L(\) TO EXIT ANYTHING TO DEBUG AGAIN
05100 \CENT
05300 5INPUT PROGRAM
05400 * 221
05600 LC VALUE (*) KNOWN IS IN LC
05700
05800 MC ,-(MINUS)14
05900 *411
05980 LC VALUE (*) KNOWN IS IN LC
05990
06000 SS ,+323
06100 UU ,+325
06200 EE ,+305
06300 @
06400 COMPILATION STARTS
06500
06600 !!! TO INTERRUPT, ANYTHING TO CONTINUE!!!!...INTERUPTION...!!!
06700 INPUT LOW LC TO TRANSLATE
06800
06900 221
07100 UP LC TO TRANS.
07200
07300 221
07400
07500 000000000221 777777777764
07600
07650 CENT
07700 !!!!...INTERUPTION...!!!
07800 INPUT LOW LC TO TRANSLATE
07900
08000 411
08200 UP LC TO TRANS.
08300
08400 413
08500
08600 000000000411 000000000323
08650
08700 000000000412 000000000325
08750
08800 000000000413 000000000305
08850
08900 CENT
09000 CSTART EXEC. AT LABEL: ST
09100
09200 JOHN AND SUE
09300
09400 AC AT END OF EXECUTION: 000000000000
09500 ! TO DEBUG ANYTHING TO CONTINUEH END OF DEBUG
09600 UPPERCASE L(\) TO EXIT, ANYTHING TO DEBUG AGAIN\
09700 CENT
00100 APPENDIX A
00200
00300
00400
00500 * 200
00600 LC VALUE (*) KNOWN IS IN LC
00700
00800 BG : CLA
00900 : CLL
01000 : TAD N1
01100 : TAD N2
01200 : TAD N3
01300 : DCA SM
01400 : HLT
01500 N1 ,+2
01600 N2 ,-(MINUS)3
01700 N3 ,+10
01800 SM ,+0
01900 @
02000 COMPILATION STARTS
02100
02200 !!! TO INTERUPT, ANYTHING TO CONTINUE/CENT
02300 6CENT
02400 CSTART EXEC. AT LABEL: BG
02500
02600 AC AT END OF EXECUTION: 000000000000
02700 ! TO DEBUG ANYTHING TO CONTINUE!!!!...INTERUPTION...!!!
02800 INPUT LOW LC TO TRANSLATE
02900
03000 212
03100 UP LC TO TRANS.
03200
03300 212
03400
03500 000000000212 000000000007
03600
03700 END OF DEBUG
03800 UPPERCASE L(\) TO EXIT, ANYTHING TO DEBUG AGAIN
03900 \CENT
BOX 1537,
BRANDEIS UNIVERSITY,
WALTHAM, MASS. 02154
OCT. 24, 1975
DEAR SIRS,
ENCLOSED IS A PAPER DESCRIBING THE FEATURES OF
A PDP-8 SIMULATOR.
PLEASE, LET US KNOW WHETHER YOU ARE INTERESTED IN
THIS SIMULATOR PROGRAM.
SINCERELY YOURS
ODED SHMUELI
KWABENA AKUFO
DIGITAL EQUIPMENT CORPORATION
SOFTWARE DEPARTMENT
MAYNARD,MASSACHUSETTS 01754