                        .module FINALCODE2.c
                        .area data
 0000           _T_counts::
 0000                   .blkb 2
                        .area idata
 0000 4E20              .word 20000
                        .area data
 0002           _per_on2::
 0002                   .blkb 2
                        .area idata
 0002 0028              .word 40
                        .area data
 0004           _per_on3::
 0004                   .blkb 2
                        .area idata
 0004 0028              .word 40
                        .area data
 0006           _cntflag::
 0006                   .blkb 2
                        .area idata
 0006 0000              .word 0
                        .area data
                        .area text
 0000           L4:
 0000 0000              .word 0
 0002 0028              .word 40
 0004 0032              .word 50
 0006 0028              .word 40
 0008           L5:
 0008 0000              .word 0
 000A 0032              .word 50
 000C 0028              .word 40
 000E 0028              .word 40
 0010           L6:
 0010 0000              .word 0
 0012 0028              .word 40
 0014 0032              .word 50
 0016 0028              .word 40
 0018           L7:
 0018 0000              .word 0
 001A 0032              .word 50
 001C 0028              .word 40
 001E 0028              .word 40
 0020           ;  IX -> 0,x
 0020           ;  rMEM -> 2,x
 0020           ;      rightline -> +4,x
 0020           ;      sensorone -> +6,x
 0020           ;     sensorzero -> +8,x
 0020           ;        counter -> +10,x
 0020           ;         visual -> +12,x
 0020           ;     anglethree -> +14,x
 0020           ;       angletwo -> +22,x
 0020           ;          three -> +30,x
 0020           ;            two -> +38,x
 0020           ;          temp1 -> +46,x
 0020           ;          temp2 -> +48,x
 0020           ;       leftline -> +50,x
 0020           _main::
 0020 BD0000            jsr __enterb
 0023 34                .byte 0x34
 0024           ; #include <stdio.h>
 0024           ; #include <hc11.h>
 0024           ; 
 0024           ; #define top_of_robot *(unsigned char volatile *)(0xB590)
 0024           ; #define linetrack *(unsigned char volatile *) (0XB5A0)
 0024           ; #define       limitswitches *(unsigned char volatile *) (0xB5C0)
 0024           ; 
 0024           ; unsigned int OC2hi, OC2lo, OC3hi, OC3lo;      /* Duty cycle data */
 0024           ; unsigned int T_counts=0x4e20, per_on2=40, per_on3=40,cntflag=0;
 0024           ; 
 0024           ; 
 0024           ; /* Prototypes */
 0024           ; void initoc(void);
 0024           ; void rtoc2(void);
 0024           ; void rtoc3(void);
 0024           ; void cnts2(void);
 0024           ; void cnts3(void);
 0024           ; void display (int);
 0024           ; 
 0024           ; 
 0024           ; void main(void)
 0024           ; {
 0024           ;       int visual = 0, counter = 0;
 0024 CC0000            ldd #0
 0027 ED0C              std 12,x
 0029 CC0000            ldd #0
 002C ED0A              std 10,x
 002E           ;       int temp1=0, temp2=0, sensorzero=0, sensorone=0;
 002E CC0000            ldd #0
 0031 ED2E              std 46,x
 0033 CC0000            ldd #0
 0036 ED30              std 48,x
 0038 CC0000            ldd #0
 003B ED08              std 8,x
 003D CC0000            ldd #0
 0040 ED06              std 6,x
 0042           ;       int rightline = 0, leftline = 0;
 0042 CC0000            ldd #0
 0045 ED04              std 4,x
 0047 CC0000            ldd #0
 004A ED32              std 50,x
 004C           ;       //             0  1 2  3  
 004C           ;       int two[4]=  {0,40,50,40};
 004C EC00              ldd 0,x
 004E C30026            addd #38
 0051 18CE0000          ldy #L4
 0055 3C                pshx
 0056 8F                xgdx
 0057 CC0008            ldd #8
 005A BD0000            jsr __asgnblk
 005D 38                pulx
 005E           ;       int three[4]={0,50,40,40};
 005E EC00              ldd 0,x
 0060 C3001E            addd #30
 0063 18CE0008          ldy #L5
 0067 3C                pshx
 0068 8F                xgdx
 0069 CC0008            ldd #8
 006C BD0000            jsr __asgnblk
 006F 38                pulx
 0070           ;       //                  0  1  2  3
 0070           ;       int     angletwo[4]      ={00,40,50,40};                  
 0070 EC00              ldd 0,x
 0072 C30016            addd #22
 0075 18CE0010          ldy #L6
 0079 3C                pshx
 007A 8F                xgdx
 007B CC0008            ldd #8
 007E BD0000            jsr __asgnblk
 0081 38                pulx
 0082           ;       int anglethree[4]={00,50,40,40};
 0082 EC00              ldd 0,x
 0084 C3000E            addd #14
 0087 18CE0018          ldy #L7
 008B 3C                pshx
 008C 8F                xgdx
 008D CC0008            ldd #8
 0090 BD0000            jsr __asgnblk
 0093 38                pulx
 0094           ;       
 0094           ;       OPTION = 0x93;
 0094 C693              ldab #147
 0096 F71039            stab 0x1039
 0099           ;       
 0099           ;       setbaud(BAUD9600);
 0099 CC0030            ldd #48
 009C BD0000            jsr _setbaud
 009F           ;       INTR_OFF();
 009F 0F                                sei
 00A0           
 00A0           ;       /* set up jump vector for buffalo */
 00A0           ;       asm("   ldaa #$7e");
 00A0 867E                              ldaa #$7e
 00A2           
 00A2           ;       asm("   staa $dc");
 00A2 97DC                              staa $dc
 00A4           
 00A4           ;       asm("   staa $eb");
 00A4 97EB                              staa $eb
 00A6           
 00A6           ;       asm("   staa $d9");
 00A6 97D9                              staa $d9
 00A8           
 00A8           ;       asm("   ldd #_rtoc2");
 00A8 CC030A                            ldd #_rtoc2
 00AB           
 00AB           ;       asm("   std $dd");
 00AB DDDD                              std $dd
 00AD           
 00AD           ;       asm("   ldd #_rtoc3");
 00AD CC0340                            ldd #_rtoc3
 00B0           
 00B0           ;       asm("   std $da");
 00B0 DDDA                              std $da
 00B2           
 00B2           ;       asm("   ldd #_RTIINTR");
 00B2 CC0530                            ldd #_RTIINTR
 00B5           
 00B5           ;       asm("   std $ec");
 00B5 DDEC                              std $ec
 00B7           
 00B7           ;       TMSK2=0x40;
 00B7 C640              ldab #64
 00B9 F71024            stab 0x1024
 00BC           ;       PACTL=PACTL & 0xFC;
 00BC 18CE1026          ldy #0x1026
 00C0 181D0003          bclr 0,y,#0x3
 00C4           ;       PACTL=PACTL | 0x00;
 00C4                   ; vol
 00C4 F61026            ldab 0x1026
 00C7 F71026            stab 0x1026
 00CA           ;       
 00CA           ;       visual = 6;
 00CA CC0006            ldd #6
 00CD ED0C              std 12,x
 00CF           ;       display(visual);
 00CF EC0C              ldd 12,x
 00D1 BD05AA            jsr _display
 00D4           ;       cntflag = 0;
 00D4 CC0000            ldd #0
 00D7 FD0006            std _cntflag
 00DA 7E02E4            jmp L9
 00DD           L8:
 00DD           ; 
 00DD           ; while (1)
 00DD           ; {	 
 00DD           ; 	ADCTL=0x01;
 00DD C601              ldab #1
 00DF F71030            stab 0x1030
 00E2           L11:
 00E2           L12:
 00E2           ; 	while((ADCTL & 0x80) != 0x80);
 00E2           	; vol
 00E2 F61030            ldab 0x1030
 00E5 C480              andb #128
 00E7 C180              cmpb #128
 00E9 26F7              bne L11
 00EB 200E              bra L15
 00ED           L14:
 00ED           ; 	while(!(ADR1 < 70 && ADR1 > 40))
 00ED           ; 	{	 
 00ED           ;         	
 00ED           ; 		 ADCTL=0x01;
 00ED C601              ldab #1
 00EF F71030            stab 0x1030
 00F2           L17:
 00F2           L18:
 00F2           	; vol
 00F2 F61030            ldab 0x1030
 00F5 C480              andb #128
 00F7 C180              cmpb #128
 00F9 26F7              bne L17
 00FB           L15:
 00FB           	; vol
 00FB F61031            ldab 0x1031
 00FE C146              cmpb #70
 0100 24EB              bhs L14
 0102                   ; vol
 0102 F61031            ldab 0x1031
 0105 C128              cmpb #40
 0107 23E4              bls L14
 0109           ;                while((ADCTL & 0x80) != 0x80);
 0109           ;       }
 0109           ;                 
 0109           ;                       visual = 7;
 0109 CC0007            ldd #7
 010C ED0C              std 12,x
 010E           ;                   display(visual);
 010E EC0C              ldd 12,x
 0110 BD05AA            jsr _display
 0113           ;                       initoc();
 0113 BD02EF            jsr _initoc
 0116           ;                       cntflag = 0;
 0116 CC0000            ldd #0
 0119 FD0006            std _cntflag
 011C 200B              bra L21
 011E           L20:
 011E C603              ldab #3
 0120 F7B590            stab 0xb590
 0123 BD0376            jsr _cnts2
 0126 BD0453            jsr _cnts3
 0129           L21:
 0129           ; 			while (cntflag <= 10){
 0129 FC0006            ldd _cntflag
 012C 1A83000A          cpd #10
 0130 23EC              bls L20
 0132           ;                       top_of_robot = 0x03;
 0132           ;                       cnts2();
 0132           ;                       cnts3();
 0132           ;                       }
 0132           ;               cntflag = 0;
 0132 CC0000            ldd #0
 0135 FD0006            std _cntflag
 0138           ;       
 0138           ;               leftline = linetrack & 0xC0;
 0138                   ; vol
 0138 F6B5A0            ldab 0xb5a0
 013B 4F                clra
 013C 8400              anda #0
 013E C4C0              andb #192
 0140 ED32              std 50,x
 0142 7E0246            jmp L24
 0145           X0:
 0145           ; 		while (temp1 != 0 )
 0145           ; 		{     
 0145           L26:
 0145 7F1022            clr 0x1022
 0148 7F1000            clr 0x1000
 014B                   ; vol
 014B F6B5A0            ldab 0xb5a0
 014E 4F                clra
 014F 8400              anda #0
 0151 C4C0              andb #192
 0153 ED32              std 50,x
 0155           L27:
 0155           ; 		while (leftline != 0x00)
 0155 EC32              ldd 50,x
 0157 26EC              bne L26
 0159           ;               {  TMSK1 = 0x00;
 0159           ;                         PORTA = 0x00;
 0159           ;                         leftline = linetrack & 0xC0;
 0159           ;               }         
 0159           ;                     TMSK1 = 0x00;
 0159 7F1022            clr 0x1022
 015C           ;                         PORTA = 0x00;
 015C 7F1000            clr 0x1000
 015F           L29:
 015F           L30:
 015F           ; 			  while (cntflag <= 100)
 015F FC0006            ldd _cntflag
 0162 1A830064          cpd #100
 0166 23F7              bls L29
 0168           ;                         {
 0168           ;                         }
 0168           ;                         if(temp1 == 0x01)
 0168 EC2E              ldd 46,x
 016A 1A830001          cpd #1
 016E 2628              bne L32
 0170           ;                         {
 0170           ;                         per_on2 = two[temp1];
 0170 EC00              ldd 0,x
 0172 C30026            addd #38
 0175 ED02              std 2,x
 0177 EC2E              ldd 46,x
 0179 05                lsld
 017A E302              addd 2,x
 017C 188F              xgdy
 017E 18EC00            ldd 0,y
 0181 FD0002            std _per_on2
 0184           ;                         per_on3 = three[temp1];
 0184 EC00              ldd 0,x
 0186 C3001E            addd #30
 0189 ED02              std 2,x
 018B EC2E              ldd 46,x
 018D 05                lsld
 018E E302              addd 2,x
 0190 188F              xgdy
 0192 18EC00            ldd 0,y
 0195 FD0004            std _per_on3
 0198           ;                         }
 0198           L32:
 0198           ; 			  if (temp1 == 0x02)
 0198 EC2E              ldd 46,x
 019A 1A830002          cpd #2
 019E 2628              bne L34
 01A0           ;                         {
 01A0           ;                         per_on2 = two[temp1];
 01A0 EC00              ldd 0,x
 01A2 C30026            addd #38
 01A5 ED02              std 2,x
 01A7 EC2E              ldd 46,x
 01A9 05                lsld
 01AA E302              addd 2,x
 01AC 188F              xgdy
 01AE 18EC00            ldd 0,y
 01B1 FD0002            std _per_on2
 01B4           ;                         per_on3 = three[temp1];
 01B4 EC00              ldd 0,x
 01B6 C3001E            addd #30
 01B9 ED02              std 2,x
 01BB EC2E              ldd 46,x
 01BD 05                lsld
 01BE E302              addd 2,x
 01C0 188F              xgdy
 01C2 18EC00            ldd 0,y
 01C5 FD0004            std _per_on3
 01C8           ;                         }
 01C8           L34:
 01C8           ; 			  if (temp1 == 0x02 && temp2 == 0x04)
 01C8 EC2E              ldd 46,x
 01CA 1A830002          cpd #2
 01CE 2614              bne L36
 01D0 EC30              ldd 48,x
 01D2 1A830004          cpd #4
 01D6 260C              bne L36
 01D8           ;                         {
 01D8           ;                         per_on2 = 20;
 01D8 CC0014            ldd #20
 01DB FD0002            std _per_on2
 01DE           ;                         per_on3 = 40;
 01DE CC0028            ldd #40
 01E1 FD0004            std _per_on3
 01E4           ;                         }
 01E4           L36:
 01E4           ; 			  if (temp1 == 0x01 && temp2 == 0x08)
 01E4 EC2E              ldd 46,x
 01E6 1A830001          cpd #1
 01EA 2614              bne L38
 01EC EC30              ldd 48,x
 01EE 1A830008          cpd #8
 01F2 260C              bne L38
 01F4           ;                         {
 01F4           ;                         per_on2 = 40;
 01F4 CC0028            ldd #40
 01F7 FD0002            std _per_on2
 01FA           ;                         per_on3 = 20;
 01FA CC0014            ldd #20
 01FD FD0004            std _per_on3
 0200           ;                         }
 0200           L38:
 0200           ; 			  if (temp1 == 0x03 && temp2 == 0x0C)
 0200 EC2E              ldd 46,x
 0202 1A830003          cpd #3
 0206 2614              bne L40
 0208 EC30              ldd 48,x
 020A 1A83000C          cpd #12
 020E 260C              bne L40
 0210           ;                         {
 0210           ;                         per_on2 = 40; 
 0210 CC0028            ldd #40
 0213 FD0002            std _per_on2
 0216           ;                         per_on3 = 40;
 0216 CC0028            ldd #40
 0219 FD0004            std _per_on3
 021C           ;                         }
 021C           L40:
 021C C660              ldab #96
 021E F71022            stab 0x1022
 0221 C603              ldab #3
 0223 F7B590            stab 0xb590
 0226 BD0376            jsr _cnts2
 0229 BD0453            jsr _cnts3
 022C CC0000            ldd #0
 022F FD0006            std _cntflag
 0232                   ; vol
 0232 F6B5A0            ldab 0xb5a0
 0235 4F                clra
 0236 8400              anda #0
 0238 C403              andb #3
 023A ED2E              std 46,x
 023C                   ; vol
 023C F6B5A0            ldab 0xb5a0
 023F 4F                clra
 0240 8400              anda #0
 0242 C40C              andb #12
 0244 ED30              std 48,x
 0246           L24:
 0246 EC2E              ldd 46,x
 0248 2703              beq X3
 024A 7E0155            jmp L27
 024D           X3:
 024D           ; 		  	  TMSK1 = 0x60;
 024D           ; 			  top_of_robot = 0x03;
 024D           ; 		  	  cnts2();
 024D           ; 		  	  cnts3();
 024D           ; 			  cntflag = 0;
 024D           ; 			  temp1 = linetrack & 0x03;
 024D           ; 			  temp2 = linetrack & 0x0C;
 024D           ; 		 }
 024D           ; 		 leftline = linetrack & 0xC0;
 024D           	; vol
 024D F6B5A0            ldab 0xb5a0
 0250 4F                clra
 0251 8400              anda #0
 0253 C4C0              andb #192
 0255 ED32              std 50,x
 0257 7E02D3            jmp L43
 025A           X1:
 025A           ;        	 while (temp1 == 0x03)
 025A           ; 		 {
 025A           L45:
 025A 7F1022            clr 0x1022
 025D 7F1000            clr 0x1000
 0260                   ; vol
 0260 F6B5A0            ldab 0xb5a0
 0263 4F                clra
 0264 8400              anda #0
 0266 C4C0              andb #192
 0268 ED32              std 50,x
 026A           L46:
 026A           ; 		 while (leftline != 0x00)
 026A EC32              ldd 50,x
 026C 26EC              bne L45
 026E 2022              bra L49
 0270           L48:
 0270 C660              ldab #96
 0272 F71022            stab 0x1022
 0275 C603              ldab #3
 0277 F7B590            stab 0xb590
 027A CC001E            ldd #30
 027D FD0002            std _per_on2
 0280 CC001E            ldd #30
 0283 FD0004            std _per_on3
 0286 BD0376            jsr _cnts2
 0289 BD0453            jsr _cnts3
 028C CC0000            ldd #0
 028F FD0006            std _cntflag
 0292           L49:
 0292 EC30              ldd 48,x
 0294 27DA              beq L48
 0296 C603              ldab #3
 0298 F7B590            stab 0xb590
 029B EC00              ldd 0,x
 029D C30016            addd #22
 02A0 ED02              std 2,x
 02A2 EC30              ldd 48,x
 02A4 05                lsld
 02A5 E302              addd 2,x
 02A7 188F              xgdy
 02A9 18EC00            ldd 0,y
 02AC FD0002            std _per_on2
 02AF EC00              ldd 0,x
 02B1 C3000E            addd #14
 02B4 ED02              std 2,x
 02B6 EC30              ldd 48,x
 02B8 05                lsld
 02B9 E302              addd 2,x
 02BB 188F              xgdy
 02BD 18EC00            ldd 0,y
 02C0 FD0004            std _per_on3
 02C3 BD0376            jsr _cnts2
 02C6 BD0453            jsr _cnts3
 02C9                   ; vol
 02C9 F6B5A0            ldab 0xb5a0
 02CC 4F                clra
 02CD 8400              anda #0
 02CF C403              andb #3
 02D1 ED2E              std 46,x
 02D3           L43:
 02D3 EC2E              ldd 46,x
 02D5 1A830003          cpd #3
 02D9 2603              bne X4
 02DB 7E026A            jmp L46
 02DE           X4:
 02DE CC0000            ldd #0
 02E1 FD0006            std _cntflag
 02E4           L9:
 02E4 7E00DD            jmp L8
 02E7           X2:
 02E7           ; 		{  TMSK1 = 0x00;
 02E7           ; 			  PORTA = 0x00;
 02E7           ; 			  leftline = linetrack & 0xC0;
 02E7           ; 		}	
 02E7           ; 		   	  while (temp2 == 0x00)
 02E7           ; 		  	  {
 02E7           ; 		  	  	TMSK1 = 0x60;
 02E7           ; 				top_of_robot = 0x03;
 02E7           ; 		  	 	per_on2 = 30;
 02E7           ; 		  	 	per_on3 = 30;
 02E7           ; 		  	 	cnts2();
 02E7           ; 		  	 	cnts3();
 02E7           ; 				cntflag = 0;
 02E7           ; 				
 02E7           ; 		  	  }
 02E7           ; 		  	 top_of_robot = 0x03;
 02E7           ; 		  	 per_on2 = angletwo[temp2];
 02E7           ; 		  	 per_on3 = anglethree[temp2];
 02E7           ; 		  	 cnts2();
 02E7           ; 		 	 cnts3();
 02E7           ; 			 temp1 = linetrack & 0x03;
 02E7           ; 			 
 02E7           ; 		}
 02E7           ; 		  
 02E7           ; 
 02E7           ; 	    cntflag = 0;
 02E7           ; 	  }		
 02E7           ; 			
 02E7           ; } 
 02E7           L3:
 02E7 8F                xgdx
 02E8 C30034            addd #52
 02EB 8F                xgdx
 02EC 35                txs
 02ED 38                pulx
 02EE                   .dbline 0 ; func end
 02EE 39                rts
 02EF           _initoc::
 02EF           ; 
 02EF           ; void initoc(void)
 02EF           ; /* Initialize OC2 */
 02EF           ; {
 02EF           ; 	TOC2 = TCNT;
 02EF           	; vol
 02EF FC100E            ldd 0x100e
 02F2 FD1018            std 0x1018
 02F5           ;       TOC3 = TCNT;
 02F5                   ; vol
 02F5 FC100E            ldd 0x100e
 02F8 FD101A            std 0x101a
 02FB           ;       TCTL1 = 0x00;
 02FB 7F1020            clr 0x1020
 02FE           ;       TFLG1 = 0x60;
 02FE C660              ldab #96
 0300 F71023            stab 0x1023
 0303           ;       TMSK1 = 0x60;
 0303 C660              ldab #96
 0305 F71022            stab 0x1022
 0308           ;       INTR_ON();
 0308 0E                                cli
 0309           
 0309           ; }
 0309           L51:
 0309                   .dbline 0 ; func end
 0309 39                rts
 030A           _rtoc2::
 030A           ; 
 030A           ; void rtoc2(void)
 030A           ; /* Interrupt Service Routine for OC2 PWM */
 030A           ; {  
 030A           ; 	if ((PORTA & 0X40) == 0){ 
 030A 18CE1000          ldy #0x1000
 030E 181F004002        brclr 0,y,#64,X5
 0313 2013              bra L53
 0315           X5:
 0315           ; 		TOC2 = TOC2 + OC2lo;
 0315           	; vol
 0315 FC1018            ldd 0x1018
 0318 F30004            addd _OC2lo
 031B FD1018            std 0x1018
 031E           ;               PORTA = PORTA | 0x40;
 031E 18CE1000          ldy #0x1000
 0322 181C0040          bset 0,y,#64
 0326           ;               }
 0326 2009              bra L54
 0328           L53:
 0328           ; 	else
 0328           ; 		TOC2 = TOC2 + OC2hi;
 0328           	; vol
 0328 FC1018            ldd 0x1018
 032B F30006            addd _OC2hi
 032E FD1018            std 0x1018
 0331           L54:
 0331           ; 		PORTA = PORTA |  0xBF;
 0331 18CE1000          ldy #0x1000
 0335 181C00BF          bset 0,y,#191
 0339           ;       
 0339           ;       TFLG1 = 0x40;   /* Clear flag OC2F */
 0339 C640              ldab #64
 033B F71023            stab 0x1023
 033E           ;       asm("   rti");  /* This is an interrupt service routine */
 033E 3B                                rti
 033F           
 033F           ; }
 033F           L52:
 033F                   .dbline 0 ; func end
 033F 39                rts
 0340           _rtoc3::
 0340           ; 
 0340           ; void rtoc3(void)
 0340           ; {	
 0340           ; 	if ((PORTA & 0X20) == 0) {
 0340 18CE1000          ldy #0x1000
 0344 181F002002        brclr 0,y,#32,X6
 0349 2013              bra L56
 034B           X6:
 034B           ; 		TOC3 = TOC3 + OC3lo;
 034B           	; vol
 034B FC101A            ldd 0x101a
 034E F30000            addd _OC3lo
 0351 FD101A            std 0x101a
 0354           ;               PORTA = PORTA | 0x20;
 0354 18CE1000          ldy #0x1000
 0358 181C0020          bset 0,y,#32
 035C           ;       }       
 035C 2009              bra L57
 035E           L56:
 035E           ; 	else
 035E           ; 		TOC3 = TOC3 + OC3hi;
 035E           	; vol
 035E FC101A            ldd 0x101a
 0361 F30002            addd _OC3hi
 0364 FD101A            std 0x101a
 0367           L57:
 0367           ; 		PORTA = PORTA | 0xDF;
 0367 18CE1000          ldy #0x1000
 036B 181C00DF          bset 0,y,#223
 036F           ;       
 036F           ;       TFLG1 = 0x20;   /* Clear flag OC2F */
 036F C620              ldab #32
 0371 F71023            stab 0x1023
 0374           ;       asm("   rti");  /* This is an interrupt service routine */
 0374 3B                                rti
 0375           
 0375           ; }
 0375           L55:
 0375                   .dbline 0 ; func end
 0375 39                rts
 0376           ;  lreg1 -> -4,x
 0376           ;  lreg2 -> -8,x
 0376           ;  IX -> 0,x
 0376           ;          ?temp -> +2,x
 0376           ;          ?temp -> +6,x
 0376           _cnts2::
 0376 BD0000            jsr __enterb
 0379 88                .byte 0x88
 037A           ; void cnts2 (void)
 037A           ; {
 037A           ;       OC2hi=T_counts * (float)per_on2/100;
 037A FC0002            ldd _per_on2
 037D 04                lsrd
 037E BD0000            jsr __d2lreg
 0381 BD0000            jsr __long2fp
 0384 BD0000            jsr __fpmov
 0387 18CE0970          ldy #L62
 038B BD0000            jsr __tofp1
 038E BD0000            jsr __fpmul
 0391 FC0002            ldd _per_on2
 0394 8400              anda #0
 0396 C401              andb #1
 0398 BD0000            jsr __d2lreg
 039B BD0000            jsr __pshfp1 ; spill
 039E BD0000            jsr __long2fp
 03A1 BD0000            jsr __fpmov
 03A4 BD0000            jsr __pulfp1 ; reload
 03A7 BD0000            jsr __fpadd
 03AA BD0000            jsr __fpmov
 03AD FC0000            ldd _T_counts
 03B0 04                lsrd
 03B1 BD0000            jsr __d2lreg
 03B4 BD0000            jsr __long2fp
 03B7 BD0000            jsr __pshfp2 ; spill
 03BA BD0000            jsr __fpmov
 03BD 18CE0970          ldy #L62
 03C1 BD0000            jsr __tofp1
 03C4 BD0000            jsr __fpmul
 03C7 FC0000            ldd _T_counts
 03CA 8400              anda #0
 03CC C401              andb #1
 03CE BD0000            jsr __d2lreg
 03D1 BD0000            jsr __pshfp1 ; spill
 03D4 BD0000            jsr __long2fp
 03D7 BD0000            jsr __fpmov
 03DA BD0000            jsr __pulfp1 ; reload
 03DD BD0000            jsr __fpadd
 03E0 BD0000            jsr __pulfp2 ; reload
 03E3 BD0000            jsr __fpmul
 03E6 18CE096C          ldy #L63
 03EA BD0000            jsr __tofp2
 03ED BD0000            jsr __fpdiv
 03F0 EC00              ldd 0,x
 03F2 C30002            addd #2
 03F5 188F              xgdy
 03F7 BD0000            jsr __fromfp1
 03FA EC00              ldd 0,x
 03FC C30002            addd #2
 03FF 188F              xgdy
 0401 BD0000            jsr __tofp1
 0404 18CE0968          ldy #L64
 0408 BD0000            jsr __tofp2
 040B BD0000            jsr __fpcmp
 040E 2D1E              blt L60
 0410 EC00              ldd 0,x
 0412 C30002            addd #2
 0415 188F              xgdy
 0417 BD0000            jsr __tofp1
 041A 18CE0968          ldy #L64
 041E BD0000            jsr __tofp2
 0421 BD0000            jsr __fpsub
 0424 BD0000            jsr __fp2int
 0427 C38000            addd #0x8000
 042A ED06              std 6,x
 042C 200F              bra L61
 042E           L60:
 042E EC00              ldd 0,x
 0430 C30002            addd #2
 0433 188F              xgdy
 0435 BD0000            jsr __tofp1
 0438 BD0000            jsr __fp2int
 043B ED06              std 6,x
 043D           L61:
 043D EC06              ldd 6,x
 043F FD0006            std _OC2hi
 0442           ;       OC2lo=T_counts - OC2hi;
 0442 FC0000            ldd _T_counts
 0445 B30006            subd _OC2hi
 0448 FD0004            std _OC2lo
 044B           ; }
 044B           L58:
 044B 8F                xgdx
 044C C30008            addd #8
 044F 8F                xgdx
 0450 35                txs
 0451 38                pulx
 0452                   .dbline 0 ; func end
 0452 39                rts
 0453           ;  lreg1 -> -4,x
 0453           ;  lreg2 -> -8,x
 0453           ;  IX -> 0,x
 0453           ;          ?temp -> +2,x
 0453           ;          ?temp -> +6,x
 0453           _cnts3::
 0453 BD0000            jsr __enterb
 0456 88                .byte 0x88
 0457           ; 
 0457           ; void cnts3 (void)
 0457           ; {
 0457           ;       OC3hi=T_counts * (float)per_on3/100;
 0457 FC0004            ldd _per_on3
 045A 04                lsrd
 045B BD0000            jsr __d2lreg
 045E BD0000            jsr __long2fp
 0461 BD0000            jsr __fpmov
 0464 18CE0970          ldy #L62
 0468 BD0000            jsr __tofp1
 046B BD0000            jsr __fpmul
 046E FC0004            ldd _per_on3
 0471 8400              anda #0
 0473 C401              andb #1
 0475 BD0000            jsr __d2lreg
 0478 BD0000            jsr __pshfp1 ; spill
 047B BD0000            jsr __long2fp
 047E BD0000            jsr __fpmov
 0481 BD0000            jsr __pulfp1 ; reload
 0484 BD0000            jsr __fpadd
 0487 BD0000            jsr __fpmov
 048A FC0000            ldd _T_counts
 048D 04                lsrd
 048E BD0000            jsr __d2lreg
 0491 BD0000            jsr __long2fp
 0494 BD0000            jsr __pshfp2 ; spill
 0497 BD0000            jsr __fpmov
 049A 18CE0970          ldy #L62
 049E BD0000            jsr __tofp1
 04A1 BD0000            jsr __fpmul
 04A4 FC0000            ldd _T_counts
 04A7 8400              anda #0
 04A9 C401              andb #1
 04AB BD0000            jsr __d2lreg
 04AE BD0000            jsr __pshfp1 ; spill
 04B1 BD0000            jsr __long2fp
 04B4 BD0000            jsr __fpmov
 04B7 BD0000            jsr __pulfp1 ; reload
 04BA BD0000            jsr __fpadd
 04BD BD0000            jsr __pulfp2 ; reload
 04C0 BD0000            jsr __fpmul
 04C3 18CE096C          ldy #L63
 04C7 BD0000            jsr __tofp2
 04CA BD0000            jsr __fpdiv
 04CD EC00              ldd 0,x
 04CF C30002            addd #2
 04D2 188F              xgdy
 04D4 BD0000            jsr __fromfp1
 04D7 EC00              ldd 0,x
 04D9 C30002            addd #2
 04DC 188F              xgdy
 04DE BD0000            jsr __tofp1
 04E1 18CE0968          ldy #L64
 04E5 BD0000            jsr __tofp2
 04E8 BD0000            jsr __fpcmp
 04EB 2D1E              blt L67
 04ED EC00              ldd 0,x
 04EF C30002            addd #2
 04F2 188F              xgdy
 04F4 BD0000            jsr __tofp1
 04F7 18CE0968          ldy #L64
 04FB BD0000            jsr __tofp2
 04FE BD0000            jsr __fpsub
 0501 BD0000            jsr __fp2int
 0504 C38000            addd #0x8000
 0507 ED06              std 6,x
 0509 200F              bra L68
 050B           L67:
 050B EC00              ldd 0,x
 050D C30002            addd #2
 0510 188F              xgdy
 0512 BD0000            jsr __tofp1
 0515 BD0000            jsr __fp2int
 0518 ED06              std 6,x
 051A           L68:
 051A EC06              ldd 6,x
 051C FD0002            std _OC3hi
 051F           ;       OC3lo=T_counts - OC3hi;
 051F FC0000            ldd _T_counts
 0522 B30002            subd _OC3hi
 0525 FD0000            std _OC3lo
 0528           ; }     
 0528           L65:
 0528 8F                xgdx
 0529 C30008            addd #8
 052C 8F                xgdx
 052D 35                txs
 052E 38                pulx
 052F                   .dbline 0 ; func end
 052F 39                rts
 0530           _RTIINTR::
 0530           ; 
 0530           ; void RTIINTR (void)
 0530           ; {
 0530           ;   TFLG2 = 0x40;
 0530 C640              ldab #64
 0532 F71025            stab 0x1025
 0535           ;   
 0535           ;   cntflag ++;
 0535 FC0006            ldd _cntflag
 0538 C30001            addd #1
 053B FD0006            std _cntflag
 053E           ;   
 053E           ;   asm("         rti");
 053E 3B                                  rti
 053F           
 053F           ; }
 053F           L69:
 053F                   .dbline 0 ; func end
 053F 39                rts
 0540           L71:
 0540 54686520456E642000        .byte 'T,'h,'e,32,'E,'n,'d,32,0
 0549           L72:
 0549 4475636B2020202000        .byte 'D,'u,'c,'k,32,32,32,32,0
 0552           L73:
 0552 446565722020202000        .byte 'D,'e,'e,'r,32,32,32,32,0
 055B           L74:
 055B 526162626974202000        .byte 'R,'a,'b,'b,'i,'t,32,32,0
 0564           L75:
 0564 446F6E652020202000        .byte 'D,'o,'n,'e,32,32,32,32,0
 056D           L76:
 056D 53746F702020202000        .byte 'S,'t,'o,'p,32,32,32,32,0
 0576           L77:
 0576 476F20202020202000        .byte 'G,'o,32,32,32,32,32,32,0
 057F           L78:
 057F 494545452055534D00        .byte 'I,'E,'E,'E,32,'U,'S,'M,0
 0588           L79:
 0588 202020202020202000        .byte 32,32,32,32,32,32,32,32,0
 0591           L80:
 0591 4E6F6E652020202000        .byte 'N,'o,'n,'e,32,32,32,32,0
 059A           L81:
 059A B5B7              .word 46519
 059C B5B6              .word 46518
 059E B5B5              .word 46517
 05A0 B5B4              .word 46516
 05A2 B5BF              .word 46527
 05A4 B5BE              .word 46526
 05A6 B5BD              .word 46525
 05A8 B5BC              .word 46524
 05AA           ;  IX -> 0,x
 05AA           ;  rMEM -> 2,x
 05AA           ;        nothing -> +5,x
 05AA           ;           wait -> +14,x
 05AA           ;        string9 -> +16,x
 05AA           ;        string8 -> +25,x
 05AA           ;        string7 -> +34,x
 05AA           ;        string6 -> +43,x
 05AA           ;        string5 -> +52,x
 05AA           ;        string4 -> +61,x
 05AA           ;        string3 -> +70,x
 05AA           ;        string2 -> +79,x
 05AA           ;        string1 -> +88,x
 05AA           ;          digit -> +97,x
 05AA           ;          ascii -> +113,x
 05AA           ;             ad -> +114,x
 05AA           ;            old -> +116,x
 05AA           ;            cnt -> +118,x
 05AA           ;           FRED -> +122,x
 05AA           _display::
 05AA BD0000            jsr __enter
 05AD 4078              .word 0x4078
 05AF           ; void display (FRED)
 05AF           ; {      
 05AF           ;        unsigned int ad;
 05AF           ;        unsigned char ascii;
 05AF           ;        int cnt,old=0,wait=0;
 05AF CC0000            ldd #0
 05B2 ED74              std 116,x
 05B4 CC0000            ldd #0
 05B7 ED0E              std 14,x
 05B9           ;        unsigned char string1[]="The End ";
 05B9 EC00              ldd 0,x
 05BB C30058            addd #88
 05BE 18CE0540          ldy #L71
 05C2 3C                pshx
 05C3 8F                xgdx
 05C4 CC0009            ldd #9
 05C7 BD0000            jsr __asgnblk
 05CA 38                pulx
 05CB           ;        unsigned char string2[]="Duck    ";
 05CB EC00              ldd 0,x
 05CD C3004F            addd #79
 05D0 18CE0549          ldy #L72
 05D4 3C                pshx
 05D5 8F                xgdx
 05D6 CC0009            ldd #9
 05D9 BD0000            jsr __asgnblk
 05DC 38                pulx
 05DD           ;        unsigned char string3[]="Deer    ";
 05DD EC00              ldd 0,x
 05DF C30046            addd #70
 05E2 18CE0552          ldy #L73
 05E6 3C                pshx
 05E7 8F                xgdx
 05E8 CC0009            ldd #9
 05EB BD0000            jsr __asgnblk
 05EE 38                pulx
 05EF           ;        unsigned char string4[]="Rabbit  ";
 05EF EC00              ldd 0,x
 05F1 C3003D            addd #61
 05F4 18CE055B          ldy #L74
 05F8 3C                pshx
 05F9 8F                xgdx
 05FA CC0009            ldd #9
 05FD BD0000            jsr __asgnblk
 0600 38                pulx
 0601           ;        unsigned char string5[]="Done    ";
 0601 EC00              ldd 0,x
 0603 C30034            addd #52
 0606 18CE0564          ldy #L75
 060A 3C                pshx
 060B 8F                xgdx
 060C CC0009            ldd #9
 060F BD0000            jsr __asgnblk
 0612 38                pulx
 0613           ;        unsigned char string6[]="Stop    ";
 0613 EC00              ldd 0,x
 0615 C3002B            addd #43
 0618 18CE056D          ldy #L76
 061C 3C                pshx
 061D 8F                xgdx
 061E CC0009            ldd #9
 0621 BD0000            jsr __asgnblk
 0624 38                pulx
 0625           ;        unsigned char string7[]="Go      ";
 0625 EC00              ldd 0,x
 0627 C30022            addd #34
 062A 18CE0576          ldy #L77
 062E 3C                pshx
 062F 8F                xgdx
 0630 CC0009            ldd #9
 0633 BD0000            jsr __asgnblk
 0636 38                pulx
 0637           ;        unsigned char string8[]="IEEE USM";
 0637 EC00              ldd 0,x
 0639 C30019            addd #25
 063C 18CE057F          ldy #L78
 0640 3C                pshx
 0641 8F                xgdx
 0642 CC0009            ldd #9
 0645 BD0000            jsr __asgnblk
 0648 38                pulx
 0649           ;        unsigned char string9[]="        ";
 0649 EC00              ldd 0,x
 064B C30010            addd #16
 064E 18CE0588          ldy #L79
 0652 3C                pshx
 0653 8F                xgdx
 0654 CC0009            ldd #9
 0657 BD0000            jsr __asgnblk
 065A 38                pulx
 065B           ;        unsigned char nothing[]="None    ";
 065B EC00              ldd 0,x
 065D C30005            addd #5
 0660 18CE0591          ldy #L80
 0664 3C                pshx
 0665 8F                xgdx
 0666 CC0009            ldd #9
 0669 BD0000            jsr __asgnblk
 066C 38                pulx
 066D           ;        unsigned int digit[8] = {0xb5B7, 0xb5B6, 0xb5B5, 0xb5B4,0xb5Bf, 0xb5Be, 0xb5Bd,
 066D EC00              ldd 0,x
 066F C30061            addd #97
 0672 18CE059A          ldy #L81
 0676 3C                pshx
 0677 8F                xgdx
 0678 CC0010            ldd #16
 067B BD0000            jsr __asgnblk
 067E 38                pulx
 067F           ;                                                          0xb5Bc};                              
 067F           ;  
 067F           ;        asm (" ldaa #$00");
 067F 8600                       ldaa #$00
 0681           
 0681           ;        asm (" staa $b590");
 0681 B7B590                     staa $b590
 0684           
 0684 2007              bra L83
 0686           L82:
 0686 EC74              ldd 116,x
 0688 C30001            addd #1
 068B ED74              std 116,x
 068D           L83:
 068D           ; 	 while (old <= 100){old ++;}
 068D EC74              ldd 116,x
 068F 1A830064          cpd #100
 0693 2FF1              ble L82
 0695           ;        asm (" ldaa #$03");
 0695 8603                       ldaa #$03
 0697           
 0697           ;        asm (" staa $b5B0");
 0697 B7B5B0                     staa $b5B0
 069A           
 069A           ;        asm (" staa $b5B8");
 069A B7B5B8                     staa $b5B8
 069D           
 069D           ;        
 069D           ;        
 069D           ;       
 069D           ;        if (FRED == 1){
 069D EC7A              ldd 122,x
 069F 1A830001          cpd #1
 06A3 2703              beq X7
 06A5 7E06EC            jmp L85
 06A8           X7:
 06A8           ; 	 	for(cnt=0; cnt<8; cnt++)
 06A8 CC0000            ldd #0
 06AB ED76              std 118,x
 06AD           L87:
 06AD EC00              ldd 0,x
 06AF C30058            addd #88
 06B2 ED02              std 2,x
 06B4 EC76              ldd 118,x
 06B6 E302              addd 2,x
 06B8 188F              xgdy
 06BA 18E600            ldab 0,y
 06BD E771              stab 113,x
 06BF EC00              ldd 0,x
 06C1 C30061            addd #97
 06C4 ED02              std 2,x
 06C6 EC76              ldd 118,x
 06C8 05                lsld
 06C9 E302              addd 2,x
 06CB 188F              xgdy
 06CD 18EC00            ldd 0,y
 06D0 ED72              std 114,x
 06D2 A671                       ldaa 113,x
 06D4           
 06D4 1AEE72                     ldy 114,x
 06D7           
 06D7 18A700                     staa 0,y
 06DA           
 06DA           L88:
 06DA EC76              ldd 118,x
 06DC C30001            addd #1
 06DF ED76              std 118,x
 06E1 EC76              ldd 118,x
 06E3 1A830008          cpd #8
 06E7 2DC4              blt L87
 06E9           ;               {
 06E9           ;                ascii=string1[cnt];
 06E9           ;                ad=digit[cnt];
 06E9           ;                asm (" ldaa %ascii");
 06E9           ;                asm (" ldy %ad");
 06E9           ;                asm (" staa 0,y");
 06E9           ;                }
 06E9           ;        }
 06E9 7E095E            jmp L86
 06EC           L85:
 06EC           ; 	 else if (FRED == 2){
 06EC EC7A              ldd 122,x
 06EE 1A830002          cpd #2
 06F2 2703              beq X8
 06F4 7E073B            jmp L91
 06F7           X8:
 06F7           ; 	 	for(cnt=0; cnt<8; cnt++)
 06F7 CC0000            ldd #0
 06FA ED76              std 118,x
 06FC           L93:
 06FC EC00              ldd 0,x
 06FE C3004F            addd #79
 0701 ED02              std 2,x
 0703 EC76              ldd 118,x
 0705 E302              addd 2,x
 0707 188F              xgdy
 0709 18E600            ldab 0,y
 070C E771              stab 113,x
 070E EC00              ldd 0,x
 0710 C30061            addd #97
 0713 ED02              std 2,x
 0715 EC76              ldd 118,x
 0717 05                lsld
 0718 E302              addd 2,x
 071A 188F              xgdy
 071C 18EC00            ldd 0,y
 071F ED72              std 114,x
 0721 A671                       ldaa 113,x
 0723           
 0723 1AEE72                     ldy 114,x
 0726           
 0726 18A700                     staa 0,y
 0729           
 0729           L94:
 0729 EC76              ldd 118,x
 072B C30001            addd #1
 072E ED76              std 118,x
 0730 EC76              ldd 118,x
 0732 1A830008          cpd #8
 0736 2DC4              blt L93
 0738           ;               {
 0738           ;                ascii=string2[cnt];
 0738           ;                ad=digit[cnt];
 0738           ;                asm (" ldaa %ascii");
 0738           ;                asm (" ldy %ad");
 0738           ;                asm (" staa 0,y");
 0738           ;                }
 0738           ;        }  
 0738 7E095E            jmp L92
 073B           L91:
 073B           ; 	 else if (FRED == 3){
 073B EC7A              ldd 122,x
 073D 1A830003          cpd #3
 0741 2703              beq X9
 0743 7E078A            jmp L97
 0746           X9:
 0746           ; 	 	for(cnt=0; cnt<8; cnt++)
 0746 CC0000            ldd #0
 0749 ED76              std 118,x
 074B           L99:
 074B EC00              ldd 0,x
 074D C30046            addd #70
 0750 ED02              std 2,x
 0752 EC76              ldd 118,x
 0754 E302              addd 2,x
 0756 188F              xgdy
 0758 18E600            ldab 0,y
 075B E771              stab 113,x
 075D EC00              ldd 0,x
 075F C30061            addd #97
 0762 ED02              std 2,x
 0764 EC76              ldd 118,x
 0766 05                lsld
 0767 E302              addd 2,x
 0769 188F              xgdy
 076B 18EC00            ldd 0,y
 076E ED72              std 114,x
 0770 A671                       ldaa 113,x
 0772           
 0772 1AEE72                     ldy 114,x
 0775           
 0775 18A700                     staa 0,y
 0778           
 0778           L100:
 0778 EC76              ldd 118,x
 077A C30001            addd #1
 077D ED76              std 118,x
 077F EC76              ldd 118,x
 0781 1A830008          cpd #8
 0785 2DC4              blt L99
 0787           ;               {
 0787           ;                ascii=string3[cnt];
 0787           ;                ad=digit[cnt];
 0787           ;                asm (" ldaa %ascii");
 0787           ;                asm (" ldy %ad");
 0787           ;                asm (" staa 0,y");
 0787           ;                }
 0787           ;        }
 0787 7E095E            jmp L98
 078A           L97:
 078A           ; 	 else if (FRED == 4){
 078A EC7A              ldd 122,x
 078C 1A830004          cpd #4
 0790 2703              beq X10
 0792 7E07D9            jmp L103
 0795           X10:
 0795           ; 	    for(cnt=0; cnt<8; cnt++)
 0795 CC0000            ldd #0
 0798 ED76              std 118,x
 079A           L105:
 079A EC00              ldd 0,x
 079C C3003D            addd #61
 079F ED02              std 2,x
 07A1 EC76              ldd 118,x
 07A3 E302              addd 2,x
 07A5 188F              xgdy
 07A7 18E600            ldab 0,y
 07AA E771              stab 113,x
 07AC EC00              ldd 0,x
 07AE C30061            addd #97
 07B1 ED02              std 2,x
 07B3 EC76              ldd 118,x
 07B5 05                lsld
 07B6 E302              addd 2,x
 07B8 188F              xgdy
 07BA 18EC00            ldd 0,y
 07BD ED72              std 114,x
 07BF A671                       ldaa 113,x
 07C1           
 07C1 1AEE72                     ldy 114,x
 07C4           
 07C4 18A700                     staa 0,y
 07C7           
 07C7           L106:
 07C7 EC76              ldd 118,x
 07C9 C30001            addd #1
 07CC ED76              std 118,x
 07CE EC76              ldd 118,x
 07D0 1A830008          cpd #8
 07D4 2DC4              blt L105
 07D6           ;               {
 07D6           ;                ascii=string4[cnt];
 07D6           ;                ad=digit[cnt];
 07D6           ;                asm (" ldaa %ascii");
 07D6           ;                asm (" ldy %ad");
 07D6           ;                asm (" staa 0,y");
 07D6           ;                }
 07D6           ;        }
 07D6 7E095E            jmp L104
 07D9           L103:
 07D9           ; 	 else if (FRED == 5){
 07D9 EC7A              ldd 122,x
 07DB 1A830005          cpd #5
 07DF 2703              beq X11
 07E1 7E0828            jmp L109
 07E4           X11:
 07E4           ; 	 	for(cnt=0; cnt<8; cnt++)
 07E4 CC0000            ldd #0
 07E7 ED76              std 118,x
 07E9           L111:
 07E9 EC00              ldd 0,x
 07EB C30034            addd #52
 07EE ED02              std 2,x
 07F0 EC76              ldd 118,x
 07F2 E302              addd 2,x
 07F4 188F              xgdy
 07F6 18E600            ldab 0,y
 07F9 E771              stab 113,x
 07FB EC00              ldd 0,x
 07FD C30061            addd #97
 0800 ED02              std 2,x
 0802 EC76              ldd 118,x
 0804 05                lsld
 0805 E302              addd 2,x
 0807 188F              xgdy
 0809 18EC00            ldd 0,y
 080C ED72              std 114,x
 080E A671                       ldaa 113,x
 0810           
 0810 1AEE72                     ldy 114,x
 0813           
 0813 18A700                     staa 0,y
 0816           
 0816           L112:
 0816 EC76              ldd 118,x
 0818 C30001            addd #1
 081B ED76              std 118,x
 081D EC76              ldd 118,x
 081F 1A830008          cpd #8
 0823 2DC4              blt L111
 0825           ;               {
 0825           ;                ascii=string5[cnt];
 0825           ;                ad=digit[cnt];
 0825           ;                asm (" ldaa %ascii");
 0825           ;                asm (" ldy %ad");
 0825           ;                asm (" staa 0,y");
 0825           ;                }
 0825           ;        }
 0825 7E095E            jmp L110
 0828           L109:
 0828           ; 	 else if (FRED == 6){
 0828 EC7A              ldd 122,x
 082A 1A830006          cpd #6
 082E 2703              beq X12
 0830 7E0877            jmp L115
 0833           X12:
 0833           ; 	    for(cnt=0; cnt<8; cnt++)
 0833 CC0000            ldd #0
 0836 ED76              std 118,x
 0838           L117:
 0838 EC00              ldd 0,x
 083A C3002B            addd #43
 083D ED02              std 2,x
 083F EC76              ldd 118,x
 0841 E302              addd 2,x
 0843 188F              xgdy
 0845 18E600            ldab 0,y
 0848 E771              stab 113,x
 084A EC00              ldd 0,x
 084C C30061            addd #97
 084F ED02              std 2,x
 0851 EC76              ldd 118,x
 0853 05                lsld
 0854 E302              addd 2,x
 0856 188F              xgdy
 0858 18EC00            ldd 0,y
 085B ED72              std 114,x
 085D A671                       ldaa 113,x
 085F           
 085F 1AEE72                     ldy 114,x
 0862           
 0862 18A700                     staa 0,y
 0865           
 0865           L118:
 0865 EC76              ldd 118,x
 0867 C30001            addd #1
 086A ED76              std 118,x
 086C EC76              ldd 118,x
 086E 1A830008          cpd #8
 0872 2DC4              blt L117
 0874           ;               {
 0874           ;                ascii=string6[cnt];
 0874           ;                ad=digit[cnt];
 0874           ;                asm (" ldaa %ascii");
 0874           ;                asm (" ldy %ad");
 0874           ;                asm (" staa 0,y");
 0874           ;                }
 0874           ;        }
 0874 7E095E            jmp L116
 0877           L115:
 0877           ; 	 else if (FRED == 7){
 0877 EC7A              ldd 122,x
 0879 1A830007          cpd #7
 087D 2703              beq X13
 087F 7E08C6            jmp L121
 0882           X13:
 0882           ; 	 	for(cnt=0; cnt<8; cnt++)
 0882 CC0000            ldd #0
 0885 ED76              std 118,x
 0887           L123:
 0887 EC00              ldd 0,x
 0889 C30022            addd #34
 088C ED02              std 2,x
 088E EC76              ldd 118,x
 0890 E302              addd 2,x
 0892 188F              xgdy
 0894 18E600            ldab 0,y
 0897 E771              stab 113,x
 0899 EC00              ldd 0,x
 089B C30061            addd #97
 089E ED02              std 2,x
 08A0 EC76              ldd 118,x
 08A2 05                lsld
 08A3 E302              addd 2,x
 08A5 188F              xgdy
 08A7 18EC00            ldd 0,y
 08AA ED72              std 114,x
 08AC A671                       ldaa 113,x
 08AE           
 08AE 1AEE72                     ldy 114,x
 08B1           
 08B1 18A700                     staa 0,y
 08B4           
 08B4           L124:
 08B4 EC76              ldd 118,x
 08B6 C30001            addd #1
 08B9 ED76              std 118,x
 08BB EC76              ldd 118,x
 08BD 1A830008          cpd #8
 08C1 2DC4              blt L123
 08C3           ;               {
 08C3           ;                ascii=string7[cnt];
 08C3           ;                ad=digit[cnt];
 08C3           ;                asm (" ldaa %ascii");
 08C3           ;                asm (" ldy %ad");
 08C3           ;                asm (" staa 0,y");
 08C3           ;                }
 08C3           ;        }
 08C3 7E095E            jmp L122
 08C6           L121:
 08C6           ; 	 else if (FRED == 9){
 08C6 EC7A              ldd 122,x
 08C8 1A830009          cpd #9
 08CC 2703              beq X14
 08CE 7E0915            jmp L127
 08D1           X14:
 08D1           ; 	 	for(cnt=0; cnt<8; cnt++)
 08D1 CC0000            ldd #0
 08D4 ED76              std 118,x
 08D6           L129:
 08D6 EC00              ldd 0,x
 08D8 C30019            addd #25
 08DB ED02              std 2,x
 08DD EC76              ldd 118,x
 08DF E302              addd 2,x
 08E1 188F              xgdy
 08E3 18E600            ldab 0,y
 08E6 E771              stab 113,x
 08E8 EC00              ldd 0,x
 08EA C30061            addd #97
 08ED ED02              std 2,x
 08EF EC76              ldd 118,x
 08F1 05                lsld
 08F2 E302              addd 2,x
 08F4 188F              xgdy
 08F6 18EC00            ldd 0,y
 08F9 ED72              std 114,x
 08FB A671                       ldaa 113,x
 08FD           
 08FD 1AEE72                     ldy 114,x
 0900           
 0900 18A700                     staa 0,y
 0903           
 0903           L130:
 0903 EC76              ldd 118,x
 0905 C30001            addd #1
 0908 ED76              std 118,x
 090A EC76              ldd 118,x
 090C 1A830008          cpd #8
 0910 2DC4              blt L129
 0912           ;               {
 0912           ;                ascii=string8[cnt];
 0912           ;                ad=digit[cnt];
 0912           ;                asm (" ldaa %ascii");
 0912           ;                asm (" ldy %ad");
 0912           ;                asm (" staa 0,y");
 0912           ;                }
 0912           ;        }
 0912 7E095E            jmp L128
 0915           L127:
 0915           ; 	  else if (FRED == 8){
 0915 EC7A              ldd 122,x
 0917 1A830008          cpd #8
 091B 2641              bne L133
 091D           ;               for(cnt=0; cnt<8; cnt++)
 091D CC0000            ldd #0
 0920 ED76              std 118,x
 0922           L135:
 0922 EC00              ldd 0,x
 0924 C30010            addd #16
 0927 ED02              std 2,x
 0929 EC76              ldd 118,x
 092B E302              addd 2,x
 092D 188F              xgdy
 092F 18E600            ldab 0,y
 0932 E771              stab 113,x
 0934 EC00              ldd 0,x
 0936 C30061            addd #97
 0939 ED02              std 2,x
 093B EC76              ldd 118,x
 093D 05                lsld
 093E E302              addd 2,x
 0940 188F              xgdy
 0942 18EC00            ldd 0,y
 0945 ED72              std 114,x
 0947 A671                       ldaa 113,x
 0949           
 0949 1AEE72                     ldy 114,x
 094C           
 094C 18A700                     staa 0,y
 094F           
 094F           L136:
 094F EC76              ldd 118,x
 0951 C30001            addd #1
 0954 ED76              std 118,x
 0956 EC76              ldd 118,x
 0958 1A830008          cpd #8
 095C 2DC4              blt L135
 095E           ;               {
 095E           ;                ascii=string9[cnt];
 095E           ;                ad=digit[cnt];
 095E           ;                asm (" ldaa %ascii");
 095E           ;                asm (" ldy %ad");
 095E           ;                asm (" staa 0,y");
 095E           ;                }
 095E           ;        }
 095E           L133:
 095E           L128:
 095E           L122:
 095E           L116:
 095E           L110:
 095E           L104:
 095E           L98:
 095E           L92:
 095E           L86:
 095E           ; 	 /*else{
 095E           ; 	    for(cnt=0; cnt<8; cnt++)
 095E           ; 	 	{
 095E           ; 	 	 ascii=nothing[cnt];
 095E           ; 	 	 ad=digit[cnt];
 095E           ; 	 	 asm (" ldaa %ascii");
 095E           ; 	 	 asm (" ldy %ad");
 095E           ; 	 	 asm (" staa 0,y");
 095E           ; 	 	 }
 095E           ; 	 } */ 
 095E           ; 	 	 
 095E           ; 	 
 095E           ; }
 095E           L70:
 095E 8F                xgdx
 095F C30078            addd #120
 0962 8F                xgdx
 0963 35                txs
 0964 38                pulx
 0965 1838              puly
 0967                   .dbline 0 ; func end
 0967 39                rts
                        .area bss
 0000           _OC3lo::
 0000                   .blkb 2
 0002           _OC3hi::
 0002                   .blkb 2
 0004           _OC2lo::
 0004                   .blkb 2
 0006           _OC2hi::
 0006                   .blkb 2
                        .area text
 0968           L64:
 0968 47000000          .word 0x4700,0x0
 096C           L63:
 096C 42C80000          .word 0x42c8,0x0
 0970           L62:
 0970 40000000          .word 0x4000,0x0
