                        .module FINALCODE.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 0019              .word 25
                        .area data
 0004           _per_on3::
 0004                   .blkb 2
                        .area idata
 0004 0019              .word 25
                        .area data
 0006           _cntflag::
 0006                   .blkb 2
                        .area idata
 0006 0000              .word 0
                        .area data
                        .area text
                ;  IX -> 0,x
                ;        counter -> +2,x
                ;         visual -> +4,x
 0000           _main::
 0000 BD0000            jsr __enterb
 0003 06                .byte 0x6
 0004           ; #include <stdio.h>
 0004           ; #include <hc11.h>
 0004           ; 
 0004           ; #define top_of_robot *(unsigned char volatile *)(0xB590)
 0004           ; #define linetrack *(unsigned char volatile *) (0XB5A0)
 0004           ; #define       limitswitches *(unsigned char volatile *) (0xB5C0)
 0004           ; 
 0004           ; unsigned int OC2hi, OC2lo, OC3hi, OC3lo;      /* Duty cycle data */
 0004           ; unsigned int T_counts=0x4e20, per_on2=25, per_on3=25,cntflag=0;
 0004           ; 
 0004           ; 
 0004           ; /* Prototypes */
 0004           ; void initoc(void);
 0004           ; void rtoc2(void);
 0004           ; void rtoc3(void);
 0004           ; void cnts2(void);
 0004           ; void cnts3(void);
 0004           ; void display (int);
 0004           ; 
 0004           ; 
 0004           ; void main(void)
 0004           ; {
 0004           ;       int visual = 0, counter = 0;
 0004 CC0000            ldd #0
 0007 ED04              std 4,x
 0009 CC0000            ldd #0
 000C ED02              std 2,x
 000E           ;       OPTION = 0x93;
 000E C693              ldab #147
 0010 F71039            stab 0x1039
 0013           ;       
 0013           ;       setbaud(BAUD9600);
 0013 CC0030            ldd #48
 0016 BD0000            jsr _setbaud
 0019           ;       INTR_OFF();
 0019 0F                                sei
 001A           
 001A           ;       /* set up jump vector for buffalo */
 001A           ;       asm("   ldaa #$7e");
 001A 867E                              ldaa #$7e
 001C           
 001C           ;       asm("   staa $dc");
 001C 97DC                              staa $dc
 001E           
 001E           ;       asm("   staa $eb");
 001E 97EB                              staa $eb
 0020           
 0020           ;       asm("   staa $d9");
 0020 97D9                              staa $d9
 0022           
 0022           ;       asm("   ldd #_rtoc2");
 0022 CC00C6                            ldd #_rtoc2
 0025           
 0025           ;       asm("   std $dd");
 0025 DDDD                              std $dd
 0027           
 0027           ;       asm("   ldd #_rtoc3");
 0027 CC00FC                            ldd #_rtoc3
 002A           
 002A           ;       asm("   std $da");
 002A DDDA                              std $da
 002C           
 002C           ;       asm("   ldd #_RTIINTR");
 002C CC02EC                            ldd #_RTIINTR
 002F           
 002F           ;       asm("   std $ec");
 002F DDEC                              std $ec
 0031           
 0031           ;       
 0031           ;       visual = 6;
 0031 CC0006            ldd #6
 0034 ED04              std 4,x
 0036           ;       display(visual);
 0036 EC04              ldd 4,x
 0038 BD0366            jsr _display
 003B           ;       cntflag = 0;
 003B CC0000            ldd #0
 003E FD0006            std _cntflag
 0041 205E              bra L5
 0043           L4:
 0043           ; 
 0043           ; while (1)
 0043           ; {	 
 0043           ; 	ADCTL=0x01;
 0043 C601              ldab #1
 0045 F71030            stab 0x1030
 0048           L7:
 0048           L8:
 0048           ; 	while((ADCTL & 0x80) != 0x80);
 0048           	; vol
 0048 F61030            ldab 0x1030
 004B C480              andb #128
 004D C180              cmpb #128
 004F 26F7              bne L7
 0051 200E              bra L11
 0053           L10:
 0053           ; 	while(!((ADR1 < 210) && (ADR1 > 100)))
 0053           ; 	{	 
 0053           ;         	
 0053           ; 		 ADCTL=0x01;
 0053 C601              ldab #1
 0055 F71030            stab 0x1030
 0058           L13:
 0058           L14:
 0058           	; vol
 0058 F61030            ldab 0x1030
 005B C480              andb #128
 005D C180              cmpb #128
 005F 26F7              bne L13
 0061           L11:
 0061           	; vol
 0061 F61031            ldab 0x1031
 0064 C1D2              cmpb #210
 0066 24EB              bhs L10
 0068                   ; vol
 0068 F61031            ldab 0x1031
 006B C164              cmpb #100
 006D 23E4              bls L10
 006F           ;                while((ADCTL & 0x80) != 0x80);
 006F           ;       }
 006F           ;                 
 006F           ;                       visual = 7;
 006F CC0007            ldd #7
 0072 ED04              std 4,x
 0074           ;                   display(visual);
 0074 EC04              ldd 4,x
 0076 BD0366            jsr _display
 0079           ;                       initoc();
 0079 BD00AB            jsr _initoc
 007C           ;                       cntflag = 0;
 007C CC0000            ldd #0
 007F FD0006            std _cntflag
 0082 2014              bra L17
 0084           L16:
 0084 C603              ldab #3
 0086 F7B590            stab 0xb590
 0089 BD0132            jsr _cnts2
 008C BD020F            jsr _cnts3
 008F FC0006            ldd _cntflag
 0092 C30001            addd #1
 0095 FD0006            std _cntflag
 0098           L17:
 0098 FC0006            ldd _cntflag
 009B 1A8300FA          cpd #250
 009F 23E3              bls L16
 00A1           L5:
 00A1 20A0              bra L4
 00A3           X0:
 00A3           ; 			while (cntflag <= 250){
 00A3           ; 			top_of_robot = 0x03;
 00A3           ; 			cnts2();
 00A3           ; 			cnts3();
 00A3           ; 			cntflag++;
 00A3           ; 			}
 00A3           ; 			
 00A3           ; }			
 00A3           ; } 
 00A3           L3:
 00A3 8F                xgdx
 00A4 C30006            addd #6
 00A7 8F                xgdx
 00A8 35                txs
 00A9 38                pulx
 00AA                   .dbline 0 ; func end
 00AA 39                rts
 00AB           _initoc::
 00AB           ; 
 00AB           ; void initoc(void)
 00AB           ; /* Initialize OC2 */
 00AB           ; {
 00AB           ; 	TOC2 = TCNT;
 00AB           	; vol
 00AB FC100E            ldd 0x100e
 00AE FD1018            std 0x1018
 00B1           ;       TOC3 = TCNT;
 00B1                   ; vol
 00B1 FC100E            ldd 0x100e
 00B4 FD101A            std 0x101a
 00B7           ;       TCTL1 = 0x00;
 00B7 7F1020            clr 0x1020
 00BA           ;       TFLG1 = 0x60;
 00BA C660              ldab #96
 00BC F71023            stab 0x1023
 00BF           ;       TMSK1 = 0x60;
 00BF C660              ldab #96
 00C1 F71022            stab 0x1022
 00C4           ;       INTR_ON();
 00C4 0E                                cli
 00C5           
 00C5           ; }
 00C5           L19:
 00C5                   .dbline 0 ; func end
 00C5 39                rts
 00C6           _rtoc2::
 00C6           ; 
 00C6           ; void rtoc2(void)
 00C6           ; /* Interrupt Service Routine for OC2 PWM */
 00C6           ; {  
 00C6           ; 	if ((PORTA & 0X40) == 0){ 
 00C6 18CE1000          ldy #0x1000
 00CA 181F004002        brclr 0,y,#64,X1
 00CF 2013              bra L21
 00D1           X1:
 00D1           ; 		TOC2 = TOC2 + OC2lo;
 00D1           	; vol
 00D1 FC1018            ldd 0x1018
 00D4 F30004            addd _OC2lo
 00D7 FD1018            std 0x1018
 00DA           ;               PORTA = PORTA | 0x40;
 00DA 18CE1000          ldy #0x1000
 00DE 181C0040          bset 0,y,#64
 00E2           ;               }
 00E2 2009              bra L22
 00E4           L21:
 00E4           ; 	else
 00E4           ; 		TOC2 = TOC2 + OC2hi;
 00E4           	; vol
 00E4 FC1018            ldd 0x1018
 00E7 F30006            addd _OC2hi
 00EA FD1018            std 0x1018
 00ED           L22:
 00ED           ; 		PORTA = PORTA |  0xBF;
 00ED 18CE1000          ldy #0x1000
 00F1 181C00BF          bset 0,y,#191
 00F5           ;       
 00F5           ;       TFLG1 = 0x40;   /* Clear flag OC2F */
 00F5 C640              ldab #64
 00F7 F71023            stab 0x1023
 00FA           ;       asm("   rti");  /* This is an interrupt service routine */
 00FA 3B                                rti
 00FB           
 00FB           ; }
 00FB           L20:
 00FB                   .dbline 0 ; func end
 00FB 39                rts
 00FC           _rtoc3::
 00FC           ; 
 00FC           ; void rtoc3(void)
 00FC           ; {	
 00FC           ; 	if ((PORTA & 0X20) == 0) {
 00FC 18CE1000          ldy #0x1000
 0100 181F002002        brclr 0,y,#32,X2
 0105 2013              bra L24
 0107           X2:
 0107           ; 		TOC3 = TOC3 + OC3lo;
 0107           	; vol
 0107 FC101A            ldd 0x101a
 010A F30000            addd _OC3lo
 010D FD101A            std 0x101a
 0110           ;               PORTA = PORTA | 0x20;
 0110 18CE1000          ldy #0x1000
 0114 181C0020          bset 0,y,#32
 0118           ;       }       
 0118 2009              bra L25
 011A           L24:
 011A           ; 	else
 011A           ; 		TOC3 = TOC3 + OC3hi;
 011A           	; vol
 011A FC101A            ldd 0x101a
 011D F30002            addd _OC3hi
 0120 FD101A            std 0x101a
 0123           L25:
 0123           ; 		PORTA = PORTA | 0xDF;
 0123 18CE1000          ldy #0x1000
 0127 181C00DF          bset 0,y,#223
 012B           ;       
 012B           ;       TFLG1 = 0x20;   /* Clear flag OC2F */
 012B C620              ldab #32
 012D F71023            stab 0x1023
 0130           ;       asm("   rti");  /* This is an interrupt service routine */
 0130 3B                                rti
 0131           
 0131           ; }
 0131           L23:
 0131                   .dbline 0 ; func end
 0131 39                rts
 0132           ;  lreg1 -> -4,x
 0132           ;  lreg2 -> -8,x
 0132           ;  IX -> 0,x
 0132           ;          ?temp -> +2,x
 0132           ;          ?temp -> +6,x
 0132           _cnts2::
 0132 BD0000            jsr __enterb
 0135 88                .byte 0x88
 0136           ; void cnts2 (void)
 0136           ; {
 0136           ;       OC2hi=T_counts * (float)per_on2/100;
 0136 FC0002            ldd _per_on2
 0139 04                lsrd
 013A BD0000            jsr __d2lreg
 013D BD0000            jsr __long2fp
 0140 BD0000            jsr __fpmov
 0143 18CE072C          ldy #L30
 0147 BD0000            jsr __tofp1
 014A BD0000            jsr __fpmul
 014D FC0002            ldd _per_on2
 0150 8400              anda #0
 0152 C401              andb #1
 0154 BD0000            jsr __d2lreg
 0157 BD0000            jsr __pshfp1 ; spill
 015A BD0000            jsr __long2fp
 015D BD0000            jsr __fpmov
 0160 BD0000            jsr __pulfp1 ; reload
 0163 BD0000            jsr __fpadd
 0166 BD0000            jsr __fpmov
 0169 FC0000            ldd _T_counts
 016C 04                lsrd
 016D BD0000            jsr __d2lreg
 0170 BD0000            jsr __long2fp
 0173 BD0000            jsr __pshfp2 ; spill
 0176 BD0000            jsr __fpmov
 0179 18CE072C          ldy #L30
 017D BD0000            jsr __tofp1
 0180 BD0000            jsr __fpmul
 0183 FC0000            ldd _T_counts
 0186 8400              anda #0
 0188 C401              andb #1
 018A BD0000            jsr __d2lreg
 018D BD0000            jsr __pshfp1 ; spill
 0190 BD0000            jsr __long2fp
 0193 BD0000            jsr __fpmov
 0196 BD0000            jsr __pulfp1 ; reload
 0199 BD0000            jsr __fpadd
 019C BD0000            jsr __pulfp2 ; reload
 019F BD0000            jsr __fpmul
 01A2 18CE0728          ldy #L31
 01A6 BD0000            jsr __tofp2
 01A9 BD0000            jsr __fpdiv
 01AC EC00              ldd 0,x
 01AE C30002            addd #2
 01B1 188F              xgdy
 01B3 BD0000            jsr __fromfp1
 01B6 EC00              ldd 0,x
 01B8 C30002            addd #2
 01BB 188F              xgdy
 01BD BD0000            jsr __tofp1
 01C0 18CE0724          ldy #L32
 01C4 BD0000            jsr __tofp2
 01C7 BD0000            jsr __fpcmp
 01CA 2D1E              blt L28
 01CC EC00              ldd 0,x
 01CE C30002            addd #2
 01D1 188F              xgdy
 01D3 BD0000            jsr __tofp1
 01D6 18CE0724          ldy #L32
 01DA BD0000            jsr __tofp2
 01DD BD0000            jsr __fpsub
 01E0 BD0000            jsr __fp2int
 01E3 C38000            addd #0x8000
 01E6 ED06              std 6,x
 01E8 200F              bra L29
 01EA           L28:
 01EA EC00              ldd 0,x
 01EC C30002            addd #2
 01EF 188F              xgdy
 01F1 BD0000            jsr __tofp1
 01F4 BD0000            jsr __fp2int
 01F7 ED06              std 6,x
 01F9           L29:
 01F9 EC06              ldd 6,x
 01FB FD0006            std _OC2hi
 01FE           ;       OC2lo=T_counts - OC2hi;
 01FE FC0000            ldd _T_counts
 0201 B30006            subd _OC2hi
 0204 FD0004            std _OC2lo
 0207           ; }
 0207           L26:
 0207 8F                xgdx
 0208 C30008            addd #8
 020B 8F                xgdx
 020C 35                txs
 020D 38                pulx
 020E                   .dbline 0 ; func end
 020E 39                rts
 020F           ;  lreg1 -> -4,x
 020F           ;  lreg2 -> -8,x
 020F           ;  IX -> 0,x
 020F           ;          ?temp -> +2,x
 020F           ;          ?temp -> +6,x
 020F           _cnts3::
 020F BD0000            jsr __enterb
 0212 88                .byte 0x88
 0213           ; 
 0213           ; void cnts3 (void)
 0213           ; {
 0213           ;       OC3hi=T_counts * (float)per_on3/100;
 0213 FC0004            ldd _per_on3
 0216 04                lsrd
 0217 BD0000            jsr __d2lreg
 021A BD0000            jsr __long2fp
 021D BD0000            jsr __fpmov
 0220 18CE072C          ldy #L30
 0224 BD0000            jsr __tofp1
 0227 BD0000            jsr __fpmul
 022A FC0004            ldd _per_on3
 022D 8400              anda #0
 022F C401              andb #1
 0231 BD0000            jsr __d2lreg
 0234 BD0000            jsr __pshfp1 ; spill
 0237 BD0000            jsr __long2fp
 023A BD0000            jsr __fpmov
 023D BD0000            jsr __pulfp1 ; reload
 0240 BD0000            jsr __fpadd
 0243 BD0000            jsr __fpmov
 0246 FC0000            ldd _T_counts
 0249 04                lsrd
 024A BD0000            jsr __d2lreg
 024D BD0000            jsr __long2fp
 0250 BD0000            jsr __pshfp2 ; spill
 0253 BD0000            jsr __fpmov
 0256 18CE072C          ldy #L30
 025A BD0000            jsr __tofp1
 025D BD0000            jsr __fpmul
 0260 FC0000            ldd _T_counts
 0263 8400              anda #0
 0265 C401              andb #1
 0267 BD0000            jsr __d2lreg
 026A BD0000            jsr __pshfp1 ; spill
 026D BD0000            jsr __long2fp
 0270 BD0000            jsr __fpmov
 0273 BD0000            jsr __pulfp1 ; reload
 0276 BD0000            jsr __fpadd
 0279 BD0000            jsr __pulfp2 ; reload
 027C BD0000            jsr __fpmul
 027F 18CE0728          ldy #L31
 0283 BD0000            jsr __tofp2
 0286 BD0000            jsr __fpdiv
 0289 EC00              ldd 0,x
 028B C30002            addd #2
 028E 188F              xgdy
 0290 BD0000            jsr __fromfp1
 0293 EC00              ldd 0,x
 0295 C30002            addd #2
 0298 188F              xgdy
 029A BD0000            jsr __tofp1
 029D 18CE0724          ldy #L32
 02A1 BD0000            jsr __tofp2
 02A4 BD0000            jsr __fpcmp
 02A7 2D1E              blt L35
 02A9 EC00              ldd 0,x
 02AB C30002            addd #2
 02AE 188F              xgdy
 02B0 BD0000            jsr __tofp1
 02B3 18CE0724          ldy #L32
 02B7 BD0000            jsr __tofp2
 02BA BD0000            jsr __fpsub
 02BD BD0000            jsr __fp2int
 02C0 C38000            addd #0x8000
 02C3 ED06              std 6,x
 02C5 200F              bra L36
 02C7           L35:
 02C7 EC00              ldd 0,x
 02C9 C30002            addd #2
 02CC 188F              xgdy
 02CE BD0000            jsr __tofp1
 02D1 BD0000            jsr __fp2int
 02D4 ED06              std 6,x
 02D6           L36:
 02D6 EC06              ldd 6,x
 02D8 FD0002            std _OC3hi
 02DB           ;       OC3lo=T_counts - OC3hi;
 02DB FC0000            ldd _T_counts
 02DE B30002            subd _OC3hi
 02E1 FD0000            std _OC3lo
 02E4           ; }     
 02E4           L33:
 02E4 8F                xgdx
 02E5 C30008            addd #8
 02E8 8F                xgdx
 02E9 35                txs
 02EA 38                pulx
 02EB                   .dbline 0 ; func end
 02EB 39                rts
 02EC           _RTIINTR::
 02EC           ; 
 02EC           ; void RTIINTR (void)
 02EC           ; {
 02EC           ;   TFLG2 = 0x40;
 02EC C640              ldab #64
 02EE F71025            stab 0x1025
 02F1           ;   
 02F1           ;   cntflag ++;
 02F1 FC0006            ldd _cntflag
 02F4 C30001            addd #1
 02F7 FD0006            std _cntflag
 02FA           ;   
 02FA           ;   asm("         rti");
 02FA 3B                                  rti
 02FB           
 02FB           ; }
 02FB           L37:
 02FB                   .dbline 0 ; func end
 02FB 39                rts
 02FC           L39:
 02FC 54686520456E642000        .byte 'T,'h,'e,32,'E,'n,'d,32,0
 0305           L40:
 0305 4475636B2020202000        .byte 'D,'u,'c,'k,32,32,32,32,0
 030E           L41:
 030E 446565722020202000        .byte 'D,'e,'e,'r,32,32,32,32,0
 0317           L42:
 0317 526162626974202000        .byte 'R,'a,'b,'b,'i,'t,32,32,0
 0320           L43:
 0320 446F6E652020202000        .byte 'D,'o,'n,'e,32,32,32,32,0
 0329           L44:
 0329 53746F702020202000        .byte 'S,'t,'o,'p,32,32,32,32,0
 0332           L45:
 0332 476F20202020202000        .byte 'G,'o,32,32,32,32,32,32,0
 033B           L46:
 033B 494545452055534D00        .byte 'I,'E,'E,'E,32,'U,'S,'M,0
 0344           L47:
 0344 202020202020202000        .byte 32,32,32,32,32,32,32,32,0
 034D           L48:
 034D 4E6F6E652020202000        .byte 'N,'o,'n,'e,32,32,32,32,0
 0356           L49:
 0356 B5B7              .word 46519
 0358 B5B6              .word 46518
 035A B5B5              .word 46517
 035C B5B4              .word 46516
 035E B5BF              .word 46527
 0360 B5BE              .word 46526
 0362 B5BD              .word 46525
 0364 B5BC              .word 46524
 0366           ;  IX -> 0,x
 0366           ;  rMEM -> 2,x
 0366           ;        nothing -> +5,x
 0366           ;           wait -> +14,x
 0366           ;        string9 -> +16,x
 0366           ;        string8 -> +25,x
 0366           ;        string7 -> +34,x
 0366           ;        string6 -> +43,x
 0366           ;        string5 -> +52,x
 0366           ;        string4 -> +61,x
 0366           ;        string3 -> +70,x
 0366           ;        string2 -> +79,x
 0366           ;        string1 -> +88,x
 0366           ;          digit -> +97,x
 0366           ;          ascii -> +113,x
 0366           ;             ad -> +114,x
 0366           ;            old -> +116,x
 0366           ;            cnt -> +118,x
 0366           ;           FRED -> +122,x
 0366           _display::
 0366 BD0000            jsr __enter
 0369 4078              .word 0x4078
 036B           ; void display (FRED)
 036B           ; {      
 036B           ;        unsigned int ad;
 036B           ;        unsigned char ascii;
 036B           ;        int cnt,old=0,wait=0;
 036B CC0000            ldd #0
 036E ED74              std 116,x
 0370 CC0000            ldd #0
 0373 ED0E              std 14,x
 0375           ;        unsigned char string1[]="The End ";
 0375 EC00              ldd 0,x
 0377 C30058            addd #88
 037A 18CE02FC          ldy #L39
 037E 3C                pshx
 037F 8F                xgdx
 0380 CC0009            ldd #9
 0383 BD0000            jsr __asgnblk
 0386 38                pulx
 0387           ;        unsigned char string2[]="Duck    ";
 0387 EC00              ldd 0,x
 0389 C3004F            addd #79
 038C 18CE0305          ldy #L40
 0390 3C                pshx
 0391 8F                xgdx
 0392 CC0009            ldd #9
 0395 BD0000            jsr __asgnblk
 0398 38                pulx
 0399           ;        unsigned char string3[]="Deer    ";
 0399 EC00              ldd 0,x
 039B C30046            addd #70
 039E 18CE030E          ldy #L41
 03A2 3C                pshx
 03A3 8F                xgdx
 03A4 CC0009            ldd #9
 03A7 BD0000            jsr __asgnblk
 03AA 38                pulx
 03AB           ;        unsigned char string4[]="Rabbit  ";
 03AB EC00              ldd 0,x
 03AD C3003D            addd #61
 03B0 18CE0317          ldy #L42
 03B4 3C                pshx
 03B5 8F                xgdx
 03B6 CC0009            ldd #9
 03B9 BD0000            jsr __asgnblk
 03BC 38                pulx
 03BD           ;        unsigned char string5[]="Done    ";
 03BD EC00              ldd 0,x
 03BF C30034            addd #52
 03C2 18CE0320          ldy #L43
 03C6 3C                pshx
 03C7 8F                xgdx
 03C8 CC0009            ldd #9
 03CB BD0000            jsr __asgnblk
 03CE 38                pulx
 03CF           ;        unsigned char string6[]="Stop    ";
 03CF EC00              ldd 0,x
 03D1 C3002B            addd #43
 03D4 18CE0329          ldy #L44
 03D8 3C                pshx
 03D9 8F                xgdx
 03DA CC0009            ldd #9
 03DD BD0000            jsr __asgnblk
 03E0 38                pulx
 03E1           ;        unsigned char string7[]="Go      ";
 03E1 EC00              ldd 0,x
 03E3 C30022            addd #34
 03E6 18CE0332          ldy #L45
 03EA 3C                pshx
 03EB 8F                xgdx
 03EC CC0009            ldd #9
 03EF BD0000            jsr __asgnblk
 03F2 38                pulx
 03F3           ;        unsigned char string8[]="IEEE USM";
 03F3 EC00              ldd 0,x
 03F5 C30019            addd #25
 03F8 18CE033B          ldy #L46
 03FC 3C                pshx
 03FD 8F                xgdx
 03FE CC0009            ldd #9
 0401 BD0000            jsr __asgnblk
 0404 38                pulx
 0405           ;        unsigned char string9[]="        ";
 0405 EC00              ldd 0,x
 0407 C30010            addd #16
 040A 18CE0344          ldy #L47
 040E 3C                pshx
 040F 8F                xgdx
 0410 CC0009            ldd #9
 0413 BD0000            jsr __asgnblk
 0416 38                pulx
 0417           ;        unsigned char nothing[]="None    ";
 0417 EC00              ldd 0,x
 0419 C30005            addd #5
 041C 18CE034D          ldy #L48
 0420 3C                pshx
 0421 8F                xgdx
 0422 CC0009            ldd #9
 0425 BD0000            jsr __asgnblk
 0428 38                pulx
 0429           ;        unsigned int digit[8] = {0xb5B7, 0xb5B6, 0xb5B5, 0xb5B4,0xb5Bf, 0xb5Be, 0xb5Bd,
 0429 EC00              ldd 0,x
 042B C30061            addd #97
 042E 18CE0356          ldy #L49
 0432 3C                pshx
 0433 8F                xgdx
 0434 CC0010            ldd #16
 0437 BD0000            jsr __asgnblk
 043A 38                pulx
 043B           ;                                                          0xb5Bc};                              
 043B           ;  
 043B           ;        asm (" ldaa #$00");
 043B 8600                       ldaa #$00
 043D           
 043D           ;        asm (" staa $b590");
 043D B7B590                     staa $b590
 0440           
 0440 2007              bra L51
 0442           L50:
 0442 EC74              ldd 116,x
 0444 C30001            addd #1
 0447 ED74              std 116,x
 0449           L51:
 0449           ; 	 while (old <= 100){old ++;}
 0449 EC74              ldd 116,x
 044B 1A830064          cpd #100
 044F 2FF1              ble L50
 0451           ;        asm (" ldaa #$03");
 0451 8603                       ldaa #$03
 0453           
 0453           ;        asm (" staa $b5B0");
 0453 B7B5B0                     staa $b5B0
 0456           
 0456           ;        asm (" staa $b5B8");
 0456 B7B5B8                     staa $b5B8
 0459           
 0459           ;        
 0459           ;        
 0459           ;       
 0459           ;        if (FRED == 1){
 0459 EC7A              ldd 122,x
 045B 1A830001          cpd #1
 045F 2703              beq X3
 0461 7E04A8            jmp L53
 0464           X3:
 0464           ; 	 	for(cnt=0; cnt<8; cnt++)
 0464 CC0000            ldd #0
 0467 ED76              std 118,x
 0469           L55:
 0469 EC00              ldd 0,x
 046B C30058            addd #88
 046E ED02              std 2,x
 0470 EC76              ldd 118,x
 0472 E302              addd 2,x
 0474 188F              xgdy
 0476 18E600            ldab 0,y
 0479 E771              stab 113,x
 047B EC00              ldd 0,x
 047D C30061            addd #97
 0480 ED02              std 2,x
 0482 EC76              ldd 118,x
 0484 05                lsld
 0485 E302              addd 2,x
 0487 188F              xgdy
 0489 18EC00            ldd 0,y
 048C ED72              std 114,x
 048E A671                       ldaa 113,x
 0490           
 0490 1AEE72                     ldy 114,x
 0493           
 0493 18A700                     staa 0,y
 0496           
 0496           L56:
 0496 EC76              ldd 118,x
 0498 C30001            addd #1
 049B ED76              std 118,x
 049D EC76              ldd 118,x
 049F 1A830008          cpd #8
 04A3 2DC4              blt L55
 04A5           ;               {
 04A5           ;                ascii=string1[cnt];
 04A5           ;                ad=digit[cnt];
 04A5           ;                asm (" ldaa %ascii");
 04A5           ;                asm (" ldy %ad");
 04A5           ;                asm (" staa 0,y");
 04A5           ;                }
 04A5           ;        }
 04A5 7E071A            jmp L54
 04A8           L53:
 04A8           ; 	 else if (FRED == 2){
 04A8 EC7A              ldd 122,x
 04AA 1A830002          cpd #2
 04AE 2703              beq X4
 04B0 7E04F7            jmp L59
 04B3           X4:
 04B3           ; 	 	for(cnt=0; cnt<8; cnt++)
 04B3 CC0000            ldd #0
 04B6 ED76              std 118,x
 04B8           L61:
 04B8 EC00              ldd 0,x
 04BA C3004F            addd #79
 04BD ED02              std 2,x
 04BF EC76              ldd 118,x
 04C1 E302              addd 2,x
 04C3 188F              xgdy
 04C5 18E600            ldab 0,y
 04C8 E771              stab 113,x
 04CA EC00              ldd 0,x
 04CC C30061            addd #97
 04CF ED02              std 2,x
 04D1 EC76              ldd 118,x
 04D3 05                lsld
 04D4 E302              addd 2,x
 04D6 188F              xgdy
 04D8 18EC00            ldd 0,y
 04DB ED72              std 114,x
 04DD A671                       ldaa 113,x
 04DF           
 04DF 1AEE72                     ldy 114,x
 04E2           
 04E2 18A700                     staa 0,y
 04E5           
 04E5           L62:
 04E5 EC76              ldd 118,x
 04E7 C30001            addd #1
 04EA ED76              std 118,x
 04EC EC76              ldd 118,x
 04EE 1A830008          cpd #8
 04F2 2DC4              blt L61
 04F4           ;               {
 04F4           ;                ascii=string2[cnt];
 04F4           ;                ad=digit[cnt];
 04F4           ;                asm (" ldaa %ascii");
 04F4           ;                asm (" ldy %ad");
 04F4           ;                asm (" staa 0,y");
 04F4           ;                }
 04F4           ;        }  
 04F4 7E071A            jmp L60
 04F7           L59:
 04F7           ; 	 else if (FRED == 3){
 04F7 EC7A              ldd 122,x
 04F9 1A830003          cpd #3
 04FD 2703              beq X5
 04FF 7E0546            jmp L65
 0502           X5:
 0502           ; 	 	for(cnt=0; cnt<8; cnt++)
 0502 CC0000            ldd #0
 0505 ED76              std 118,x
 0507           L67:
 0507 EC00              ldd 0,x
 0509 C30046            addd #70
 050C ED02              std 2,x
 050E EC76              ldd 118,x
 0510 E302              addd 2,x
 0512 188F              xgdy
 0514 18E600            ldab 0,y
 0517 E771              stab 113,x
 0519 EC00              ldd 0,x
 051B C30061            addd #97
 051E ED02              std 2,x
 0520 EC76              ldd 118,x
 0522 05                lsld
 0523 E302              addd 2,x
 0525 188F              xgdy
 0527 18EC00            ldd 0,y
 052A ED72              std 114,x
 052C A671                       ldaa 113,x
 052E           
 052E 1AEE72                     ldy 114,x
 0531           
 0531 18A700                     staa 0,y
 0534           
 0534           L68:
 0534 EC76              ldd 118,x
 0536 C30001            addd #1
 0539 ED76              std 118,x
 053B EC76              ldd 118,x
 053D 1A830008          cpd #8
 0541 2DC4              blt L67
 0543           ;               {
 0543           ;                ascii=string3[cnt];
 0543           ;                ad=digit[cnt];
 0543           ;                asm (" ldaa %ascii");
 0543           ;                asm (" ldy %ad");
 0543           ;                asm (" staa 0,y");
 0543           ;                }
 0543           ;        }
 0543 7E071A            jmp L66
 0546           L65:
 0546           ; 	 else if (FRED == 4){
 0546 EC7A              ldd 122,x
 0548 1A830004          cpd #4
 054C 2703              beq X6
 054E 7E0595            jmp L71
 0551           X6:
 0551           ; 	    for(cnt=0; cnt<8; cnt++)
 0551 CC0000            ldd #0
 0554 ED76              std 118,x
 0556           L73:
 0556 EC00              ldd 0,x
 0558 C3003D            addd #61
 055B ED02              std 2,x
 055D EC76              ldd 118,x
 055F E302              addd 2,x
 0561 188F              xgdy
 0563 18E600            ldab 0,y
 0566 E771              stab 113,x
 0568 EC00              ldd 0,x
 056A C30061            addd #97
 056D ED02              std 2,x
 056F EC76              ldd 118,x
 0571 05                lsld
 0572 E302              addd 2,x
 0574 188F              xgdy
 0576 18EC00            ldd 0,y
 0579 ED72              std 114,x
 057B A671                       ldaa 113,x
 057D           
 057D 1AEE72                     ldy 114,x
 0580           
 0580 18A700                     staa 0,y
 0583           
 0583           L74:
 0583 EC76              ldd 118,x
 0585 C30001            addd #1
 0588 ED76              std 118,x
 058A EC76              ldd 118,x
 058C 1A830008          cpd #8
 0590 2DC4              blt L73
 0592           ;               {
 0592           ;                ascii=string4[cnt];
 0592           ;                ad=digit[cnt];
 0592           ;                asm (" ldaa %ascii");
 0592           ;                asm (" ldy %ad");
 0592           ;                asm (" staa 0,y");
 0592           ;                }
 0592           ;        }
 0592 7E071A            jmp L72
 0595           L71:
 0595           ; 	 else if (FRED == 5){
 0595 EC7A              ldd 122,x
 0597 1A830005          cpd #5
 059B 2703              beq X7
 059D 7E05E4            jmp L77
 05A0           X7:
 05A0           ; 	 	for(cnt=0; cnt<8; cnt++)
 05A0 CC0000            ldd #0
 05A3 ED76              std 118,x
 05A5           L79:
 05A5 EC00              ldd 0,x
 05A7 C30034            addd #52
 05AA ED02              std 2,x
 05AC EC76              ldd 118,x
 05AE E302              addd 2,x
 05B0 188F              xgdy
 05B2 18E600            ldab 0,y
 05B5 E771              stab 113,x
 05B7 EC00              ldd 0,x
 05B9 C30061            addd #97
 05BC ED02              std 2,x
 05BE EC76              ldd 118,x
 05C0 05                lsld
 05C1 E302              addd 2,x
 05C3 188F              xgdy
 05C5 18EC00            ldd 0,y
 05C8 ED72              std 114,x
 05CA A671                       ldaa 113,x
 05CC           
 05CC 1AEE72                     ldy 114,x
 05CF           
 05CF 18A700                     staa 0,y
 05D2           
 05D2           L80:
 05D2 EC76              ldd 118,x
 05D4 C30001            addd #1
 05D7 ED76              std 118,x
 05D9 EC76              ldd 118,x
 05DB 1A830008          cpd #8
 05DF 2DC4              blt L79
 05E1           ;               {
 05E1           ;                ascii=string5[cnt];
 05E1           ;                ad=digit[cnt];
 05E1           ;                asm (" ldaa %ascii");
 05E1           ;                asm (" ldy %ad");
 05E1           ;                asm (" staa 0,y");
 05E1           ;                }
 05E1           ;        }
 05E1 7E071A            jmp L78
 05E4           L77:
 05E4           ; 	 else if (FRED == 6){
 05E4 EC7A              ldd 122,x
 05E6 1A830006          cpd #6
 05EA 2703              beq X8
 05EC 7E0633            jmp L83
 05EF           X8:
 05EF           ; 	    for(cnt=0; cnt<8; cnt++)
 05EF CC0000            ldd #0
 05F2 ED76              std 118,x
 05F4           L85:
 05F4 EC00              ldd 0,x
 05F6 C3002B            addd #43
 05F9 ED02              std 2,x
 05FB EC76              ldd 118,x
 05FD E302              addd 2,x
 05FF 188F              xgdy
 0601 18E600            ldab 0,y
 0604 E771              stab 113,x
 0606 EC00              ldd 0,x
 0608 C30061            addd #97
 060B ED02              std 2,x
 060D EC76              ldd 118,x
 060F 05                lsld
 0610 E302              addd 2,x
 0612 188F              xgdy
 0614 18EC00            ldd 0,y
 0617 ED72              std 114,x
 0619 A671                       ldaa 113,x
 061B           
 061B 1AEE72                     ldy 114,x
 061E           
 061E 18A700                     staa 0,y
 0621           
 0621           L86:
 0621 EC76              ldd 118,x
 0623 C30001            addd #1
 0626 ED76              std 118,x
 0628 EC76              ldd 118,x
 062A 1A830008          cpd #8
 062E 2DC4              blt L85
 0630           ;               {
 0630           ;                ascii=string6[cnt];
 0630           ;                ad=digit[cnt];
 0630           ;                asm (" ldaa %ascii");
 0630           ;                asm (" ldy %ad");
 0630           ;                asm (" staa 0,y");
 0630           ;                }
 0630           ;        }
 0630 7E071A            jmp L84
 0633           L83:
 0633           ; 	 else if (FRED == 7){
 0633 EC7A              ldd 122,x
 0635 1A830007          cpd #7
 0639 2703              beq X9
 063B 7E0682            jmp L89
 063E           X9:
 063E           ; 	 	for(cnt=0; cnt<8; cnt++)
 063E CC0000            ldd #0
 0641 ED76              std 118,x
 0643           L91:
 0643 EC00              ldd 0,x
 0645 C30022            addd #34
 0648 ED02              std 2,x
 064A EC76              ldd 118,x
 064C E302              addd 2,x
 064E 188F              xgdy
 0650 18E600            ldab 0,y
 0653 E771              stab 113,x
 0655 EC00              ldd 0,x
 0657 C30061            addd #97
 065A ED02              std 2,x
 065C EC76              ldd 118,x
 065E 05                lsld
 065F E302              addd 2,x
 0661 188F              xgdy
 0663 18EC00            ldd 0,y
 0666 ED72              std 114,x
 0668 A671                       ldaa 113,x
 066A           
 066A 1AEE72                     ldy 114,x
 066D           
 066D 18A700                     staa 0,y
 0670           
 0670           L92:
 0670 EC76              ldd 118,x
 0672 C30001            addd #1
 0675 ED76              std 118,x
 0677 EC76              ldd 118,x
 0679 1A830008          cpd #8
 067D 2DC4              blt L91
 067F           ;               {
 067F           ;                ascii=string7[cnt];
 067F           ;                ad=digit[cnt];
 067F           ;                asm (" ldaa %ascii");
 067F           ;                asm (" ldy %ad");
 067F           ;                asm (" staa 0,y");
 067F           ;                }
 067F           ;        }
 067F 7E071A            jmp L90
 0682           L89:
 0682           ; 	 else if (FRED == 9){
 0682 EC7A              ldd 122,x
 0684 1A830009          cpd #9
 0688 2703              beq X10
 068A 7E06D1            jmp L95
 068D           X10:
 068D           ; 	 	for(cnt=0; cnt<8; cnt++)
 068D CC0000            ldd #0
 0690 ED76              std 118,x
 0692           L97:
 0692 EC00              ldd 0,x
 0694 C30019            addd #25
 0697 ED02              std 2,x
 0699 EC76              ldd 118,x
 069B E302              addd 2,x
 069D 188F              xgdy
 069F 18E600            ldab 0,y
 06A2 E771              stab 113,x
 06A4 EC00              ldd 0,x
 06A6 C30061            addd #97
 06A9 ED02              std 2,x
 06AB EC76              ldd 118,x
 06AD 05                lsld
 06AE E302              addd 2,x
 06B0 188F              xgdy
 06B2 18EC00            ldd 0,y
 06B5 ED72              std 114,x
 06B7 A671                       ldaa 113,x
 06B9           
 06B9 1AEE72                     ldy 114,x
 06BC           
 06BC 18A700                     staa 0,y
 06BF           
 06BF           L98:
 06BF EC76              ldd 118,x
 06C1 C30001            addd #1
 06C4 ED76              std 118,x
 06C6 EC76              ldd 118,x
 06C8 1A830008          cpd #8
 06CC 2DC4              blt L97
 06CE           ;               {
 06CE           ;                ascii=string8[cnt];
 06CE           ;                ad=digit[cnt];
 06CE           ;                asm (" ldaa %ascii");
 06CE           ;                asm (" ldy %ad");
 06CE           ;                asm (" staa 0,y");
 06CE           ;                }
 06CE           ;        }
 06CE 7E071A            jmp L96
 06D1           L95:
 06D1           ; 	  else if (FRED == 8){
 06D1 EC7A              ldd 122,x
 06D3 1A830008          cpd #8
 06D7 2641              bne L101
 06D9           ;               for(cnt=0; cnt<8; cnt++)
 06D9 CC0000            ldd #0
 06DC ED76              std 118,x
 06DE           L103:
 06DE EC00              ldd 0,x
 06E0 C30010            addd #16
 06E3 ED02              std 2,x
 06E5 EC76              ldd 118,x
 06E7 E302              addd 2,x
 06E9 188F              xgdy
 06EB 18E600            ldab 0,y
 06EE E771              stab 113,x
 06F0 EC00              ldd 0,x
 06F2 C30061            addd #97
 06F5 ED02              std 2,x
 06F7 EC76              ldd 118,x
 06F9 05                lsld
 06FA E302              addd 2,x
 06FC 188F              xgdy
 06FE 18EC00            ldd 0,y
 0701 ED72              std 114,x
 0703 A671                       ldaa 113,x
 0705           
 0705 1AEE72                     ldy 114,x
 0708           
 0708 18A700                     staa 0,y
 070B           
 070B           L104:
 070B EC76              ldd 118,x
 070D C30001            addd #1
 0710 ED76              std 118,x
 0712 EC76              ldd 118,x
 0714 1A830008          cpd #8
 0718 2DC4              blt L103
 071A           ;               {
 071A           ;                ascii=string9[cnt];
 071A           ;                ad=digit[cnt];
 071A           ;                asm (" ldaa %ascii");
 071A           ;                asm (" ldy %ad");
 071A           ;                asm (" staa 0,y");
 071A           ;                }
 071A           ;        }
 071A           L101:
 071A           L96:
 071A           L90:
 071A           L84:
 071A           L78:
 071A           L72:
 071A           L66:
 071A           L60:
 071A           L54:
 071A           ; 	 /*else{
 071A           ; 	    for(cnt=0; cnt<8; cnt++)
 071A           ; 	 	{
 071A           ; 	 	 ascii=nothing[cnt];
 071A           ; 	 	 ad=digit[cnt];
 071A           ; 	 	 asm (" ldaa %ascii");
 071A           ; 	 	 asm (" ldy %ad");
 071A           ; 	 	 asm (" staa 0,y");
 071A           ; 	 	 }
 071A           ; 	 } */ 
 071A           ; 	 	 
 071A           ; 	 
 071A           ; }
 071A           L38:
 071A 8F                xgdx
 071B C30078            addd #120
 071E 8F                xgdx
 071F 35                txs
 0720 38                pulx
 0721 1838              puly
 0723                   .dbline 0 ; func end
 0723 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
 0724           L32:
 0724 47000000          .word 0x4700,0x0
 0728           L31:
 0728 42C80000          .word 0x42c8,0x0
 072C           L30:
 072C 40000000          .word 0x4000,0x0
