perm filename ARM.PAL[V,VDS]1 blob sn#264832 filedate 1977-02-15 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00012 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00003 00002	.TITLE ARM
C00004 00003	FIX-UPS TO ASSEMBLE FOR PDP11/45
C00006 00004	FIX-UPS TO ASSEMBLE FOR LSI-11
C00007 00005	FILL LOW CORE TRAP VECTORS
C00010 00006	DR11C STATUS REGISTER BIT DEFINITIONS
C00013 00007	DEFINITIONS FOR THE DATA STRUCTURES
C00016 00008	HASH TABLE AND SYMBOL DATA BLOCKS FOR COMMAND INSTRUCTIONS
C00021 00009	SYMBOL DATA BLOCKS FOR EDIT INSTRUCTIONS
C00023 00010	SYMBOL DATA BLOCKS FOR MOTION INSTRUCTIONS
C00029 00011	ZAPSTR:	START OF VARIABLE AREA TO BE ZEROED DURING INITIALIZATION
C00031 00012	PROGRAM CONSTANTS AND REQUIRED SOURCE FILES
C00034 ENDMK
CāŠ—;
.TITLE ARM


;REGISTER DEFINITIONS

PC	=%7		;PROGRAM COUNTER
SP	=%6		;STACK POINTER
SG	=%5		;STRING POINTER
R5	=%5		
R4	=%4		;GENERAL REGISTERS
R3	=%3
R2	=%2
R1	=%1
R0	=%0

;MACRO DEFINITIONS AND CONDITIONAL SWITCHES TO ASSEMBLE FOR LSI OR 11/45

.IF1
.MACRO ASKVAL SW,MES
  .PRINT \MES? \
    .TTYMA SWW
      SW==SWW
    .ENDM
.ENDM

ASKVAL LSI,ASSEMBLE FOR 11/45(0) OR LSI(1)

;FIX-UPS TO ASSEMBLE FOR PDP11/45

.IFZ LSI

ASKVAL TALK10,SET-UP PDP10ā†”45 COMMUNICATIONS LINK(0:1)
LOCK    =340		;CPU STATUS TO LOCK OUT INTERRUPTS
UNLOCK 	=140		;CPU STATUS TO ENABLE INTERRUPTS

;ABSOLUTE MEMORY ADDRESS ASSIGNMENTS

CLKTRP	=104		;CLOCK TRAP
DRATRP	=530  		;DR11 A VECTOR
DRBTRP	=534  		;DR11 B VECTOR
STKTOP	=1000		;START OF CODE
DR11S	=167770 	;DR11 STATUS WORD
DR11O	=167772		;DR11 OUTPUT REGISTER
DR11I	=167774 	;DR11 INPUT REGISTER
CLKSET	=172542		;CLOCK SET REGISTER
CLKS	=172540		;CLOCK STATUS

.MACRO RESET
	.WORD	5	;THIS IS A RESET
	MOV	#1000.,CLKSET
	MOV	#111,CLKS
.ENDM

.MACRO MTPS A
	MOV	#A,177776
.ENDM

HALT = BPT
;FIX-UPS TO ASSEMBLE FOR LSI-11

.IFF

TALK10	 ==0		;NO PDP10-45 INTERFACE
LOCK	 =200		;CPU STATUS TO LOCK OUT INTERRUPTS
UNLOCK 	 =000		;CPU STATUS TO ENABLE INTERRUPTS
	
;ABSOLUTE MEMORY ADDRESS ASSIGNMENTS

CLKTRP	=100		;CLOCK TRAP
DRATRP	=310  		;DR11 A VECTOR
DRBTRP	=314  		;DR11 B VECTOR
STKTOP	=1000		;START OF CODE
DR11S	=167760 	;DR11 STATUS WORD
DR11O	=167762		;DR11 OUTPUT REGISTER
DR11I	=167764 	;DR11 INPUT REGISTER


.ENDC
.ENDC
;FILL LOW CORE TRAP VECTORS

.=4
	.WORD .+2,HALT	;ILLEGAL MEMORY REFERENCE
	.WORD .+2,HALT	;ILLEGAL INSTRUCTION
	.WORD .+2,HALT	;BPT INSTRUCTION
	.WORD .+2,HALT	;IOT INSTRUCTION
	.WORD .+2,HALT	;POWER FAIL
	.WORD .+2,HALT	;EMT INSTRUCTION
	.WORD .+2,HALT	;TRAP INSTRUCTION

.=CLKTRP+2
	RTI		;CLOCK TRAP
.=CLKTRP
	CLKTRP+2

.= STKTOP

STKTOP: JMP 	START	;TOP OF STACK
	.WORD	FREEST	;STARTING ADDR OF FREE STORAGE AREA
HICORE= 57460		;HIGHEST USEABLE WORD IN MEMORY, END OF FREE
			;STORAGE.
	.WORD	ZAPSTR	;PTR TO VARIABLE DATA STORAGE AREA
	.WORD	ZAPEND	;END OF    "      "      "      "
	.WORD	FUNTAB	;PTR TO COMMAND HASH TABLE
	.WORD	CALIB	;PTR TO TABLES OF CALIBRATION DATA
PATCH:	.=.+300		;DATA BUFFER USED FOR DEBUGGING
;DR11C STATUS REGISTER BIT DEFINITIONS

DACMDE	=0		;CSR MODE BITS, DAC MODE
BRKMDE	=1		; "   "    "  , BRAKE REGISTER MODE
ADCMDE	=2		; "   "    "  , ADC MODE
STTMDE	=3		; "   "    "  , STATUS REGISTER READ MODE
ADCENB	=100		;ADC INTERRUPT ENABLE BIT
ADCDNE	=200		;ADC DONE BIT
STTENB	=40		;STATUS REGISTER INTERRUPT ENABLE BIT
STTREQ	=100000		;STATUS REGISTER REQUEST INTERRUPT BIT

;DR11C ARM STATUS REGISTER BIT DEFINITIONS

PANIC 	=200		;PANIC BUTTON BIT MASK
ISON	=100
TOUCH0	=1		;TOUCH SENSOR BIT MASKS
TOUCH1	=2
ARMDNE	=37400 		;BIT MASK OF ARM JOINTS IN RANGE BITS
HNDDNE	=40000  	;BIT MASK OF HAND JOINT IN RANGE BIT

;DR11C BRAKE REGISTER BIT ASSIGNMENTS

ARMBRK	=77		;ARM BRAKE BITS
HNDBRK	=100		;HAND BRAKE BIT
NOINTG	=200		;NO HARDWARE INTEGRATION
ENABLE	=400		;INTERFACE ENABLE BIT
ONINTG	=1000		;FORCES HDWE INTEGRATION ALL OF THE TIME
LOWTOL	=10000		;LOW TOLERANCE POSITION COMPARISON
HITHND	=20000		;HAND IMPACT

;DR11C DAC MODE BIT DEFINITIONS

CURRNT 	=10000		;CURRENT RATHER THAN POSITION MODE

;ARM STATUS BITS.  LOWER BYTE CONTAINS ERROR MESSAGES FOR "TYPERR"

CANPRO	=400	;PROCEEDING PERMITTED FROM THIS ERROR CONDITION
RUN	=1000	;JOINT MOTION STILL IN PROGRESS
CHKDNE	=2000	;SET WHEN IN RANGE BITS ARE TO BE CHECKED
STRWRK	=4000	;START RUN-TIME ROUTINE, *DO NOT CHANGE THIS NUMBER*
WORKNG	=10000	;RUN-TIME RTN EXECUTING, *DO NOT CHANGE THIS NUMBER*
FINAL	=20000	;FINAL JOINT ANGLES COMPUTED
STPARM	=40000	;STOP ARM MOTION
;DEFINITIONS FOR THE DATA STRUCTURES

;RELATIVE POINTERS FOR FUNCTION SYMBOL DATA BLOCK

TYPBIT	=2	;TYPE BITS
NUMARG	=3	;NUMBER OF ARGUMENTS
SYMNME	=4	;ASC NAME, THREE WORDS
FUNPTR	=12	;PTR TO FUNCTION SUBR.
FUNARG	=14	;LIST OF FUNCTION ARGUMENTS

;ADDITIONAL RELATIVE POINTERS FOR TRANSFORM SYMBOL DATA BLOCK

TRNPTR	=12	;POINTER TO TRANSFORMATION

;ADDITIONAL RELATIVE POINTERS FOR USER PROGRAM SYMBOL DATA BLOCK

FSTSTP	=12	;POINTER TO FIRST STEP OF PROGRAM

;DATA TYPE BITS

COMMND	=1	;TOP LEVEL MONITOR COMMAND
MOTION	=2	;MOTION INSTRUCTION
EDITIN	=4	;EDIT INSTRUCTION
EMTYPE	=6	;EDIT OR MOTION INSTRUCTION
TRANS 	=10	;TRANSFORMATION
PROG  	=20	;USER PROGRAM

;RELATIVE POINTERS FOR MOTION INSTRUCTION BLOCKS

MTNFUN	=2	;PTR TO MOTION FUNCTION SYMBOL BLOCK
MARG	=4	;START OF FUNCTION ARGUMENTS

;THE FOUR BIT CODES SPECIFYING THE ARGUMENTS ARE INTERPRETED AS
;FOLLOWS:  IF THE LSB IS SET THE ARGUMENT IS OPTIONAL OTHERWISE
;AN ERROR WILL BE INDICATED IF NO ARGUMENT IS FOUND.  THE 3 MSB
;USED AS AN INDEX INTO THE FOLLOWING TABLE.  THE ONLY RESTRICTION
;ON ARGUMENTS IS THAT IF A STRING IS AN ARGUMENT, IT MUST BE THE
;ONLY ARGUMENT.

STRING	=1	;SPECIAL CASE
DISARG	=2
DISAR2	=40
ANGARG	=4
ANGAR2	=100
PRGARG	=6
TRNARG	=10
TRNAR2	=200
INTARG	=12
INTAR2	=240

;TABLE OF ROUTINES FOR DECODING ARGUMENTS

ARGTAB:	GETSTR	;STRING
	GETDIS	;DISTANCE
	GETANG	;ANGLE
	GETPRG	;USER DEFINED PROGRAM
       	GETTRN	;TRANSFORM
	GETINT	;INTEGER

;TABLE OF ROUTINES FOR CONVERTING ARGUMENTS TO ASC

PRTTAB:	0	;STRING
	PRTDIS	;DISTANCE
	PRTANG	;ANGLES
	PACNME	;USER DEFINED PROGRAM
	PACNME	;TRANSFORM
	PRTINT	;INTEGER
;HASH TABLE AND SYMBOL DATA BLOCKS FOR COMMAND INSTRUCTIONS

;HASH BUCKETS WITH POINTERS TO COMMAND SYMBOL BLOCKS

FUNTAB:	.WORD	BDEFPR,0     ,BTYPE ,0
	.WORD	BHERE ,BEXEC ,BEDIT ,BCLEAR
	.WORD	BTRANS,BINSER,0     ,BPROGS
	.WORD	BLISTP,BABOVE,BPUNCP,0
	.WORD	BPROCE,BSPEED,BPUNCT,BSKIP
	.WORD	BTERMI,BREADY,BGO   ,BMOVE
	.WORD	0     ,BBELOW,BTF   ,BWHERE
	.WORD	0     ,BGRASP,BPAUSE,0

;TOP LEVEL COMMANDS
	
BWHERE:	.WORD	0		;"WHERE"
	.BYTE	COMMND,0	;NO ARGUMENTS
	.ASCII	/WHERE /
	WHERE			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0
	
BTRANS:	BNOFLI	 		;"TRANS"
	.BYTE	COMMND,1	;1 ARG
	.ASCII	/TRANS /
	STRANS			;FUNCTION TO EXECUTE
	.BYTE	TRNARG,0,0,0	;TAKES TRANFORM AS ARGUMENT

BHERE:	BDELET			;"HERE"
	.BYTE	COMMND,1	;1 ARG
	.ASCII	/HERE  /
	HERE 			;FUNCTION TO EXECUTE
	.BYTE	TRNARG,0,0,0	;TAKES TRANFORM AS ARGUMENT

BLISTT:	BPRINT			;"LISTT"
	.BYTE	COMMND,8.	;8 ARGS
	.ASCII	/LISTT /
	LISTT 			;FUNCTION TO EXECUTE
	.BYTE	TRNARG+TRNAR2+21,TRNARG+TRNAR2+21 ;8 OPTIONAL TRANS
	.BYTE	TRNARG+TRNAR2+21,TRNARG+TRNAR2+21

BPUNCT:	BOPEN			;"PUNCHT"
	.BYTE	COMMND,8.	;8 ARGS
	.ASCII	/PUNCHT/
	PUNCHT			;FUNCTION TO EXECUTE
	.BYTE	TRNARG+TRNAR2+21,TRNARG+TRNAR2+21 ;8 OPTIONAL TRANS
	.BYTE	TRNARG+TRNAR2+21,TRNARG+TRNAR2+21

BLISTP:	BLAST			;"LISTP"
	.BYTE	COMMND,3.	;3 ARGS
	.ASCII	/LISTP /
	LISTP 			;FUNCTION TO EXECUTE
	.BYTE	PRGARG+INTAR2+20,INTARG+1 ;PRG NAME + 2 OPT INTEGERS
	.BYTE	0,0

BPUNCP:	BDRAW 			;"PUNCHP"
	.BYTE	COMMND,3 	;3 ARGS
	.ASCII	/PUNCHP/
	PUNCHP			;FUNCTION TO EXECUTE
	.BYTE	PRGARG+INTAR2+20,INTARG+1 ;PRG NAME + 2 OPT INTEGERS
	.BYTE	0,0

BTF:	BDRIVE			;"TF"
	.BYTE	COMMND,7 	;7 ARGS
	.ASCII	/TF    /
	TF			;FUNCTION TO EXECUTE
	.BYTE	TRNARG+DISAR2+20,DISARG+DISAR2+21
	.BYTE	ANGARG+ANGAR2+21,ANGARG+1

BDONE: 	.WORD	0		;"DONE" 
	.BYTE	COMMND,0	;NO ARGUMENTS
	.ASCII	/DONE  /
	DONE 			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BCLEAR:	.WORD	0		;"CLEAR"
	.BYTE	COMMND,0	;NO ARGUMENTS
	.ASCII	/CLEAR /
	CLEAR			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BEXEC: 	BSWITC   		;"EXECUTE"
	.BYTE	COMMND,3	;3 ARGUMENTS
	.ASCII	/EXEC  /
	EXEC 			;FUNCTION TO EXECUTE
	.BYTE	PRGARG+INTAR2+21,INTARG+1,0,0

BPROCE:	BLISTT   		;"PROCEED"
	.BYTE	COMMND,0	;NO ARGUMENTS
	.ASCII	/P     /
	PROCED			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BDEFPR:	BDEPART			;"DEFPRO"
	.BYTE	COMMND,1	;1 ARGUMENT
	.ASCII	/DEFPRO/
	DEFPRO			;FUNCTION TO EXECUTE
	.BYTE	PRGARG,0,0,0	;PROGRAM NAME

BPROGS:	BFLIP			;"PROGS"
	.BYTE	COMMND,0	;NO ARGUMENTS
	.ASCII	/PROGS /
	PROGS			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0
;SYMBOL DATA BLOCKS FOR EDIT INSTRUCTIONS

BEDIT: 	BSTOP			;"EDIT"
	.BYTE	COMMND,2	;2 ARGUMENTS
	.ASCII	/EDIT  /
	EDIT 			;FUNCTION TO EXECUTE
	.BYTE	PRGARG+INTAR2+21,0,0,0	;OPTION PROG. NAME AND LINE #

BTERMI:	.WORD	0		;"TERMINATE"
	.BYTE	EDITIN,0	;NO ARGUMENTS
	.ASCII	/T     /
	TERMIN 			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0	

BSKIP: 	.WORD	0		;"SKIP"
	.BYTE	EDITIN,1	;1 ARGUMENT
	.ASCII	/S     /
	SKIP  			;FUNCTION TO EXECUTE
	.BYTE	INTARG,0,0,0	

BPRINT:	.WORD	0		;"PRINT"
	.BYTE	EDITIN,1	;1 ARGUMENT
	.ASCII	/P     /
	PRINT 			;FUNCTION TO EXECUTE
	.BYTE	INTARG+1,0,0,0	

BINSER:	BPULSE			;"INSERT"
	.BYTE	EDITIN,0	;NO ARGUMENT
	.ASCII	/I     /
	INSERT			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BDELET:	BLEFTY	 		;"DELETE"
	.BYTE	EDITIN,1	;1 ARGUMENT
	.ASCII	/D     /
	DELETE			;FUNCTION TO EXECUTE
	.BYTE	INTARG+1,0,0,0

BSWITC:	0			;"SWITCH"
	.BYTE	EDITIN,2	;2 ARGUMENTS
	.ASCII	/E     /
	SWITCH			;FUNCTION TO EXECUTE
	.BYTE	PRGARG+INTAR2+20,0,0,0

BLAST:  0			;"LAST"
	.BYTE	EDITIN,0	;NO ARGUMENTS
	.ASCII	/L     /
	LAST			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0
;SYMBOL DATA BLOCKS FOR MOTION INSTRUCTIONS

BDRAW: 	BCOMMN   		;"DRAW"
	.BYTE	MOTION,3	;3 ARGUMENTS
	.ASCII	/DRAW  /
	DRAW 			;FUNCTION TO EXECUTE
	.BYTE	DISARG+DISAR2+21,DISARG+1,0,0

BGO: 	.WORD	0		;"GO"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/GO    /
	GO			;FUNCTION TO EXECUTE
	.BYTE	TRNARG,0,0,0	

BMOVE:	BRIGHT			;"MOVE"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/MOVE  /
	MOVE			;FUNCTION TO EXECUTE
	.BYTE	TRNARG,0,0,0	

BDEPAR: .WORD	0		;"DEPART"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/DEPART/
	DEPART			;FUNCTION TO EXECUTE
	.BYTE	DISARG,0,0,0	

BAPPRO: .WORD	0		;"APPRO"
	.BYTE	MOTION,2	;2 ARGUMENTS
	.ASCII	/APPRO /
	APPRO 			;FUNCTION TO EXECUTE
	.BYTE	TRNARG+DISAR2,0,0,0	

BREADY: .WORD	0		;"READY"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/READY /
	READY 			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0	

BREST:  .WORD	0		;"REST"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/REST  /
	REST  			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0	

BOPEN:	.WORD	0		;"OPEN"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/OPEN  /
	OPEN			;FUNCTION TO EXECUTE
	.BYTE	DISARG,0,0,0	

BGRASP:	BCOARS			;"GRASP"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/GRASP /
	GRASP			;FUNCTION TO EXECUTE
	.BYTE	DISARG,0,0,0	

BDRIVE:	.WORD	0		;"DRIVE"
	.BYTE	MOTION,3	;3 ARGUMENTS
	.ASCII	/DRIVE /
	FDRIVE			;FUNCTION TO EXECUTE
	.BYTE	INTARG+ANGAR2,INTARG,0,0

BPAUSE: BREST			;"PAUSE"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/PAUSE /
	PAUSE			;FUNCTION TO EXECUTE
	.BYTE	STRING,0,0,0

BSTOP:  BINTOF			;"STOP"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/STOP  /
	FSTOP			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BCOMMN: .WORD	0		;"COMMNT"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/COMMNT/
	COMNT 			;FUNCTION TO EXECUTE
	.BYTE	STRING,0,0,0

BTYPE:  BAPPRO			;"TYPE"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/TYPE  /
	FTYPE			;FUNCTION TO EXECUTE
	.BYTE	STRING,0,0,0

BFLIP:	.WORD	0		;"FLIP"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/FLIP  /
	FLIP			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BNOFLI:	BINTON			;"NOFLIP"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/NOFLIP/
	NOFLIP			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BRIGHT:	.WORD	0		;"RIGHTY"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/RIGHTY/
	RIGHTY			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BLEFTY:	.WORD	0		;"LEFTY"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/LEFTY /
	LEFTY			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BABOVE:	.WORD	0		;"ABOVE"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/ABOVE /
	ABOVE			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BBELOW:	.WORD	0		;"BELOW"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/BELOW /
	BELOW			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BSPEED:	.WORD	0		;"SPEED"
	.BYTE	MOTION,1	;1 ARGUMENT
	.ASCII	/SPEED /
	SPEED			;FUNCTION TO EXECUTE
	.BYTE	INTARG,0,0,0

BCOARS:	.WORD	0		;"COARSE"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/COARSE/
	COARSE			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BINTOF:	BDONE			;"INTOFF"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/INTOFF/
	INTOFF			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BINTON:	.WORD	0		;"INTON"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/INTON /
	INTON 			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0

BPULSE:	.WORD	0		;"PULSE"
	.BYTE	MOTION,0	;NO ARGUMENTS
	.ASCII	/PULSE /
	PULSE 			;FUNCTION TO EXECUTE
	.BYTE	0,0,0,0
ZAPSTR:	;START OF VARIABLE AREA TO BE ZEROED DURING INITIALIZATION

ARMS:	0	;ARM STATUS WORD.  LOW BYTE CONTAINS ERROR CODE FOR
 		;"TYPERR".  HIGH BYTE CONTAINS ARM STATUS BITS

NSPEED:	0	;CHANGE IN ARM SPEED

CONFIG:	0	;ASSERTED ARM CONFIGURATION

MODES:	0	;SPECIAL SERVO MODES

VARTAB:	.WORD	0,0,0,0		;TABLE FOR SYMBOLS OF VARIABLES
	.WORD	0,0,0,0
	.WORD	0,0,0,0
	.WORD	0,0,0,0
	.WORD	0,0,0,0
	.WORD	0,0,0,0
	.WORD	0,0,0,0
	.WORD	0,0,0,0

FSPTR: 	.WORD	0		;PTR TO FIRST AVAILABLE F.S. BLOCK

EDPROG:	.WORD	0		;PTR TO PREVIOUS USER PROGRAM EDITED
EDSNUM:	.WORD	0		;NUMBER OF LAST EDITED STEP

EXPROG:	.WORD	0		;LAST USER PROGRAM EXECUTED
EXECNT:	.WORD	0		;NUMBER OF PASSES
NXTSTP:	.WORD	0		;NEXT PROGRAM STEP TO EXECUTE

EANGLE:	.=.+12.			;TEMP. STORAGE FOR EULER ANGLES

JANGLE:	.WORD	0         	;CURRENT JOINT ANGLES                  
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
	.WORD	0
HAND:	.WORD	0		;CURRENT HAND OPENING

CTRANS:	.=.+24.			;CURRENT TRANSFORM OF ARM
TTRANS:	.=.+24.			;TEMPORARY TRANSFORM

INBUF:	.=.+200.		;STRING INPUT BUFFER
OUTBUF:	.=.+200.		;STRING OUTPUT BUFFER

ZAPEND:	;END OF AREA TO BE ZEROED
;PROGRAM CONSTANTS AND REQUIRED SOURCE FILES

SMPTRN:	.WORD	0     ,-40000,     0 ;REASONABLE INITIAL ARM POSITION
      	.WORD	-40000,     0,     0
	.WORD	0     ,     0,-40000
	.WORD	-11207, 33136,  3747

RDYTRN:	.WORD	 31156,     0,-23547 ;READY POSITION
      	.WORD	0     ,-40000,     0
	.WORD	-23547,     0,-31156
	.WORD	-44006,-11320, 24507
RDYASS:	.WORD	25		     ;LEFTY,ABOVE,NOFLIP

RSTTRN:	.WORD	-11705,     0,-36336 ;REST POSITION
      	.WORD	0     ,-40000,     0
	.WORD	-36336,     0, 11705
	.WORD	-44565,-11162, 13712
RSTASS:	.WORD 	75		     ;LEFTY,BELOW,FLIP

.INSRT MOVE.PAL
.INSRT IO.PAL
.INSRT FUNCTS.PAL
.INSRT EDIT.PAL
.INSRT SUBR.PAL
.INSRT DRIVE.PAL
.INSRT EULER.PAL
.INSRT ARITH.PAL
.INSRT ARMSOL.PAL
.INSRT CALIB.PAL

;THIS SHOULD ALWAYS BE THE LAST LABEL IN THE PROGRAM.  IT
;MARKS THE START OF THE FREE STORAGE AREA

FREEST: -1		;START OF FREE STORAGE AREA.  FREE
			;STORAGE ENDS AT HICORE.

.END START