                        .module filtertest.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 0046              .word 70
                        .area data
 0004           _per_on3::
 0004                   .blkb 2
                        .area idata
 0004 0046              .word 70
                        .area data
 0006           _cntflag::
 0006                   .blkb 2
                        .area idata
 0006 0000              .word 0
                        .area data
                        .area text
 0000           L4:
 0000 0000              .word 0
 0002 003C              .word 60
 0004 004B              .word 75
 0006 003C              .word 60
 0008           L5:
 0008 0000              .word 0
 000A 004B              .word 75
 000C 003C              .word 60
 000E 003C              .word 60
 0010           L6:
 0010 0000              .word 0
 0012 000000000000      .byte 0,0,0,0,0,0
 0018           L7:
 0018 0000              .word 0
 001A 000000000000      .byte 0,0,0,0,0,0
 0020           ;  lreg1 -> -4,x
 0020           ;  lreg2 -> -8,x
 0020           ;  IX -> 0,x
 0020           ;  rMEM -> 2,x
 0020           ;          ?temp -> +4,x
 0020           ;          ?temp -> +6,x
 0020           ;     anglethree -> +8,x
 0020           ;       angletwo -> +16,x
 0020           ;          waste -> +24,x
 0020           ;          temp2 -> +26,x
 0020           ;          three -> +28,x
 0020           ;            two -> +36,x
 0020           ;         filter -> +44,x
 0020           ;          temp1 -> +46,x
 0020           _main::
 0020 BD0000            jsr __enterb
 0023 B0                .byte 0xb0
 0024           ; /* C Listing 11.4 */
 0024           ; 
 0024           ; #include <hc11.h>     /* Include register definitions */
 0024           ; #include <stdio.h>
 0024           ; #define motcont *(unsigned char volatile *)(0xB590)
 0024           ; #define linetrack *(unsigned char volatile *) (0XB5A0)
 0024           ; 
 0024           ; 
 0024           ; /* Declarations */
 0024           ; unsigned int OC2hi, OC2lo, OC3hi, OC3lo;      /* Duty cycle data */
 0024           ; unsigned int T_counts=0x4e20; 
 0024           ; int per_on2=70, per_on3=70, 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 RTIINTR (void);
 0024           ; 
 0024           ; 
 0024           ; void main(void)
 0024           ; {
 0024           ;       int waste=0, temp1=0, temp2=0, filter=0;
 0024 CC0000            ldd #0
 0027 ED18              std 24,x
 0029 CC0000            ldd #0
 002C ED2E              std 46,x
 002E CC0000            ldd #0
 0031 ED1A              std 26,x
 0033 CC0000            ldd #0
 0036 ED2C              std 44,x
 0038           ;       //             0  1 2  3  
 0038           ;       int two[4]=  {0,60,75,60};
 0038 EC00              ldd 0,x
 003A C30024            addd #36
 003D 18CE0000          ldy #L4
 0041 3C                pshx
 0042 8F                xgdx
 0043 CC0008            ldd #8
 0046 BD0000            jsr __asgnblk
 0049 38                pulx
 004A           ;       int three[4]={0,75,60,60};
 004A EC00              ldd 0,x
 004C C3001C            addd #28
 004F 18CE0008          ldy #L5
 0053 3C                pshx
 0054 8F                xgdx
 0055 CC0008            ldd #8
 0058 BD0000            jsr __asgnblk
 005B 38                pulx
 005C           ;       //                  0, 1, 2, 3
 005C           ;       int     angletwo[4]  ={00,};
 005C EC00              ldd 0,x
 005E C30010            addd #16
 0061 18CE0010          ldy #L6
 0065 3C                pshx
 0066 8F                xgdx
 0067 CC0008            ldd #8
 006A BD0000            jsr __asgnblk
 006D 38                pulx
 006E           ;       int anglethree[4]={00,};
 006E EC00              ldd 0,x
 0070 C30008            addd #8
 0073 18CE0018          ldy #L7
 0077 3C                pshx
 0078 8F                xgdx
 0079 CC0008            ldd #8
 007C BD0000            jsr __asgnblk
 007F 38                pulx
 0080           ;       
 0080           ;       setbaud(BAUD9600);
 0080 CC0030            ldd #48
 0083 BD0000            jsr _setbaud
 0086           ;       INTR_OFF();
 0086 0F                                sei
 0087           
 0087           ;       /* set up jump vector for buffalo */
 0087           ;       asm("   ldaa #$7e");
 0087 867E                              ldaa #$7e
 0089           
 0089           ;       asm("   staa $dc");
 0089 97DC                              staa $dc
 008B           
 008B           ;       asm("   staa $eb");
 008B 97EB                              staa $eb
 008D           
 008D           ;       asm("   staa $d9");
 008D 97D9                              staa $d9
 008F           
 008F           ;       asm("   ldd #_rtoc2");
 008F CC0220                            ldd #_rtoc2
 0092           
 0092           ;       asm("   std $dd");
 0092 DDDD                              std $dd
 0094           
 0094           ;       asm("   ldd #_rtoc3");
 0094 CC0256                            ldd #_rtoc3
 0097           
 0097           ;       asm("   std $da");
 0097 DDDA                              std $da
 0099           
 0099           ;       asm("   ldd #_RTIINTR");
 0099 CC03F8                            ldd #_RTIINTR
 009C           
 009C           ;       asm("   std $ec");
 009C DDEC                              std $ec
 009E           
 009E           ;       TMSK2=0x40;
 009E C640              ldab #64
 00A0 F71024            stab 0x1024
 00A3           ;       PACTL=PACTL & 0xFC;
 00A3 18CE1026          ldy #0x1026
 00A7 181D0003          bclr 0,y,#0x3
 00AB           ;       PACTL=PACTL | 0x00;
 00AB                   ; vol
 00AB F61026            ldab 0x1026
 00AE F71026            stab 0x1026
 00B1           ;       
 00B1           ;       motcont =0x03;
 00B1 C603              ldab #3
 00B3 F7B590            stab 0xb590
 00B6           ;       cnts2();
 00B6 BD028C            jsr _cnts2
 00B9           ;       cnts3();
 00B9 BD0342            jsr _cnts3
 00BC           ;       
 00BC           ;       initoc();
 00BC BD0205            jsr _initoc
 00BF           ;       
 00BF           ;       
 00BF           ;       
 00BF           ;       cntflag = 0;
 00BF CC0000            ldd #0
 00C2 FD0006            std _cntflag
 00C5 7E01FB            jmp L9
 00C8           X0:
 00C8           ; 	
 00C8           ; 	
 00C8           ; 	while(1)
 00C8           ; 	{	 
 00C8           L11:
 00C8           ; 		 
 00C8           ; 		 while (cntflag == 1)
 00C8           ; 		 {
 00C8           ; 		 
 00C8           ; 		 temp2 = linetrack & 0x0C;	
 00C8           	; vol
 00C8 F6B5A0            ldab 0xb5a0
 00CB 4F                clra
 00CC 8400              anda #0
 00CE C40C              andb #12
 00D0 ED1A              std 26,x
 00D2           ;                temp1 = linetrack & 0x03;
 00D2                   ; vol
 00D2 F6B5A0            ldab 0xb5a0
 00D5 4F                clra
 00D6 8400              anda #0
 00D8 C403              andb #3
 00DA ED2E              std 46,x
 00DC           ;                
 00DC           ;                motcont =0x03;  
 00DC C603              ldab #3
 00DE F7B590            stab 0xb590
 00E1           ;                
 00E1           ;                if (temp1 == 0x00){
 00E1 EC2E              ldd 46,x
 00E3 2606              bne L14
 00E5           ;                       TMSK1=0x00;
 00E5 7F1022            clr 0x1022
 00E8           ;                       PORTA=0x00;
 00E8 7F1000            clr 0x1000
 00EB           ;                }
 00EB           L14:
 00EB           ; 		 
 00EB           ; 		 if ((two[temp1] || three[temp1]) != 0){   
 00EB EC2E              ldd 46,x
 00ED 05                lsld
 00EE ED04              std 4,x
 00F0 EC00              ldd 0,x
 00F2 C30024            addd #36
 00F5 ED02              std 2,x
 00F7 EC04              ldd 4,x
 00F9 E302              addd 2,x
 00FB 188F              xgdy
 00FD 18EC00            ldd 0,y
 0100 2612              bne L21
 0102 EC00              ldd 0,x
 0104 C3001C            addd #28
 0107 ED02              std 2,x
 0109 EC04              ldd 4,x
 010B E302              addd 2,x
 010D 188F              xgdy
 010F 18EC00            ldd 0,y
 0112 2707              beq L19
 0114           L21:
 0114 CC0001            ldd #1
 0117 ED06              std 6,x
 0119 2005              bra L20
 011B           L19:
 011B CC0000            ldd #0
 011E ED06              std 6,x
 0120           L20:
 0120 EC06              ldd 6,x
 0122 2603              bne X2
 0124 7E01D7            jmp L16
 0127           X2:
 0127           ; 		 	TMSK1=0x60;	
 0127 C660              ldab #96
 0129 F71022            stab 0x1022
 012C           ;                       
 012C           ;                       if ( per_on2 == per_on3 ){
 012C FC0002            ldd _per_on2
 012F 1AB30004          cpd _per_on3
 0133 2607              bne L22
 0135           ;                                filter = 100;
 0135 CC0064            ldd #100
 0138 ED2C              std 44,x
 013A           ;                          }
 013A 2005              bra L23
 013C           L22:
 013C           ; 			else {
 013C           ; 				 filter = 50;
 013C CC0032            ldd #50
 013F ED2C              std 44,x
 0141           ;                          }
 0141           L23:
 0141           ; 			   	
 0141           ; 		  	per_on2 = per_on2 + ((two[temp1] - per_on2)* ((float)filter/100));
 0141 EC2C              ldd 44,x
 0143 BD0000            jsr __d2lreg
 0146 BD0000            jsr __long2fp
 0149 18CE0410          ldy #L24
 014D BD0000            jsr __tofp2
 0150 BD0000            jsr __fpdiv
 0153 BD0000            jsr __fpmov
 0156 EC00              ldd 0,x
 0158 C30024            addd #36
 015B ED02              std 2,x
 015D EC2E              ldd 46,x
 015F 05                lsld
 0160 E302              addd 2,x
 0162 188F              xgdy
 0164 18EC00            ldd 0,y
 0167 B30002            subd _per_on2
 016A BD0000            jsr __d2lreg
 016D BD0000            jsr __long2fp
 0170 BD0000            jsr __fpmul
 0173 BD0000            jsr __fpmov
 0176 FC0002            ldd _per_on2
 0179 BD0000            jsr __d2lreg
 017C BD0000            jsr __long2fp
 017F BD0000            jsr __fpadd
 0182 BD0000            jsr __fp2int
 0185 FD0002            std _per_on2
 0188           ;                       cnts2();
 0188 BD028C            jsr _cnts2
 018B           ;                       per_on3 = per_on3 + ((three[temp1] - per_on3)* ((float)filter/100));
 018B EC2C              ldd 44,x
 018D BD0000            jsr __d2lreg
 0190 BD0000            jsr __long2fp
 0193 18CE0410          ldy #L24
 0197 BD0000            jsr __tofp2
 019A BD0000            jsr __fpdiv
 019D BD0000            jsr __fpmov
 01A0 EC00              ldd 0,x
 01A2 C3001C            addd #28
 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 B30004            subd _per_on3
 01B4 BD0000            jsr __d2lreg
 01B7 BD0000            jsr __long2fp
 01BA BD0000            jsr __fpmul
 01BD BD0000            jsr __fpmov
 01C0 FC0004            ldd _per_on3
 01C3 BD0000            jsr __d2lreg
 01C6 BD0000            jsr __long2fp
 01C9 BD0000            jsr __fpadd
 01CC BD0000            jsr __fp2int
 01CF FD0004            std _per_on3
 01D2           ;                       cnts3();
 01D2 BD0342            jsr _cnts3
 01D5           ;                       
 01D5           ;                       //printf("%d %d %d\n", per_on2, per_on3, filter);
 01D5           ;            
 01D5           ;                }
 01D5 2012              bra L17
 01D7           L16:
 01D7           ; 		  else {
 01D7           ; 		 
 01D7           ; 		  per_on2 = 70;
 01D7 CC0046            ldd #70
 01DA FD0002            std _per_on2
 01DD           ;                 per_on3 = 70;
 01DD CC0046            ldd #70
 01E0 FD0004            std _per_on3
 01E3           ;                 cnts2();
 01E3 BD028C            jsr _cnts2
 01E6           ;                 cnts3();
 01E6 BD0342            jsr _cnts3
 01E9           ;                 }
 01E9           L17:
 01E9 CC0000            ldd #0
 01EC FD0006            std _cntflag
 01EF           L12:
 01EF FC0006            ldd _cntflag
 01F2 1A830001          cpd #1
 01F6 2603              bne X3
 01F8 7E00C8            jmp L11
 01FB           X3:
 01FB           L9:
 01FB 20F2              bra L12
 01FD           X1:
 01FD           ; 		
 01FD           ; 	     cntflag = 0;
 01FD           ; 		 }
 01FD           ; 		 /*else { 
 01FD           ; 		 	  
 01FD           ; 			TMSK1=0x00;
 01FD           ; 			PORTA=0x00;
 01FD           ; 				 
 01FD           ; 		 	}*/ 
 01FD           ;     }
 01FD           ; 
 01FD           ; 	
 01FD           ; }
 01FD           L3:
 01FD 8F                xgdx
 01FE C30030            addd #48
 0201 8F                xgdx
 0202 35                txs
 0203 38                pulx
 0204                   .dbline 0 ; func end
 0204 39                rts
 0205           _initoc::
 0205           ; 
 0205           ; void initoc(void)
 0205           ; /* Initialize OC2 */
 0205           ; {
 0205           ; 	TOC2 = TCNT;
 0205           	; vol
 0205 FC100E            ldd 0x100e
 0208 FD1018            std 0x1018
 020B           ;       TOC3 = TCNT;
 020B                   ; vol
 020B FC100E            ldd 0x100e
 020E FD101A            std 0x101a
 0211           ;       TCTL1 = 0x00;
 0211 7F1020            clr 0x1020
 0214           ;       TFLG1 = 0x60;
 0214 C660              ldab #96
 0216 F71023            stab 0x1023
 0219           ;       TMSK1 = 0x60;
 0219 C660              ldab #96
 021B F71022            stab 0x1022
 021E           ;       INTR_ON();
 021E 0E                                cli
 021F           
 021F           ; }
 021F           L25:
 021F                   .dbline 0 ; func end
 021F 39                rts
 0220           _rtoc2::
 0220           ; 
 0220           ; void rtoc2(void)
 0220           ; /* Interrupt Service Routine for OC2 PWM */
 0220           ; {   
 0220           ; 	if ((PORTA & 0X40) == 0){ 
 0220 18CE1000          ldy #0x1000
 0224 181F004002        brclr 0,y,#64,X4
 0229 2013              bra L27
 022B           X4:
 022B           ; 		TOC2 = TOC2 + OC2hi;
 022B           	; vol
 022B FC1018            ldd 0x1018
 022E F30006            addd _OC2hi
 0231 FD1018            std 0x1018
 0234           ;               PORTA = PORTA | 0x40;
 0234 18CE1000          ldy #0x1000
 0238 181C0040          bset 0,y,#64
 023C           ;               }
 023C 2011              bra L28
 023E           L27:
 023E           ; 	else{
 023E           ; 		TOC2 = TOC2 + OC2lo;
 023E           	; vol
 023E FC1018            ldd 0x1018
 0241 F30004            addd _OC2lo
 0244 FD1018            std 0x1018
 0247           ;               PORTA = PORTA & 0xBF;
 0247 18CE1000          ldy #0x1000
 024B 181D0040          bclr 0,y,#0x40
 024F           ;               }
 024F           L28:
 024F           ; 	//TCTL1 = TCTL1 ^ 0x40;	/* invert OL2 to toggle next OC2 edge */
 024F           ; 	TFLG1 = 0x40;	/* Clear flag OC2F */
 024F C640              ldab #64
 0251 F71023            stab 0x1023
 0254           ;       asm("   rti");  /* This is an interrupt service routine */
 0254 3B                                rti
 0255           
 0255           ; }
 0255           L26:
 0255                   .dbline 0 ; func end
 0255 39                rts
 0256           _rtoc3::
 0256           ; 
 0256           ; void rtoc3(void)
 0256           ; {	
 0256           ; 	if ((PORTA & 0X20) == 0) {
 0256 18CE1000          ldy #0x1000
 025A 181F002002        brclr 0,y,#32,X5
 025F 2013              bra L30
 0261           X5:
 0261           ; 		TOC3 = TOC3 + OC3hi;
 0261           	; vol
 0261 FC101A            ldd 0x101a
 0264 F30002            addd _OC3hi
 0267 FD101A            std 0x101a
 026A           ;               PORTA = PORTA | 0x20;
 026A 18CE1000          ldy #0x1000
 026E 181C0020          bset 0,y,#32
 0272           ;       }       
 0272 2011              bra L31
 0274           L30:
 0274           ; 	else{
 0274           ; 		TOC3 = TOC3 + OC3lo;
 0274           	; vol
 0274 FC101A            ldd 0x101a
 0277 F30000            addd _OC3lo
 027A FD101A            std 0x101a
 027D           ;               PORTA = PORTA & 0xDF;
 027D 18CE1000          ldy #0x1000
 0281 181D0020          bclr 0,y,#0x20
 0285           ;       }
 0285           L31:
 0285           ; 	//TCTL1 = TCTL1 ^ 0x10;	/* invert OL2 to toggle next OC2 edge */
 0285           ; 	TFLG1 = 0x20;	/* Clear flag OC2F */
 0285 C620              ldab #32
 0287 F71023            stab 0x1023
 028A           ;       asm("   rti");  /* This is an interrupt service routine */
 028A 3B                                rti
 028B           
 028B           ; }
 028B           L29:
 028B                   .dbline 0 ; func end
 028B 39                rts
 028C           ;  lreg1 -> -4,x
 028C           ;  lreg2 -> -8,x
 028C           ;  IX -> 0,x
 028C           ;          ?temp -> +2,x
 028C           ;          ?temp -> +6,x
 028C           _cnts2::
 028C BD0000            jsr __enterb
 028F 88                .byte 0x88
 0290           ; void cnts2 (void)
 0290           ; {
 0290           ;       OC2hi=T_counts * (float)per_on2/100;
 0290 FC0000            ldd _T_counts
 0293 04                lsrd
 0294 BD0000            jsr __d2lreg
 0297 BD0000            jsr __long2fp
 029A BD0000            jsr __fpmov
 029D 18CE040C          ldy #L36
 02A1 BD0000            jsr __tofp1
 02A4 BD0000            jsr __fpmul
 02A7 FC0000            ldd _T_counts
 02AA 8400              anda #0
 02AC C401              andb #1
 02AE BD0000            jsr __d2lreg
 02B1 BD0000            jsr __pshfp1 ; spill
 02B4 BD0000            jsr __long2fp
 02B7 BD0000            jsr __fpmov
 02BA BD0000            jsr __pulfp1 ; reload
 02BD BD0000            jsr __fpadd
 02C0 FC0002            ldd _per_on2
 02C3 BD0000            jsr __d2lreg
 02C6 BD0000            jsr __pshfp1 ; spill
 02C9 BD0000            jsr __long2fp
 02CC BD0000            jsr __fpmov
 02CF BD0000            jsr __pulfp1 ; reload
 02D2 BD0000            jsr __fpmul
 02D5 18CE0410          ldy #L24
 02D9 BD0000            jsr __tofp2
 02DC BD0000            jsr __fpdiv
 02DF EC00              ldd 0,x
 02E1 C30002            addd #2
 02E4 188F              xgdy
 02E6 BD0000            jsr __fromfp1
 02E9 EC00              ldd 0,x
 02EB C30002            addd #2
 02EE 188F              xgdy
 02F0 BD0000            jsr __tofp1
 02F3 18CE0408          ldy #L37
 02F7 BD0000            jsr __tofp2
 02FA BD0000            jsr __fpcmp
 02FD 2D1E              blt L34
 02FF EC00              ldd 0,x
 0301 C30002            addd #2
 0304 188F              xgdy
 0306 BD0000            jsr __tofp1
 0309 18CE0408          ldy #L37
 030D BD0000            jsr __tofp2
 0310 BD0000            jsr __fpsub
 0313 BD0000            jsr __fp2int
 0316 C38000            addd #0x8000
 0319 ED06              std 6,x
 031B 200F              bra L35
 031D           L34:
 031D EC00              ldd 0,x
 031F C30002            addd #2
 0322 188F              xgdy
 0324 BD0000            jsr __tofp1
 0327 BD0000            jsr __fp2int
 032A ED06              std 6,x
 032C           L35:
 032C EC06              ldd 6,x
 032E FD0006            std _OC2hi
 0331           ;       OC2lo=T_counts - OC2hi;
 0331 FC0000            ldd _T_counts
 0334 B30006            subd _OC2hi
 0337 FD0004            std _OC2lo
 033A           ; }
 033A           L32:
 033A 8F                xgdx
 033B C30008            addd #8
 033E 8F                xgdx
 033F 35                txs
 0340 38                pulx
 0341                   .dbline 0 ; func end
 0341 39                rts
 0342           ;  lreg1 -> -4,x
 0342           ;  lreg2 -> -8,x
 0342           ;  IX -> 0,x
 0342           ;          ?temp -> +2,x
 0342           ;          ?temp -> +6,x
 0342           _cnts3::
 0342 BD0000            jsr __enterb
 0345 88                .byte 0x88
 0346           ; 
 0346           ; void cnts3 (void)
 0346           ; {
 0346           ;       OC3hi=T_counts * (float)per_on3/100;
 0346 FC0000            ldd _T_counts
 0349 04                lsrd
 034A BD0000            jsr __d2lreg
 034D BD0000            jsr __long2fp
 0350 BD0000            jsr __fpmov
 0353 18CE040C          ldy #L36
 0357 BD0000            jsr __tofp1
 035A BD0000            jsr __fpmul
 035D FC0000            ldd _T_counts
 0360 8400              anda #0
 0362 C401              andb #1
 0364 BD0000            jsr __d2lreg
 0367 BD0000            jsr __pshfp1 ; spill
 036A BD0000            jsr __long2fp
 036D BD0000            jsr __fpmov
 0370 BD0000            jsr __pulfp1 ; reload
 0373 BD0000            jsr __fpadd
 0376 FC0004            ldd _per_on3
 0379 BD0000            jsr __d2lreg
 037C BD0000            jsr __pshfp1 ; spill
 037F BD0000            jsr __long2fp
 0382 BD0000            jsr __fpmov
 0385 BD0000            jsr __pulfp1 ; reload
 0388 BD0000            jsr __fpmul
 038B 18CE0410          ldy #L24
 038F BD0000            jsr __tofp2
 0392 BD0000            jsr __fpdiv
 0395 EC00              ldd 0,x
 0397 C30002            addd #2
 039A 188F              xgdy
 039C BD0000            jsr __fromfp1
 039F EC00              ldd 0,x
 03A1 C30002            addd #2
 03A4 188F              xgdy
 03A6 BD0000            jsr __tofp1
 03A9 18CE0408          ldy #L37
 03AD BD0000            jsr __tofp2
 03B0 BD0000            jsr __fpcmp
 03B3 2D1E              blt L40
 03B5 EC00              ldd 0,x
 03B7 C30002            addd #2
 03BA 188F              xgdy
 03BC BD0000            jsr __tofp1
 03BF 18CE0408          ldy #L37
 03C3 BD0000            jsr __tofp2
 03C6 BD0000            jsr __fpsub
 03C9 BD0000            jsr __fp2int
 03CC C38000            addd #0x8000
 03CF ED06              std 6,x
 03D1 200F              bra L41
 03D3           L40:
 03D3 EC00              ldd 0,x
 03D5 C30002            addd #2
 03D8 188F              xgdy
 03DA BD0000            jsr __tofp1
 03DD BD0000            jsr __fp2int
 03E0 ED06              std 6,x
 03E2           L41:
 03E2 EC06              ldd 6,x
 03E4 FD0002            std _OC3hi
 03E7           ;       OC3lo=T_counts - OC3hi;
 03E7 FC0000            ldd _T_counts
 03EA B30002            subd _OC3hi
 03ED FD0000            std _OC3lo
 03F0           ; }     
 03F0           L38:
 03F0 8F                xgdx
 03F1 C30008            addd #8
 03F4 8F                xgdx
 03F5 35                txs
 03F6 38                pulx
 03F7                   .dbline 0 ; func end
 03F7 39                rts
 03F8           _RTIINTR::
 03F8           ; 
 03F8           ; void RTIINTR (void)
 03F8           ; {
 03F8           ;   TFLG2 = 0x40;
 03F8 C640              ldab #64
 03FA F71025            stab 0x1025
 03FD           ;   
 03FD           ;   cntflag ++;
 03FD FC0006            ldd _cntflag
 0400 C30001            addd #1
 0403 FD0006            std _cntflag
 0406           ;   
 0406           ;   asm("         rti");
 0406 3B                                  rti
 0407           
 0407           ; }
 0407           L42:
 0407                   .dbline 0 ; func end
 0407 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
 0408           L37:
 0408 47000000          .word 0x4700,0x0
 040C           L36:
 040C 40000000          .word 0x4000,0x0
 0410           L24:
 0410 42C80000          .word 0x42c8,0x0
