NAME	raptor(18)
	RSEG	CODE(0)
	RSEG	CSTR(0)
	RSEG	CONST(0)
	RSEG	X_UDATA(0)
	RSEG	X_IDATA(0)
	RSEG	X_CDATA(0)
	PUBLIC	MENU
	$DEFFN	MENU(0,0,103,0,0,0,0,0),main
	PUBLIC	call_func
	$DEFFN	call_func(0,0,104,0,0,0,2,0),MENU
	PUBLIC	fblock
	PUBLIC	fire_raptor
	$DEFFN	fire_raptor(0,0,4,0,0,0,0,0),call_func
	EXTERN	gets
	$DEFFN	gets(0,0,3,0),MENU
	PUBLIC	main
	$DEFFN	main(0,0,2,0,0,0,0,0)
	PUBLIC	manual
	PUBLIC	pckt
	PUBLIC	print_lcd
	$DEFFN	print_lcd(0,0,6,0,0,0,5,0),fire_raptor,call_func,MENU,main
	EXTERN	printf
	$DEFFN	printf(0,0,10,0),relay,fire_raptor,call_func,MENU,main
	PUBLIC	rd_switch
	$DEFFN	rd_switch(0,0,2,0,0,0,0,0),MENU
	PUBLIC	relay
	$DEFFN	relay(0,0,54,0,0,0,4,0),stat_DISP,fire_raptor,MENU
	EXTERN	sprintf
	$DEFFN	sprintf(0,0,13,0),call_func,MENU
	EXTERN	sscanf
	$DEFFN	sscanf(0,0,9,0),MENU
	PUBLIC	stat_DISP
	$DEFFN	stat_DISP(0,0,4,0,0,0,3,0),call_func,MENU
	EXTERN	?ST_A_R567_L17
	EXTERN	?LD_A_R567_DISP_L17
	EXTERN	?ST_A_R567_DISP_L17
	EXTERN	?A_S_SWITCH_L05
	EXTERN	?AR5_SC_SWITCH_L05
	EXTERN	?A_V_SWITCH_L05
	EXTERN	?MOVE_LONG_CR12_DPTR_L17
	EXTERN	?CL8051L_5_12_L17
	RSEG	CODE
main:
; 1.	/*
; 2.	----------------------------------------------------------------
; 3.	
; 4.	                        RAPTOR GAB SOFTWARE
; 5.	
; 6.	        This program enables the interface to the RAPTOR device
; 7.	
; 8.	
; 9.	----------------------------------------------------------------
; 10.	*/
; 11.	#include <gfem.h>
; 12.	#include <stdio.h>
; 13.	
; 14.	
; 15.	#define MAXMIT 3
; 16.	
; 17.	int manual = 0;
; 18.	
; 19.	
; 20.	                /* prototype  declorations */
; 21.	
; 22.	void main(void);
; 23.	int  call_f();
; 24.	int relay(int num,int stat);
; 25.	void fire_raptor();
; 26.	void setup_pckt();
; 27.	int  stat_DISP(char *disp);
; 28.	void MENU();
; 29.	char rd_switch();
; 30.	void    print_lcd(char *str,int line);
; 31.	void  call_func(int mit);
; 32.	
; 33.	
; 34.	
; 35.	/*
; 36.	----------------------------------------------------------------------
; 37.	                                MAIN
; 38.	   void main(void)
; 39.	
; 40.	        This function is called by the boot program
; 41.	----------------------------------------------------------------------
; 42.	*/
; 43.	
; 44.	
; 45.	
; 46.	
; 47.	
; 48.	
; 49.	void main()
; 50.	{
; 51.	int i;
; 52.	/* set up serial port */   
; 53.	     PCON = 0x80;
	MOV	PCON,#128
; 54.	     TH1  = 0xDD; 
	MOV	TH1,#221
; 55.	     SCON = 0x52;
	MOV	SCON,#82
; 56.	     TMOD = 0x22;
	MOV	TMOD,#34
; 57.	     TCON = 0x50;
	MOV	TCON,#80
; 58.	     PW  = 0;
	CLR	P3.3
; 59.	     P1  = 0x00;
	MOV	P1,#0
; 60.	     LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 61.	     HCS = 0Xff;
	MOV	A,#255
	MOV	DPTR,#65278
	MOVX	@DPTR,A
; 62.	
; 63.	   
; 64.	/*      LCD INIT        */
; 65.	                P1  = 0X38;
	MOV	P1,#56
; 66.	                LCS = 0Xfc;
	MOV	A,#252
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 67.	                for(i=0;i<=5000;i++);
	MOV	DPTR,#$LOCBX main
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0001:
	SETB	C
	MOV	DPTR,#$LOCBX main+1
	MOVX	A,@DPTR
	SUBB	A,#136
	MOV	DPTR,#$LOCBX main
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#147
	JNC	?0000
?0002:
	MOV	DPTR,#$LOCBX main+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX main
	JNZ	?0267
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0267:
	SJMP	?0001
?0000:
; 68.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 69.	                P1  = 0X0c;
	MOV	P1,#12
; 70.	                LCS = 0Xfc;
	MOV	A,#252
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 71.	                for(i=0;i<=5000;i++);
	MOV	DPTR,#$LOCBX main
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0005:
	SETB	C
	MOV	DPTR,#$LOCBX main+1
	MOVX	A,@DPTR
	SUBB	A,#136
	MOV	DPTR,#$LOCBX main
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#147
	JNC	?0004
?0006:
	MOV	DPTR,#$LOCBX main+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX main
	JNZ	?0268
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0268:
	SJMP	?0005
?0004:
; 72.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 73.	                P1  = 0X06;
	MOV	P1,#6
; 74.	                LCS = 0Xfc;
	MOV	A,#252
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 75.	        
; 76.	/*      END LCD INIT    */
; 77.	
; 78.	     print_lcd(".........RAPTOR.........",1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0008)
	MOV	R6,#HIGH(?0008)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 79.	     print_lcd(".......VERSION 1.0......",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0009)
	MOV	R6,#HIGH(?0009)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 80.	     printf("\n<--------------------------------------------->\n");
	MOV	R5,#LOW(?0010)
	MOV	R6,#HIGH(?0010)
	MOV	R7,#2
	LCALL	$REFFN printf
; 81.	     printf(  "<                                             >\n");
	MOV	R5,#LOW(?0011)
	MOV	R6,#HIGH(?0011)
	MOV	R7,#2
	LCALL	$REFFN printf
; 82.	     printf(  "<                    RAPTOR                   >\n");
	MOV	R5,#LOW(?0012)
	MOV	R6,#HIGH(?0012)
	MOV	R7,#2
	LCALL	$REFFN printf
; 83.	     printf(  "<                    -GAB-                    >\n");
	MOV	R5,#LOW(?0013)
	MOV	R6,#HIGH(?0013)
	MOV	R7,#2
	LCALL	$REFFN printf
; 84.	     printf(  "<            SERIAL/ARCNET INTERFACE          >\n");
	MOV	R5,#LOW(?0014)
	MOV	R6,#HIGH(?0014)
	MOV	R7,#2
	LCALL	$REFFN printf
; 85.	     printf(  "<                   VER 1.0                   >\n");
	MOV	R5,#LOW(?0015)
	MOV	R6,#HIGH(?0015)
	MOV	R7,#2
	LCALL	$REFFN printf
; 86.	     printf(  "<                                             >\n");
	MOV	R5,#LOW(?0011)
	MOV	R6,#HIGH(?0011)
	MOV	R7,#2
	LCALL	$REFFN printf
; 87.	     printf(  "<--------------------------------------------->\n");
	MOV	R5,#LOW(?0016)
	MOV	R6,#HIGH(?0016)
	MOV	R7,#2
	LCALL	$REFFN printf
; 88.	
; 89.	   MENU();      
	LCALL	$REFFN MENU
; 90.	}
	RET
MENU:
; 91.	/* end of main */
; 92.	
; 93.	
; 94.	
; 95.	
; 96.	void MENU()
; 97.	{
; 98.	int i,mit=0,p1=0,p2=0;
	MOV	DPTR,#$LOCBX MENU+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
; 99.	char ch = ' ';
	MOV	A,#32
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	@DPTR,A
; 100.	char line[50];
; 101.	char *list[8] = {"MANUAL","FIRE ","READ DATA","STOP","TEST","RAPTOR"};
	MOV	DPTR,#$LOCBX MENU+59
	MOV	R1,#LOW(?0017)
	MOV	R2,#HIGH(?0017)
	MOV	R3,#24
	MOV	R0,#1
	LCALL	?MOVE_LONG_CR12_DPTR_L17
?0025:
; 102.	char disp[20];
; 103.	 
; 104.	while (1)
	NOP
; 105.	{
; 106.	 
; 107.	    ch = rd_switch();
	LCALL	$REFFN rd_switch
	MOV	A,R4
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	@DPTR,A
; 108.	    if (ch !=0)
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	JZ	?0028
?0027:
?0030:
; 109.	      while(rd_switch() !=0);
	LCALL	$REFFN rd_switch
	MOV	A,R4
	JZ	?0029
?0031:
	SJMP	?0030
?0029:
?0028:
; 110.	
; 111.	 
; 112.	    if (RI)
	JNB	SCON.0,?0033
?0032:
; 113.	    {
; 114.	       gets(line);
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN gets
; 115.	       sscanf(line,"%c",&ch);
	MOV	R5,#LOW ($LOCBX MENU+8)
	MOV	R6,#HIGH ($LOCBX MENU+8)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sscanf+6
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0034)
	MOV	R6,#HIGH(?0034)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sscanf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN sscanf
; 116.	       if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0269
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0269:
	JNZ	?0036
?0035:
; 117.	       {
; 118.	         if (ch == '5')
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	CJNE	A,#53,?0038
?0037:
; 119.	           ch = 1;
	MOV	A,#1
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	@DPTR,A
; 120.	         else
	SJMP	?0039
?0038:
; 121.	            if (ch != '0')
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	XRL	A,#48
	JZ	?0041
?0040:
; 122.	               ch=ch+3;
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	MOV	R7,A
	MOV	A,R7
	ADD	A,#3
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	@DPTR,A
?0041:
?0039:
?0036:
?0033:
; 123.	       }
; 124.	    }
; 125.	
; 126.	   
; 127.	    if (ch != 0)
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	JNZ	$+5
	LJMP	?0043
?0042:
; 128.	    {
; 129.	       switch(ch)
	MOV	DPTR,#$LOCBX MENU+8
	MOVX	A,@DPTR
	LCALL	?A_S_SWITCH_L05
	DB	'1'
	DB	6
	DW	?0075
	DW	?0045
	DW	?0051
	DW	?0056
	DW	?0059
	DW	?0066
	DW	?0069
	DW	?0072
?0045:
; 130.	       {
; 131.	         case '1':if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0270
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0270:
	JNZ	?0047
?0046:
; 132.	                     manual = 0;
	MOV	DPTR,#manual
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
; 133.	                   else
	SJMP	?0048
?0047:
; 134.	                   {
; 135.	                     mit++;
	MOV	DPTR,#$LOCBX MENU+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+2
	JNZ	?0271
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0271:
; 136.	                     if (mit > MAXMIT)
	SETB	C
	MOV	DPTR,#$LOCBX MENU+3
	MOVX	A,@DPTR
	SUBB	A,#3
	MOV	DPTR,#$LOCBX MENU+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JC	?0050
?0049:
; 137.	                         mit = 0;
	MOV	DPTR,#$LOCBX MENU+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0050:
?0048:
; 138.	                   }
; 139.	                break;
	LJMP	?0044
?0051:
; 140.	         case '2':if (manual != 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0272
	MOV	DPTR,#manual
	MOVX	A,@DPTR
	JZ	?0053
?0272:
?0052:
; 141.	                   {
; 142.	                     mit--;
	MOV	DPTR,#$LOCBX MENU+3
	MOVX	A,@DPTR
	ADD	A,#255
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+2
	MOVX	A,@DPTR
	ADDC	A,#255
	MOVX	@DPTR,A
; 143.	                     if (mit < 0)
	MOV	DPTR,#$LOCBX MENU+2
	MOVX	A,@DPTR
	RLC	A
	JNC	?0055
?0054:
; 144.	                        mit = MAXMIT;
	MOV	DPTR,#$LOCBX MENU+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#3
	MOVX	@DPTR,A
?0055:
?0053:
; 145.	                   }
; 146.	                break;
	LJMP	?0044
?0056:
; 147.	         case '3':if (manual != 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0273
	MOV	DPTR,#manual
	MOVX	A,@DPTR
	JZ	?0058
?0273:
?0057:
; 148.	                    call_func(mit);
	MOV	DPTR,#$LOCBX MENU+2
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R4,A
	LCALL	$REFFN call_func
?0058:
; 149.	                  break;
	LJMP	?0044
?0059:
; 150.	         case '4': if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0274
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0274:
	JZ	$+5
	LJMP	?0061
?0060:
; 151.	                   {    relay(0,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R4,A
	MOV	R5,A
	LCALL	$REFFN relay
; 152.	                        stat_DISP(disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	LCALL	$REFFN stat_DISP
; 153.	                        sprintf(line,"P=%-3d P=%-3d %s",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sprintf+10
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+8
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+6
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0062)
	MOV	R6,#HIGH(?0062)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sprintf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN sprintf
; 154.	                        print_lcd(line,1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN print_lcd
; 155.	                        print_lcd("exit  x  x  s1 s2 s3 s4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0063)
	MOV	R6,#HIGH(?0063)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 156.	                        printf("P=%-3d P=%-3d %s\n",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX printf+7
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+5
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0064)
	MOV	R6,#HIGH(?0064)
	MOV	R7,#2
	LCALL	$REFFN printf
; 157.	                        printf("1=s1 2=s2 3=s3 4=s4 5=exit\n");
	MOV	R5,#LOW(?0065)
	MOV	R6,#HIGH(?0065)
	MOV	R7,#2
	LCALL	$REFFN printf
?0061:
; 158.	                   }
; 159.	                break;
	LJMP	?0044
?0066:
; 160.	         case '5': if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0275
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0275:
	JZ	$+5
	LJMP	?0068
?0067:
; 161.	                   {    relay(1,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	INC	A
	MOV	R4,A
	LCALL	$REFFN relay
; 162.	                        stat_DISP(disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	LCALL	$REFFN stat_DISP
; 163.	                        sprintf(line,"P=%-3d P=%-3d %s",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sprintf+10
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+8
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+6
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0062)
	MOV	R6,#HIGH(?0062)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sprintf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN sprintf
; 164.	                        print_lcd(line,1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN print_lcd
; 165.	                        print_lcd("exit  x  x  s1 s2 s3 s4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0063)
	MOV	R6,#HIGH(?0063)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 166.	                        printf("P=%-3d P=%-3d %s\n",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX printf+7
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+5
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0064)
	MOV	R6,#HIGH(?0064)
	MOV	R7,#2
	LCALL	$REFFN printf
; 167.	                        printf("1=s1 2=s2 3=s3 4=s4 5=exit\n");
	MOV	R5,#LOW(?0065)
	MOV	R6,#HIGH(?0065)
	MOV	R7,#2
	LCALL	$REFFN printf
?0068:
; 168.	                   }
; 169.	                break;
	LJMP	?0044
?0069:
; 170.	         case '6': if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0276
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0276:
	JZ	$+5
	LJMP	?0071
?0070:
; 171.	                   {    relay(2,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	MOV	R4,#2
	LCALL	$REFFN relay
; 172.	                        stat_DISP(disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	LCALL	$REFFN stat_DISP
; 173.	                        sprintf(line,"P=%-3d P=%-3d %s",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sprintf+10
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+8
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+6
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0062)
	MOV	R6,#HIGH(?0062)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sprintf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN sprintf
; 174.	                        print_lcd(line,1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN print_lcd
; 175.	                        print_lcd("exit  x  x  s1 s2 s3 s4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0063)
	MOV	R6,#HIGH(?0063)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 176.	                        printf("P=%-3d P=%-3d %s\n",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX printf+7
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+5
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0064)
	MOV	R6,#HIGH(?0064)
	MOV	R7,#2
	LCALL	$REFFN printf
; 177.	                        printf("1=s1 2=s2 3=s3 4=s4 5=exit\n");
	MOV	R5,#LOW(?0065)
	MOV	R6,#HIGH(?0065)
	MOV	R7,#2
	LCALL	$REFFN printf
?0071:
; 178.	                   }
; 179.	                break;
	LJMP	?0044
?0072:
; 180.	         case '7': if (manual == 1)
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0277
	MOV	DPTR,#manual
	MOVX	A,@DPTR
?0277:
	JZ	$+5
	LJMP	?0074
?0073:
; 181.	                   {    relay(3,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	MOV	R4,#3
	LCALL	$REFFN relay
; 182.	                        stat_DISP(disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	LCALL	$REFFN stat_DISP
; 183.	                        sprintf(line,"P=%-3d P=%-3d %s",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sprintf+10
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+8
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+6
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0062)
	MOV	R6,#HIGH(?0062)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sprintf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN sprintf
; 184.	                        print_lcd(line,1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX MENU+9)
	MOV	R6,#HIGH ($LOCBX MENU+9)
	MOV	R7,#1
	LCALL	$REFFN print_lcd
; 185.	                        print_lcd("exit  x  x  s1 s2 s3 s4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0063)
	MOV	R6,#HIGH(?0063)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 186.	                        printf("P=%-3d P=%-3d %s\n",p1,p2,disp);
	MOV	R5,#LOW ($LOCBX MENU+83)
	MOV	R6,#HIGH ($LOCBX MENU+83)
	MOV	R7,#1
	MOV	DPTR,#$PRMBX printf+7
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+6
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+5
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0064)
	MOV	R6,#HIGH(?0064)
	MOV	R7,#2
	LCALL	$REFFN printf
; 187.	                        printf("1=s1 2=s2 3=s3 4=s4 5=exit\n");
	MOV	R5,#LOW(?0065)
	MOV	R6,#HIGH(?0065)
	MOV	R7,#2
	LCALL	$REFFN printf
?0074:
; 188.	                   }
; 189.	                break;
	SJMP	?0044
?0075:
; 190.	         default:
; 191.	                break;
	SJMP	?0044
?0044:
; 192.	       } 
; 193.	       if (manual != 1) 
	MOV	DPTR,#manual+1
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0278
	MOV	DPTR,#manual
	MOVX	A,@DPTR
	JZ	?0077
?0278:
?0076:
; 194.	       {
; 195.	          printf("%s\n",list[mit]);
	MOV	DPTR,#$LOCBX MENU+3
	MOVX	A,@DPTR
	MOV	B,#3
	MUL	AB
	ADD	A,#LOW ($LOCBX MENU+59)
	MOV	DPL,A
	CLR	A
	ADDC	A,#HIGH ($LOCBX MENU+59)
	MOV	DPH,A
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	R2,DPL
	MOV	R3,DPH
	MOV	DPTR,#$PRMBX printf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0078)
	MOV	R6,#HIGH(?0078)
	MOV	R7,#2
	LCALL	$REFFN printf
; 196.	          printf("1=menu+  2=menu- 3=select \n");
	MOV	R5,#LOW(?0079)
	MOV	R6,#HIGH(?0079)
	MOV	R7,#2
	LCALL	$REFFN printf
; 197.	          print_lcd(list[mit],1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX MENU+3
	MOVX	A,@DPTR
	MOV	B,#3
	MUL	AB
	ADD	A,#LOW ($LOCBX MENU+59)
	MOV	DPL,A
	CLR	A
	ADDC	A,#HIGH ($LOCBX MENU+59)
	MOV	DPH,A
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	LCALL	$REFFN print_lcd
; 198.	          print_lcd("menu+  menu- select     ",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0080)
	MOV	R6,#HIGH(?0080)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
?0077:
?0043:
; 199.	       }
; 200.	     }
; 201.	  } 
; 202.	}
	LJMP	?0025
print_lcd:
; 203.	
; 204.	
; 205.	
; 206.	
; 207.	void    print_lcd(char *str,int line)
; 208.	{
; 209.	int i,cnt=0,nul=0;
	MOV	DPTR,#$LOCBX print_lcd+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd+4
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
; 210.	
; 211.	
; 212.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 213.	        if (line == 1)
	MOV	DPTR,#$LOCBX print_lcd+6
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd+10
	MOVX	A,@DPTR
	DEC	A
	JNZ	?0279
	MOV	DPTR,#$LOCBX print_lcd+9
	MOVX	A,@DPTR
?0279:
	JNZ	?0082
?0081:
; 214.	        {
; 215.	                P1  = 0X02;
	MOV	P1,#2
; 216.	                LCS = 0Xfc;
	MOV	A,#252
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 217.	                for(i=0;i<=100;i++);
	MOV	DPTR,#$LOCBX print_lcd
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0084:
	SETB	C
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	SUBB	A,#100
	MOV	DPTR,#$LOCBX print_lcd
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JNC	?0083
?0085:
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd
	JNZ	?0280
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0280:
	SJMP	?0084
?0083:
; 218.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 219.	        }
; 220.	        else
	SJMP	?0087
?0082:
; 221.	        {
; 222.	
; 223.	                P1  = 0Xc0;
	MOV	P1,#192
; 224.	                LCS = 0Xfc;
	MOV	A,#252
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 225.	                for(i=0;i<=100;i++);
	MOV	DPTR,#$LOCBX print_lcd
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0089:
	SETB	C
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	SUBB	A,#100
	MOV	DPTR,#$LOCBX print_lcd
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JNC	?0088
?0090:
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd
	JNZ	?0281
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0281:
	SJMP	?0089
?0088:
; 226.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
?0087:
?0093:
; 227.	        }
; 228.	
; 229.	        while(cnt<=25)
	SETB	C
	MOV	DPTR,#$LOCBX print_lcd+3
	MOVX	A,@DPTR
	SUBB	A,#25
	MOV	DPTR,#$LOCBX print_lcd+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JC	$+5
	LJMP	?0092
?0094:
; 230.	        { 
; 231.	
; 232.	                if (str[cnt] == '\0')
	MOV	DPTR,#$LOCBX print_lcd+6
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	DPTR,#$LOCBX print_lcd+2
	MOVX	A,@DPTR
	MOV	R4,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPL,A
	MOV	DPH,R4
	LCALL	?LD_A_R567_DISP_L17
	JNZ	?0096
?0095:
; 233.	                   nul = 1;
	MOV	DPTR,#$LOCBX print_lcd+4
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
?0096:
; 234.	                if ( nul)
	MOV	DPTR,#$LOCBX print_lcd+4
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	ORL	A,R5
	JZ	?0098
?0097:
; 235.	                   P1  = ' ';
	MOV	P1,#32
; 236.	                else
	SJMP	?0099
?0098:
; 237.	                   P1  = str[cnt];
	MOV	DPTR,#$LOCBX print_lcd+6
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	DPTR,#$LOCBX print_lcd+2
	MOVX	A,@DPTR
	MOV	R4,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPL,A
	MOV	DPH,R4
	LCALL	?LD_A_R567_DISP_L17
	MOV	P1,A
?0099:
; 238.	                LCS = 0Xf9;
	MOV	A,#249
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 239.	                for(i=0;i<=100;i++);
	MOV	DPTR,#$LOCBX print_lcd
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0101:
	SETB	C
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	SUBB	A,#100
	MOV	DPTR,#$LOCBX print_lcd
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JNC	?0100
?0102:
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd
	JNZ	?0282
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0282:
	SJMP	?0101
?0100:
; 240.	                LCS = 0Xfd;
	MOV	A,#253
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 241.	                for(i=0;i<=100;i++);
	MOV	DPTR,#$LOCBX print_lcd
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0105:
	SETB	C
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	SUBB	A,#100
	MOV	DPTR,#$LOCBX print_lcd
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JNC	?0104
?0106:
	MOV	DPTR,#$LOCBX print_lcd+1
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd
	JNZ	?0283
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0283:
	SJMP	?0105
?0104:
; 242.	                LCS = 0Xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 243.	        cnt++;
	MOV	DPTR,#$LOCBX print_lcd+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX print_lcd+2
	JNZ	?0284
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0284:
; 244.	     }
; 245.	}
	LJMP	?0093
?0092:
	RET
rd_switch:
; 246.	
; 247.	
; 248.	
; 249.	char rd_switch()
; 250.	{
; 251.	int temp;
; 252.	   PW  = 1;
	SETB	P3.3
; 253.	   P1  = 0xff;
	MOV	P1,#255
; 254.	   HCS = 0xfd;
	MOV	A,#253
	MOV	DPTR,#65278
	MOVX	@DPTR,A
; 255.	   temp = P1;   
	MOV	A,P1
	MOV	R5,#0
	MOV	DPTR,#$LOCBX rd_switch
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
; 256.	   HCS = 0xff;
	MOV	A,#255
	MOV	DPTR,#65278
	MOVX	@DPTR,A
; 257.	   PW  = 0;
	CLR	P3.3
; 258.	   switch(temp)
	MOV	DPTR,#$LOCBX rd_switch
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	CJNE	R5,#0,?0108
	LCALL	?A_V_SWITCH_L05
	DW	?0115
	DB	191
	DW	?0114
	DB	223
	DW	?0113
	DB	239
	DW	?0112
	DB	247
	DW	?0111
	DB	251
	DW	?0110
	DB	253
	DW	?0109
	DB	254
	DW	0
	DW	?0108
?0109:
; 259.	   {
; 260.	        case 0xfe:
; 261.	           return('1');
	MOV	R4,#49
; 262.	        case 0xfd:
	RET
?0110:
; 263.	           return('2');
	MOV	R4,#50
; 264.	        case 0xfb:
	RET
?0111:
; 265.	           return('3');
	MOV	R4,#51
; 266.	        case 0xf7:
	RET
?0112:
; 267.	           return('4');
	MOV	R4,#52
; 268.	        case 0xef:
	RET
?0113:
; 269.	           return('5');
	MOV	R4,#53
; 270.	        case 0xdf:
	RET
?0114:
; 271.	           return('6');
	MOV	R4,#54
; 272.	        case 0xbf:
	RET
?0115:
; 273.	           return('7');
	MOV	R4,#55
; 274.	   }
	RET
?0108:
; 275.	   return(0);
	MOV	R4,#0
; 276.	}
?0116:
	RET
call_func:
; 277.	
; 278.	
; 279.	
; 280.	void  call_func(int mit)
; 281.	{
; 282.	char disp[50],line[50];
; 283.	int p1=0,p2=0;
	MOV	DPTR,#$LOCBX call_func+100
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX call_func+102
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
; 284.	   switch(mit)
	MOV	DPTR,#$LOCBX call_func+104
	MOV	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R4
	MOVX	@DPTR,A
	MOV	A,R4
	LCALL	?AR5_SC_SWITCH_L05
	DW	0
	DB	6
	DW	?0117
	DW	?0118
	DW	?0120
	DW	?0121
	DW	?0124
	DW	?0130
	DW	?0131
	DW	?0134
?0118:
; 285.	   {
; 286.	        case 0:
; 287.	           printf("MANUAL MODE\n");
	MOV	R5,#LOW(?0119)
	MOV	R6,#HIGH(?0119)
	MOV	R7,#2
	LCALL	$REFFN printf
; 288.	           stat_DISP(disp);
	MOV	R5,#LOW $LOCBX call_func
	MOV	R6,#HIGH $LOCBX call_func
	MOV	R7,#1
	LCALL	$REFFN stat_DISP
; 289.	           sprintf(line,"P=%-3d P=%-3d %s",p1,p2,disp);
	MOV	R5,#LOW $LOCBX call_func
	MOV	R6,#HIGH $LOCBX call_func
	MOV	R7,#1
	MOV	DPTR,#$PRMBX sprintf+10
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX call_func+102
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+8
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX call_func+100
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX sprintf+6
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0062)
	MOV	R6,#HIGH(?0062)
	MOV	R7,#2
	MOV	DPTR,#$PRMBX sprintf+3
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX call_func+50)
	MOV	R6,#HIGH ($LOCBX call_func+50)
	MOV	R7,#1
	LCALL	$REFFN sprintf
; 290.	           print_lcd(line,1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW ($LOCBX call_func+50)
	MOV	R6,#HIGH ($LOCBX call_func+50)
	MOV	R7,#1
	LCALL	$REFFN print_lcd
; 291.	           print_lcd("exit  x  x  s1 s2 s3 s4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0063)
	MOV	R6,#HIGH(?0063)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 292.	           printf("P=%-3d P=%-3d %s\n",p1,p2,disp);
	MOV	R5,#LOW $LOCBX call_func
	MOV	R6,#HIGH $LOCBX call_func
	MOV	R7,#1
	MOV	DPTR,#$PRMBX printf+7
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX call_func+102
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+5
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX call_func+100
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0064)
	MOV	R6,#HIGH(?0064)
	MOV	R7,#2
	LCALL	$REFFN printf
; 293.	           printf("1=s1 2=s2 3=s3 4=s4 5=exit\n");
	MOV	R5,#LOW(?0065)
	MOV	R6,#HIGH(?0065)
	MOV	R7,#2
	LCALL	$REFFN printf
; 294.	           manual = 1;
	MOV	DPTR,#manual
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
; 295.	           break;
	LJMP	?0117
?0120:
; 296.	        case 1:
; 297.	             fire_raptor();
	LCALL	$REFFN fire_raptor
; 298.	           break;
	LJMP	?0117
?0121:
; 299.	        case 2:
; 300.	             print_lcd("RAPTOR VER 1.0",1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0122)
	MOV	R6,#HIGH(?0122)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 301.	             print_lcd("P=000 P=000  -  -  -  -",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0123)
	MOV	R6,#HIGH(?0123)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 302.	           break;
	SJMP	?0117
?0124:
; 303.	        case 3:
; 304.	           printf("STOPPED\n");
	MOV	R5,#LOW(?0125)
	MOV	R6,#HIGH(?0125)
	MOV	R7,#2
	LCALL	$REFFN printf
; 305.	           print_lcd("STOPPED....",1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0126)
	MOV	R6,#HIGH(?0126)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 306.	           print_lcd("STOPPED....",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0126)
	MOV	R6,#HIGH(?0126)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
?0128:
; 307.	                while(1);
	NOP
; 308.	           break;
	SJMP	?0128
	SJMP	?0117
?0130:
; 309.	        case 4:
; 310.	           break;
	SJMP	?0117
?0131:
; 311.	        case 5:
; 312.	           printf("RAPTOR VER 1.0\n");
	MOV	R5,#LOW(?0132)
	MOV	R6,#HIGH(?0132)
	MOV	R7,#2
	LCALL	$REFFN printf
; 313.	           print_lcd("RAPTOR VER 1.0",1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0122)
	MOV	R6,#HIGH(?0122)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 314.	           print_lcd("....",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0133)
	MOV	R6,#HIGH(?0133)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 315.	           break;
	SJMP	?0117
?0134:
; 316.	        case 6:
; 317.	           break;
	SJMP	?0117
?0117:
; 318.	   }
; 319.	}
	RET
fire_raptor:
; 320.	
; 321.	
; 322.	void fire_raptor()
; 323.	{
; 324.	
; 325.	int i,cnt;
; 326.	
; 327.	
; 328.	  printf("FIRING RAPTOR\n");
	MOV	R5,#LOW(?0135)
	MOV	R6,#HIGH(?0135)
	MOV	R7,#2
	LCALL	$REFFN printf
; 329.	  print_lcd("FIRING RAPTOR....",1);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0136)
	MOV	R6,#HIGH(?0136)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 330.	  print_lcd(".....",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0137)
	MOV	R6,#HIGH(?0137)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 331.	
; 332.	
; 333.	
; 334.	  print_lcd("de-energize V1",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0138)
	MOV	R6,#HIGH(?0138)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 335.	  printf("de-energize V1\n");
	MOV	R5,#LOW(?0139)
	MOV	R6,#HIGH(?0139)
	MOV	R7,#2
	LCALL	$REFFN printf
; 336.	  relay(0,2);
	CLR	A
	MOV	R7,A
	MOV	R6,#2
	CLR	A
	MOV	R4,A
	MOV	R5,A
	LCALL	$REFFN relay
; 337.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0141:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0140
?0142:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0285
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0285:
	SJMP	?0141
?0140:
; 338.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0145:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0144
?0146:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0286
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0286:
	SJMP	?0145
?0144:
; 339.	  print_lcd("energize V2",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0148)
	MOV	R6,#HIGH(?0148)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 340.	  printf("energize V2\n");
	MOV	R5,#LOW(?0149)
	MOV	R6,#HIGH(?0149)
	MOV	R7,#2
	LCALL	$REFFN printf
; 341.	  relay(1,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	INC	A
	MOV	R4,A
	LCALL	$REFFN relay
; 342.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0151:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0150
?0152:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0287
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0287:
	SJMP	?0151
?0150:
; 343.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0155:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0154
?0156:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0288
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0288:
	SJMP	?0155
?0154:
; 344.	  print_lcd("energize V4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0158)
	MOV	R6,#HIGH(?0158)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 345.	  printf("energize V4\n");
	MOV	R5,#LOW(?0159)
	MOV	R6,#HIGH(?0159)
	MOV	R7,#2
	LCALL	$REFFN printf
; 346.	  relay(3,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	MOV	R4,#3
	LCALL	$REFFN relay
; 347.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0161:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0160
?0162:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0289
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0289:
	SJMP	?0161
?0160:
; 348.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0165:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0164
?0166:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0290
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0290:
	SJMP	?0165
?0164:
; 349.	  print_lcd("energize V3",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0168)
	MOV	R6,#HIGH(?0168)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 350.	  printf("energize V3\n");
	MOV	R5,#LOW(?0169)
	MOV	R6,#HIGH(?0169)
	MOV	R7,#2
	LCALL	$REFFN printf
; 351.	  relay(2,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R5,A
	MOV	R4,#2
	LCALL	$REFFN relay
; 352.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0171:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0170
?0172:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0291
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0291:
	SJMP	?0171
?0170:
; 353.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0175:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0174
?0176:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0292
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0292:
	SJMP	?0175
?0174:
; 354.	  print_lcd("de-energize V2,V3 & V4",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0178)
	MOV	R6,#HIGH(?0178)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 355.	  printf("de-energize V2,V3 and V4\n");
	MOV	R5,#LOW(?0179)
	MOV	R6,#HIGH(?0179)
	MOV	R7,#2
	LCALL	$REFFN printf
; 356.	  relay(2,2);
	CLR	A
	MOV	R7,A
	MOV	R6,#2
	CLR	A
	MOV	R5,A
	MOV	R4,#2
	LCALL	$REFFN relay
; 357.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0181:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0180
?0182:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0293
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0293:
	SJMP	?0181
?0180:
; 358.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0185:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0184
?0186:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0294
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0294:
	SJMP	?0185
?0184:
; 359.	  print_lcd("energize V1",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0188)
	MOV	R6,#HIGH(?0188)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 360.	  printf("energize V1\n");
	MOV	R5,#LOW(?0189)
	MOV	R6,#HIGH(?0189)
	MOV	R7,#2
	LCALL	$REFFN printf
; 361.	  relay(0,0);
	CLR	A
	MOV	R6,A
	MOV	R7,A
	CLR	A
	MOV	R4,A
	MOV	R5,A
	LCALL	$REFFN relay
; 362.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0191:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0190
?0192:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0295
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0295:
	SJMP	?0191
?0190:
; 363.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0195:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0194
?0196:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0296
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0296:
	SJMP	?0195
?0194:
; 364.	  print_lcd("de-energize V1",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0138)
	MOV	R6,#HIGH(?0138)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 365.	  printf("de-energize V1\n");
	MOV	R5,#LOW(?0139)
	MOV	R6,#HIGH(?0139)
	MOV	R7,#2
	LCALL	$REFFN printf
; 366.	  relay(0,2);
	CLR	A
	MOV	R7,A
	MOV	R6,#2
	CLR	A
	MOV	R4,A
	MOV	R5,A
	LCALL	$REFFN relay
; 367.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0199:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0198
?0200:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0297
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0297:
	SJMP	?0199
?0198:
; 368.	  printf("DONE\n");
	MOV	R5,#LOW(?0202)
	MOV	R6,#HIGH(?0202)
	MOV	R7,#2
	LCALL	$REFFN printf
; 369.	  print_lcd("DONE",2);
	MOV	DPTR,#$PRMBX print_lcd+3
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,#2
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0203)
	MOV	R6,#HIGH(?0203)
	MOV	R7,#2
	LCALL	$REFFN print_lcd
; 370.	  for(cnt=0;cnt<=30000;cnt++);
	MOV	DPTR,#$LOCBX fire_raptor+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0205:
	SETB	C
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	SUBB	A,#48
	MOV	DPTR,#$LOCBX fire_raptor+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#245
	JNC	?0204
?0206:
	MOV	DPTR,#$LOCBX fire_raptor+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX fire_raptor+2
	JNZ	?0298
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0298:
; 371.	}
	SJMP	?0205
?0204:
	RET
relay:
; 372.	
; 373.	
; 374.	int relay(int num,int stat)
; 375.	{
; 376.	int i,cnt;
; 377.	static pos=0;
; 378.	char    line[50];
; 379.	  LCS = 0xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 380.	
; 381.	        if (stat == 1)
	MOV	DPTR,#$LOCBX relay+56
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX relay+54
	MOV	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R4
	MOVX	@DPTR,A
	MOV	A,R6
	DEC	A
	ORL	A,R7
	JNZ	?0210
?0209:
; 382.	        {
; 383.	                 printf("relay stat = %x\n",pos);
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPTR,#$PRMBX printf+3
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	R5,#LOW(?0211)
	MOV	R6,#HIGH(?0211)
	MOV	R7,#2
	LCALL	$REFFN printf
; 384.	                 for(cnt=0;cnt<=22000;cnt++);
	MOV	DPTR,#$LOCBX relay+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0213:
	SETB	C
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	SUBB	A,#240
	MOV	DPTR,#$LOCBX relay+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#213
	JNC	?0212
?0214:
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX relay+2
	JNZ	?0299
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0299:
	SJMP	?0213
?0212:
; 385.	                 return(stat);
	MOV	DPTR,#$LOCBX relay+56
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R4,A
; 386.	        }
	RET
?0210:
; 387.	        if (stat == 2)  
	MOV	DPTR,#$LOCBX relay+57
	MOVX	A,@DPTR
	XRL	A,#2
	JNZ	?0300
	MOV	DPTR,#$LOCBX relay+56
	MOVX	A,@DPTR
?0300:
	JNZ	?0217
?0216:
; 388.	        {
; 389.	                 pos = num;
	MOV	DPTR,#$LOCBX relay+54
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
; 390.	                 P1 = pos;
	MOV	DPTR,#?0208
	XCH	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R5
	MOVX	@DPTR,A
	MOV	P1,A
; 391.	                 LCS = 0xf0;
	MOV	A,#240
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 392.	                 LCS = 0xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 393.	                 for(cnt=0;cnt<=6000;cnt++);
	MOV	DPTR,#$LOCBX relay+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0219:
	SETB	C
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	SUBB	A,#112
	MOV	DPTR,#$LOCBX relay+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#151
	JNC	?0218
?0220:
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX relay+2
	JNZ	?0301
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0301:
	SJMP	?0219
?0218:
; 394.	                 return(stat);
	MOV	DPTR,#$LOCBX relay+56
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R4,A
; 395.	        }
	RET
?0217:
; 396.	        if (stat == 3)  
	MOV	DPTR,#$LOCBX relay+57
	MOVX	A,@DPTR
	XRL	A,#3
	JNZ	?0302
	MOV	DPTR,#$LOCBX relay+56
	MOVX	A,@DPTR
?0302:
	JNZ	?0223
?0222:
; 397.	            return(pos);
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R4,A
	RET
?0223:
; 398.	
; 399.	        switch(num)
	MOV	DPTR,#$LOCBX relay+54
	MOVX	A,@DPTR
	MOV	R5,A
	INC	DPTR
	MOVX	A,@DPTR
	LCALL	?AR5_SC_SWITCH_L05
	DW	0
	DB	5
	DW	?0224
	DW	?0225
	DW	?0229
	DW	?0233
	DW	?0237
	DW	?0241
	DW	?0245
?0225:
; 400.	        {
; 401.	
; 402.	           case 0:
; 403.	                    if ((pos & 0x01) != 0)
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	ANL	A,#1
	JZ	?0227
?0226:
; 404.	                         pos = pos & 0xfffe;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ANL	A,#254
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
; 405.	                    else
	SJMP	?0228
?0227:
; 406.	                         pos = pos | 0x01;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ORL	A,#1
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
?0228:
; 407.	                break;
	LJMP	?0224
?0229:
; 408.	           case 1:
; 409.	                    if ((pos & 0x02) != 0)
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	ANL	A,#2
	JZ	?0231
?0230:
; 410.	                         pos = pos & 0xfffd;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ANL	A,#253
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
; 411.	                    else
	SJMP	?0232
?0231:
; 412.	                         pos = pos | 0x02;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ORL	A,#2
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
?0232:
; 413.	                break;
	LJMP	?0224
?0233:
; 414.	           case 2:
; 415.	                    if ((pos & 0x04) != 0)
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	ANL	A,#4
	JZ	?0235
?0234:
; 416.	                         pos = pos & 0xfffb;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ANL	A,#251
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
; 417.	                    else
	SJMP	?0236
?0235:
; 418.	                         pos = pos | 0x04;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ORL	A,#4
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
?0236:
; 419.	                break;
	SJMP	?0224
?0237:
; 420.	           case 3:
; 421.	                    if ((pos & 0x08) != 0)
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	ANL	A,#8
	JZ	?0239
?0238:
; 422.	                         pos = pos & 0xff7;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ANL	A,#247
	MOV	R6,A
	MOV	A,R7
	ANL	A,#15
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
; 423.	                    else
	SJMP	?0240
?0239:
; 424.	                         pos = pos | 0x08;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ORL	A,#8
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
?0240:
; 425.	                break;
	SJMP	?0224
?0241:
; 426.	           case 4:
; 427.	                    if ((pos & 0x10) != 0)
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	ANL	A,#16
	JZ	?0243
?0242:
; 428.	                         pos = pos & 0xffef;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ANL	A,#239
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
; 429.	                    else
	SJMP	?0244
?0243:
; 430.	                         pos = pos | 0x010;
	MOV	DPTR,#?0208
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	MOV	A,R6
	ORL	A,#16
	MOV	R6,A
	MOV	A,R7
	MOV	DPTR,#?0208
	MOVX	@DPTR,A
	INC	DPTR
	XCH	A,R6
	MOVX	@DPTR,A
	XCH	A,R6
?0244:
; 431.	                break;
	SJMP	?0224
?0245:
; 432.	           case 5:
; 433.	                break;
	SJMP	?0224
?0224:
; 434.	
; 435.	        }
; 436.	
; 437.	                      P1 = pos;
	MOV	DPTR,#?0208+1
	MOVX	A,@DPTR
	MOV	P1,A
; 438.	                      LCS = 0xf0;
	MOV	A,#240
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 439.	                      LCS = 0xf8;
	MOV	A,#248
	MOV	DPTR,#65277
	MOVX	@DPTR,A
; 440.	                      for(cnt=0;cnt<=6000;cnt++);
	MOV	DPTR,#$LOCBX relay+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
?0247:
	SETB	C
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	SUBB	A,#112
	MOV	DPTR,#$LOCBX relay+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#151
	JNC	?0246
?0248:
	MOV	DPTR,#$LOCBX relay+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX relay+2
	JNZ	?0303
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0303:
; 441.	}
	SJMP	?0247
?0246:
	NOP
?0250:
	RET
stat_DISP:
; 442.	
; 443.	
; 444.	
; 445.	
; 446.	
; 447.	int  stat_DISP(char *disp)
; 448.	{
; 449.	    int pos = 0,i;
	MOV	DPTR,#$LOCBX stat_DISP
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
; 450.	      for(i=0;i<=14;i++)
	MOV	DPTR,#$LOCBX stat_DISP+2
	CLR	A
	MOVX	@DPTR,A
	INC	DPTR
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOV	A,R7
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R6
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R5
	MOVX	@DPTR,A
?0252:
	SETB	C
	MOV	DPTR,#$LOCBX stat_DISP+3
	MOVX	A,@DPTR
	SUBB	A,#14
	MOV	DPTR,#$LOCBX stat_DISP+2
	MOVX	A,@DPTR
	XRL	A,#128
	SUBB	A,#128
	JNC	?0251
?0253:
; 451.	        disp[i] = ' ';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	DPTR,#$LOCBX stat_DISP+2
	MOVX	A,@DPTR
	MOV	R4,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	DPL,A
	MOV	DPH,R4
	MOV	A,#32
	LCALL	?ST_A_R567_DISP_L17
	MOV	DPTR,#$LOCBX stat_DISP+3
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
	MOV	DPTR,#$LOCBX stat_DISP+2
	JNZ	?0304
	MOVX	A,@DPTR
	INC	A
	MOVX	@DPTR,A
?0304:
	SJMP	?0252
?0251:
; 452.	    pos = relay(0,3);
	CLR	A
	MOV	R7,A
	MOV	R6,#3
	CLR	A
	MOV	R4,A
	MOV	R5,A
	LCALL	$REFFN relay
; 453.	            if ((pos & 0x01) != 0)
	MOV	DPTR,#$LOCBX stat_DISP
	MOV	A,R5
	MOVX	@DPTR,A
	INC	DPTR
	MOV	A,R4
	MOVX	@DPTR,A
	MOV	A,R4
	ANL	A,#1
	JZ	?0256
?0255:
; 454.	                disp[0] = '-';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#45
	LCALL	?ST_A_R567_L17
; 455.	            else
	SJMP	?0257
?0256:
; 456.	                disp[0] = 'O';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#79
	LCALL	?ST_A_R567_L17
?0257:
; 457.	            if ((pos & 0x02) != 0)
	MOV	DPTR,#$LOCBX stat_DISP+1
	MOVX	A,@DPTR
	ANL	A,#2
	JZ	?0259
?0258:
; 458.	                disp[3] = '-';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#45
	MOV	DPTR,#3
	LCALL	?ST_A_R567_DISP_L17
; 459.	            else
	SJMP	?0260
?0259:
; 460.	                disp[3] = 'O';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#79
	MOV	DPTR,#3
	LCALL	?ST_A_R567_DISP_L17
?0260:
; 461.	            if ((pos & 0x04) != 0)
	MOV	DPTR,#$LOCBX stat_DISP+1
	MOVX	A,@DPTR
	ANL	A,#4
	JZ	?0262
?0261:
; 462.	                disp[6] = '-';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#45
	MOV	DPTR,#6
	LCALL	?ST_A_R567_DISP_L17
; 463.	            else
	SJMP	?0263
?0262:
; 464.	                disp[6] = 'O';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#79
	MOV	DPTR,#6
	LCALL	?ST_A_R567_DISP_L17
?0263:
; 465.	            if ((pos & 0x08) != 0)
	MOV	DPTR,#$LOCBX stat_DISP+1
	MOVX	A,@DPTR
	ANL	A,#8
	JZ	?0265
?0264:
; 466.	                disp[9] = '-';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#45
	MOV	DPTR,#9
	LCALL	?ST_A_R567_DISP_L17
; 467.	            else
	SJMP	?0266
?0265:
; 468.	                disp[9] = 'O';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#79
	MOV	DPTR,#9
	LCALL	?ST_A_R567_DISP_L17
?0266:
; 469.	disp[10] = '\0';
	MOV	DPTR,#$LOCBX stat_DISP+4
	MOVX	A,@DPTR
	MOV	R7,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R6,A
	INC	DPTR
	MOVX	A,@DPTR
	MOV	R5,A
	MOV	A,#0
	MOV	DPTR,#10
	LCALL	?ST_A_R567_DISP_L17
; 470.	}
	RET
	RSEG	CSTR
?0008:
	DB	'.........RAPTOR.........',0
?0009:
	DB	'.......VERSION 1.0......',0
?0010:
	DB	10,'<--------------------------------------------->',10,0
?0011:
	DB	'<                                             >',10,0
?0012:
	DB	'<                    RAPTOR                   >',10,0
?0013:
	DB	'<                    -GAB-                    >',10,0
?0014:
	DB	'<            SERIAL/ARCNET INTERFACE          >',10,0
?0015:
	DB	'<                   VER 1.0                   >',10,0
?0016:
	DB	'<--------------------------------------------->',10,0
?0018:
	DB	'MANUAL',0
?0019:
	DB	'FIRE ',0
?0020:
	DB	'READ DATA',0
?0021:
	DB	'STOP',0
?0022:
	DB	'TEST',0
?0023:
	DB	'RAPTOR',0
?0034:
	DB	'%c',0
?0062:
	DB	'P=%-3d P=%-3d %s',0
?0063:
	DB	'exit  x  x  s1 s2 s3 s4',0
?0064:
	DB	'P=%-3d P=%-3d %s',10,0
?0065:
	DB	'1=s1 2=s2 3=s3 4=s4 5=exit',10,0
?0078:
	DB	'%s',10,0
?0079:
	DB	'1=menu+  2=menu- 3=select ',10,0
?0080:
	DB	'menu+  menu- select     ',0
?0119:
	DB	'MANUAL MODE',10,0
?0122:
	DB	'RAPTOR VER 1.0',0
?0123:
	DB	'P=000 P=000  -  -  -  -',0
?0125:
	DB	'STOPPED',10,0
?0126:
	DB	'STOPPED....',0
?0132:
	DB	'RAPTOR VER 1.0',10,0
?0133:
	DB	'....',0
?0135:
	DB	'FIRING RAPTOR',10,0
?0136:
	DB	'FIRING RAPTOR....',0
?0137:
	DB	'.....',0
?0138:
	DB	'de-energize V1',0
?0139:
	DB	'de-energize V1',10,0
?0148:
	DB	'energize V2',0
?0149:
	DB	'energize V2',10,0
?0158:
	DB	'energize V4',0
?0159:
	DB	'energize V4',10,0
?0168:
	DB	'energize V3',0
?0169:
	DB	'energize V3',10,0
?0178:
	DB	'de-energize V2,V3 & V4',0
?0179:
	DB	'de-energize V2,V3 and V4',10,0
?0188:
	DB	'energize V1',0
?0189:
	DB	'energize V1',10,0
?0202:
	DB	'DONE',10,0
?0203:
	DB	'DONE',0
?0211:
	DB	'relay stat = %x',10,0
	RSEG	CONST
?0017:
	DB	2
	DW	?0018
	DB	2
	DW	?0019
	DB	2
	DW	?0020
	DB	2
	DW	?0021
	DB	2
	DW	?0022
	DB	2
	DW	?0023
	DB	0,0,0,0,0,0
	RSEG	X_UDATA
fblock:
	DS	2
pckt:
	DS	7
	RSEG	X_IDATA
manual:
	DS	2
?0208:
	DS	2
	RSEG	X_CDATA
	DW	0
	DW	0
	END