perm filename ARM.PAL[V,VDS] blob sn#274982 filedate 1977-04-04 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00012 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00003 00002	.TITLE ARM
C00005 00003	FIX-UPS TO ASSEMBLE FOR PDP11/45 OR LSI
C00007 00004	DR11C AND ARMS STATUS REGISTER BIT DEFINITIONS
C00010 00005	FILL LOW CORE TRAP VECTORS
C00012 00006	ZAPSTR:	START OF VARIABLE AREA TO BE ZEROED DURING INITIALIZATION
C00015 00007	SUBROUTINE VARIABLE DATA STORAGE
C00017 00008	VARIABLE STORAGE FOR "ARMSOL"
C00019 00009	DEFINITIONS FOR THE DATA STRUCTURES
C00022 00010	HASH TABLE AND SYMBOL DATA BLOCKS FOR COMMAND&EDIT INSTRUCTIONS
C00026 00011	SYMBOL DATA BLOCKS FOR MOTION INSTRUCTIONS
C00029 00012	PROGRAM CONSTANTS AND REQUIRED SOURCE FILES
C00031 ENDMK
C⊗;
.TITLE ARM


;MACRO FOR ESTABLISHING RELATIVE POINTERS
  
   .MACRO INT SYM        		;Just gives SYM the next number.
	.IF1
   	.IFDF SYM
	       .ERROR You are using SYM in two ways!!!
	.ENDC
	SYM == RELCNT
	RELCNT == RELCNT+2
	.ENDC
   .ENDM


;MACRO FOR SETTING UP FUNCTION SYMBOL BLOCKS

.MACRO SYMBLK NAME,FUNCT,STYPE,NXTBLK,NARGS,ARGS
	.WORD	NXTBLK
	.BYTE	STYPE,NARGS
	.ASCII	/NAME/
	.WORD	FUNCT
	.IRP ARG,<ARGS>
		.BYTE	ARG
	.ENDM
.ENDM


;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)


;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
;FIX-UPS TO ASSEMBLE FOR PDP11/45 OR LSI

.IFZ LSI

LOCK	==340		;CPU STATUS TO LOCK OUT INTERRUPTS
UNLOCK	==140		;CPU STATUS TO ENABLE INTERRUPTS

;ABSOLUTE MEMORY ADDRESS ASSIGNMENTS

CLKTRP	=104		;CLOCK TRAP
PARVEC	=114		;PARITY TRAP VECTOR
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
PARCSR	=172100		;PARITY CONTROL REGISTER
CLKSET	=172542		;CLOCK SET REGISTER
CLKS	=172540		;CLOCK STATUS

.MACRO MTPS PSW
	MOV	#PSW,177776
.ENDM

HLT	== BPT


.IFF

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

.MACRO MTPS PSW
	.WORD	106427,PSW
.ENDM

HLT	== HALT

.ENDC
.ENDC
;DR11C AND ARMS 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.  THE LOW BYTE CONTAINS PROGRAM STATUS AND THE UPPER
;BYTE CONTAINS THE CURRENT MOTION STATUS

CANPRO	==1	;PROCEEDING PERMITTED FROM THIS ERROR CONDITION
CATERR	==2	;CATASTROPHIC ERROR, CAN'T PROCEED FROM THIS POINT

RUN	==400	;JOINT MOTION STILL IN PROGRESS
CHKDNE	==1000	;SET WHEN IN RANGE BITS ARE TO BE CHECKED
STRWRK	==2000	;START RUN-TIME ROUTINE, *DO NOT CHANGE THIS NUMBER*
WORKNG	==4000	;RUN-TIME RTN EXECUTING, *DO NOT CHANGE THIS NUMBER*
FINAL	==10000	;FINAL JOINT ANGLES COMPUTED
STPMVE	==20000	;STOP ARM MOTION IMMEDIATELY
;FILL LOW CORE TRAP VECTORS

.=4
	.WORD .+2,HLT	;ILLEGAL MEMORY REFERENCE
	.WORD .+2,HLT	;ILLEGAL INSTRUCTION
	.WORD .+2,HLT	;BPT INSTRUCTION
	.WORD .+2,HLT	;IOT INSTRUCTION
	.WORD .+2,HLT	;POWER FAIL
	.WORD .+2,HLT	;EMT INSTRUCTION
	.WORD .+2,HLT	;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:	.WORD	37460	;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
ZAPSTR:	;START OF VARIABLE AREA TO BE ZEROED DURING INITIALIZATION

ARMS:	.=.+2	;ARM STATUS WORD

BRAKES:	.=.+2	;BRAKE REGISTER BITS ON

NSPEED:	.=.+2	;CHANGE IN ARM SPEED

CONFIG:	.=.+2	;ASSERTED ARM CONFIGURATION

MODES:	.=.+2	;SPECIAL SERVO MODES
PMODES:	.=.+2	;PERMANENT SERVO MODES TURNED ONLY BY <ALWAYS>

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

EXECNT:	.WORD	0		;NUMBER OF PASSES
SUBPTR:	SUBSTK			;PTR TO SUBROUTINE CALL STACK
	.=.+2			;LEAVE ROOM FOR LAST NEXT STEP PTR
STKEND:	.=.+40.			;USER SUBR CALL STACK: ALTERNATE PROGRAM,
				;  NEXT STEP PTRS
SUBSTK:	.WORD	0		;BOTTOM OF STACK AND MAIN PROGRAM PTR

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

JANGLE:	.=.+12.			;CURRENT JOINT ANGLES
HAND:	.=.+2			;CURRENT HAND OPENING

DANGLE:	.=.+12.			;CURRENT DAC OUTPUT ANGLES
DHAND:	.=.+4
DACVAL:	.=.+16.			;CURRENT DAC OUTPUT VALUES

ONE4TH:	.=.+14.			;1/4 CHANGE IN JOINT ANGLE

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
;SUBROUTINE VARIABLE DATA STORAGE

PTIME:	.=.+2	;TIME INTO CURRENT JOINT MOTION (5 MSEC. COUNTS)
DRVLST:	.=.+2	;PTR TO TABLE CONTAINING MOTION VARIABLES
DRVERR:	.=.+2	;ERROR MESSAGE CODES
BADBIT:	.=.+2	;OUT OF RANGE BITS
DNECNT:	.=.+2	;COUNTER FOR NUMBER OF SEQUENTIAL TIMES IN RANGE TRUE
WAITNG:	.=.+2	;DRIVE START WAIT COUNT

CBUF:	.=.+2
BUF1:	.=.+20.
BUF2:	.=.+20.

ISPNHT:	.=.+2	;0 IF "LISTT", -1 IF "PUNCHT"
ISPNHP:	.=.+2	;0 IF "LISTP", -1 IF "PUNCHP"

WAITTM:	.=.+2	;WAIT TIME FOR "WAITER"

GOTRN:	.=.+2	;PTR TO GO TRANSFORM

FDRVJT:	.=.+2	;"FDRIVE" DATA, JOINT TO BE DRIVEN
TIME1:	.=.+2	;DURATION OF MOTION
DTH:	.=.+2	;CHANGE IN JOINT ANGLE
FTH:	.=.+2	;FINAL JOINT ANGLE

RELXYZ:	.=.+2	;"DRAW" DATA, PTR TO RELATIVE CHANGE IN X,Y,Z
FINXYZ:	.=.+6	;FINAL X,Y,Z VALUES
DRWANG:	.=.+12.	;TEMPORARY STORAGE FOR JT ANGLES
DRWTME:	.=.+2	;MOTION TIME

JTPAS1:	.=.+2	;"JOINTS" DATA, FIRST PASS THROUGH JOINTS?
JTTRAN:	.=.+2	;TRANS POINTER
INTTME:	.=.+2	;MOTION TIME
FANGLE:	.=.+12.	;FINAL JOINT ANGLES
DELANG:	.=.+12.	;CHANGE IN JOINT ANGLES
;VARIABLE STORAGE FOR "ARMSOL"

EXACTS:	.=.+2		;BITS OF JTS WITH NO EXACT SOLUTION

ARMFLG:	.=.+2		;CURRENT ARM CONFIGURATION

T111:	.=.+2		;TRANSFORM FOR JTS 1-3
T121:	.=.+2
T131:	.=.+2
T112:	.=.+2
T122:	.=.+2
T132:	.=.+2
T113:	.=.+2
T123:	.=.+2
T133:	.=.+2
T114:	.=.+2
T124:	.=.+2
T134:	.=.+2

T212:	.=.+2		;TRANSFORM FOR JTS 4-6
T222:	.=.+2
T232:	.=.+2
T213:	.=.+2
T223:	.=.+2
T233:	.=.+2
T214:	.=.+2
T224:	.=.+2
T234:	.=.+2

TX:	.=.+2		;X,Y,Z FOR END OF JOINT 3
TY:	.=.+2
TZS1:	.=.+2		;TZ-S1
TXTYS:	.=.+2		;TX**2+TY**2-S2**2-S3**2
	.=.+2
TX1Y1:	.=.+2		;TX*CT1+TY*ST1
T1323:	.=.+2		;T13*CT1+T23*ST1
STA2S4:	.=.+2		;ST3+(A2/S4)

STT1:	.=.+2		;SIN/COS THETA 1
CTT1:	.=.+2
STT2:	.=.+2		;SIN THETA 2
STT3:	.=.+2		;SIN/COS THETA 3
CTT3:	.=.+2
S23:	.=.+2		;SIN/COS (TH2 + TH3)
C23:	.=.+2
STT4:	.=.+2		;SIN/COS THETA 4 (ALMOST)
CTT4:	.=.+2
CTT5:	.=.+2		;COS THETA 5
CTT6:	.=.+2		;COS THETA 6
THETA4:	.=.+2
THETA5:	.=.+2
;DEFINITIONS FOR THE DATA STRUCTURES

MAXARG	==20	;MAXIMUM NUMBER OF BYTES NEEDED TO STORE ARGUMENTS

;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

CMND	==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
HUNARG	==14

;TABLE OF ROUTINES FOR DECODING ARGUMENTS

ARGTAB:	GETSTR	;STRING
	GETDIS	;DISTANCE
	GETANG	;ANGLE
	GETPRG	;USER DEFINED PROGRAM
	GETTRN	;TRANSFORM
	GETINT	;INTEGER
	GETHUN	;INTEGER IN 1/100 STEPS

;TABLE OF ROUTINES FOR CONVERTING ARGUMENTS TO ASC

PRTTAB:	0	;STRING
	PTSDIS	;DISTANCE
	PTSANG	;ANGLES
	PACNMS	;USER DEFINED PROGRAM
	PACNMS	;TRANSFORM
	PTSINT	;INTEGER
	PTSHUN	;INTEGER IN 1/100 STEPS
;HASH TABLE AND SYMBOL DATA BLOCKS FOR COMMAND&EDIT INSTRUCTIONS

;HASH BUCKETS WITH POINTERS TO COMMAND SYMBOL BLOCKS

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


;TOP LEVEL COMMANDS
	
BWHERE:	SYMBLK <WHERE >,WHERE,CMND,0,0,<0,0,0,0>
BFREE:	SYMBLK <FREE  >,FREE,CMND,BTYPE,0,<0,0,0,0>
BTRANS:	SYMBLK <TRANS >,STRANS,CMND,BNOFLI,1,<TRNARG,0,0,0>
BHERE:	SYMBLK <HERE  >,HERE,CMND,BDELET,1,<TRNARG,0,0,0>
BLISTT:	SYMBLK <LISTT >,LISTT,CMND,BPRINT,8.,<TRNARG+TRNAR2+21
		,TRNARG+TRNAR2+21,TRNARG+TRNAR2+21,TRNARG+TRNAR2+21>
BPUNCT:	SYMBLK <PUNCHT>,PUNCHT,CMND,BOPEN,8.,<TRNARG+TRNAR2+21
		,TRNARG+TRNAR2+21,TRNARG+TRNAR2+21,TRNARG+TRNAR2+21>
BLISTP:	SYMBLK <LISTP >,LISTP,CMND,BLAST,3,<PRGARG+INTAR2+20,INTARG+1,0,0>
BPUNCP:	SYMBLK <PUNCHP>,PUNCHP,CMND,BDRAW,3,<PRGARG+INTAR2+20,INTARG+1,0,0>
BTF:	SYMBLK <TF    >,TF,CMND,BDRIVE,7,<TRNARG+DISAR2+20
		,DISARG+DISAR2+21,ANGARG+ANGAR2+21,ANGARG+1>
BDONE:	SYMBLK <DONE  >,DONE,CMND,0,0,<0,0,0,0>
BCLEAR:	SYMBLK <CLEAR >,CLEAR,CMND,0,0,<0,0,0,0>
BEXEC:	SYMBLK <EXEC  >,EXEC,CMND,BSWITC,3,<PRGARG+INTAR2+21,INTARG+1,0,0>
BPROCE:	SYMBLK <P     >,PROCED,CMND,BLISTT,0,<0,0,0,0>
BDEFPR:	SYMBLK <DEFPRO>,DEFPRO,CMND,BDEPART,1,<PRGARG,0,0,0>
BPROGS:	SYMBLK <PROGS >,PROGS,CMND,BFLIP,0,<0,0,0,0>
;BCALLS:	SYMBLK <CALLS >,CALLS,CMND,0,0,<0,0,0,0>
;BSNGST:	SYMBLK <X     >,SNGSTP,CMND,0,0,<0,0,0,0>

;SYMBOL DATA BLOCKS FOR EDIT INSTRUCTIONS

BEDIT:	SYMBLK <EDIT  >,EDIT,CMND,BSTOP,2,<PRGARG+INTAR2+21,0,0,0>
BTERMI:	SYMBLK <T     >,TERMIN,EDITIN,0,0,<0,0,0,0>
BSKIP:	SYMBLK <S     >,SKIP,EDITIN,0,1,<INTARG,0,0,0>
BPRINT:	SYMBLK <P     >,PRINT,EDITIN,0,1,<INTARG+1,0,0,0>
BINSER:	SYMBLK <I     >,INSERT,EDITIN,BPULSE,0,<0,0,0,0>
BDELET:	SYMBLK <D     >,DELETE,EDITIN,BLEFTY,1,<INTARG+1,0,0,0>
BSWITC:	SYMBLK <E     >,SWITCH,EDITIN,0,2,<PRGARG+INTAR2+20,0,0,0>
BLAST:	SYMBLK <L     >,LAST,EDITIN,0,0,<0,0,0,0>
;SYMBOL DATA BLOCKS FOR MOTION INSTRUCTIONS

BDRAW:	SYMBLK <DRAW  >,DRAW,MOTION,BCOMMN,3,<DISARG+DISAR2+21,DISARG+1,0,0>
BGO:	SYMBLK <GO    >,GO,MOTION,0,1,<TRNARG,0,0,0>
BMOVE:	SYMBLK <MOVE  >,MOVE,MOTION,BRIGHT,1,<TRNARG,0,0,0>
;BDEPAR:	SYMBLK <DEPART>,DEPART,MOTION,BGOSUB,1,<DISARG,0,0,0>
BDEPAR:	SYMBLK <DEPART>,DEPART,MOTION,0,1,<DISARG,0,0,0>
BAPPRO:	SYMBLK <APPRO >,APPRO,MOTION,0,2,<TRNARG+DISAR2,0,0,0>
BREADY:	SYMBLK <READY >,READY,MOTION,BWAIT,0,<0,0,0,0>
BREST:	SYMBLK <REST  >,REST,MOTION,0,0,<0,0,0,0>
BOPEN:	SYMBLK <OPEN  >,OPEN,MOTION,0,1,<DISARG,0,0,0>
BGRASP:	SYMBLK <GRASP >,GRASP,MOTION,BCOARS,1,<DISARG,0,0,0>
BDRIVE:	SYMBLK <DRIVE >,FDRIVE,MOTION,0,3,<INTARG+ANGAR2,INTARG,0,0>
BPAUSE:	SYMBLK <PAUSE >,PAUSE,MOTION,BREST,1,<STRING,0,0,0>
BSTOP:	SYMBLK <STOP  >,FSTOP,MOTION,BINTOF,0,<0,0,0,0>
BCOMMN:	SYMBLK <COMMNT>,COMNT,MOTION,0,1,<STRING,0,0,0>
BTYPE:	SYMBLK <TYPE  >,FTYPE,MOTION,BAPPRO,1,<STRING,0,0,0>
BFLIP:	SYMBLK <FLIP  >,FLIP,MOTION,0,0,<0,0,0,0>
BNOFLI:	SYMBLK <NOFLIP>,NOFLIP,MOTION,BINTON,0,<0,0,0,0>
BRIGHT:	SYMBLK <RIGHTY>,RIGHTY,MOTION,0,0,<0,0,0,0>
BLEFTY:	SYMBLK <LEFTY >,LEFTY,MOTION,0,0,<0,0,0,0>
BABOVE:	SYMBLK <ABOVE >,ABOVE,MOTION,0,0,<0,0,0,0>
BBELOW:	SYMBLK <BELOW >,BELOW,MOTION,0,0,<0,0,0,0>
BSPEED:	SYMBLK <SPEED >,SPEED,MOTION,0,1,<INTARG,0,0,0>
BCOARS:	SYMBLK <COARSE>,COARSE,MOTION,0,0,<0,0,0,0>
BINTOF:	SYMBLK <INTOFF>,INTOFF,MOTION,BDONE,0,<0,0,0,0>
BINTON:	SYMBLK <INTON >,INTON,MOTION,0,0,<0,0,0,0>
BPULSE:	SYMBLK <PULSE >,PULSE,MOTION,0,0,<0,0,0,0>
BWAIT:	SYMBLK <WAIT  >,WAITER,MOTION,0,1,<HUNARG,0,0,0>
;BGOSUB:	SYMBLK <GOSUB >,GOSUB,MOTION,BRETUR,1,<PRGARG,0,0,0>
;BRETUR:	SYMBLK <RETURN>,RETURN,MOTION,0,0,<0,0,0,0>
;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 FUNCTS.PAL
.INSRT RUN.PAL
 .INSRT SUBR.PAL
 .INSRT IO.PAL
 .INSRT EDIT.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 STKTOP