TITLE "flute.asm: wind midi controller @8.0000MHz" LIST p=16F876A ERRORLEVEL 0, -302 ; The midi controller has 16 keys arranged for Boehm fingering ; and an air pressure sensor to generate midi note on messages. ; ; _______________________________________________________________________ ; | _ (L4) [R8] | ; | |_| (L1) (L2) (L3) (R1) (R2) (R3) [R7] | ; |___________[L5][L6]____________________________(R4)[R6]____| ; ; ; Some alternate fingerings are realized for basic trills. ; ; holes to note: 0=open, 1=closed, x=ignored ; ------------------------------------------ ; nr note freq cycl wind holes: left right ; ; DDCBBAGG FFEDDCCB ; # b # # # # ; ; 59 B 3 246 4049 lo 11111111 11111111 ; 60 C 4 261 3822 lo 11111111 11111110 ; 61 C# 4 277 3607 lo 11111111 1111110x ; 62 D 4 293 3405 lo 11111111 111110xx ; 63 D# 4 311 3214 lo 11111111 11110xxx ; 64 E 4 329 3033 lo 11111111 1110xxxx ; 65 F 4 349 2863 lo 11111111 110xxxxx ; 66 F# 4 369 2702 lo 11111111 10xxxxxx ; 67 G 4 391 2551 lo 11111111 0xxxxxxx ; 68 G# 4 415 2407 lo 11111110 xx0xxxxx ; 69 A 4 440 2272 lo 11111100 xx0xxxxx ; 70 Bb 4 466 2145 lo 111110x0 xx00xxxx ; 71 B 4 493 2024 lo 11110000 0000xxxx ; 72 C 5 523 1911 lo 1110x000 xx00xxxx ; 73 C# 5 554 1803 lo 11000000 0000xxxx ; 74 D 5 587 1702 lo 11011111 111110xx ; 74 D 5 587 1702 lo 10x00000 0000xxxx ; 75 D# 5 622 1607 lo 11011111 11110xxx ; 75 D# 5 622 1607 lo 01000000 0000xxxx ; 76 E 5 659 1516 hi 11x11111 1110xxxx ; 77 F 5 698 1431 hi 11111111 110xxxxx ; 78 F# 5 739 1351 hi 11111111 10xxxxxx ; 79 G 5 783 1275 hi 11111111 0xxxxxxx ; 80 G# 5 830 1203 hi 11111110 xx0xxxxx ; 81 A 5 880 1136 hi 11111100 xx0xxxxx ; 82 Bb 5 932 1072 hi 111110x0 xx00xxxx ; 83 B 5 987 1012 hi 11110000 0000xxxx ; 84 C 6 1046 955 hi 1110x000 xx00xxxx ; 85 C# 6 1108 901 hi 11000000 0000xxxx ; 86 D 6 1174 851 hi 11011111 0000xxxx ; 86 D 6 1174 851 hi 01100000 0000xxxx ; 86 D 6 1174 851 hi 10000000 0000xxxx ; 87 D# 6 1244 803 hi 11111110 11110xxx ; 87 D# 6 1244 803 hi 00000000 0000xxxx ; 87 D# 6 1244 803 hi 01011111 0000xxxx ; 88 E 6 1318 758 hi 11111100 111xxxxx ; 88 E 6 1318 758 hi 11011100 0000xxxx ; 88 E 6 1318 758 hi 01111100 0000xxxx ; 89 F 6 1396 715 hi 11111011 110xxxxx ; 89 F 6 1396 715 hi 11111000 111xxxxx ; 90 F# 6 1479 675 hi 11110011 100xxxxx ; 90 F# 6 1479 675 hi 11101100 111xxxxx ; 90 F# 6 1479 675 hi 01110000 0000xxxx ; 91 G 6 1567 637 hi 11101111 0000xxxx ; 91 G 6 1567 637 hi 11101011 110xxxxx ; 91 G 6 1567 637 hi 11100011 1001xxxx ; 91 G 6 1567 637 ff 11111111 0000xxxx ; 92 G# 6 1661 601 hi 11001110 0000xxxx ; 92 G# 6 1661 601 hi 11000011 100xxxxx ; 92 G# 6 1661 601 hi 11001111 0000xxxx ; 92 G# 6 1661 601 hi 10101111 0000xxxx ; 93 A 6 1760 568 hi 11011100 1100xxxx ; 93 A 6 1760 568 hi 10001111 0000xxxx ; 93 A 6 1760 568 hi 00101110 0000xxxx ; 93 A 6 1760 568 ff 11111100 0000xxxx ; 93 A 6 1760 568 ff 11111111 1101xxxx ; 94 Bb 6 1864 536 hi 1x011000 1100xxxx ; 94 Bb 6 1864 536 hi 10111011 1001xxxx ; 94 Bb 6 1864 536 hi 00001111 0000xxxx ; 94 Bb 6 1864 536 hi 00011100 1100xxxx ; 94 Bb 6 1864 536 hi 10011011 1100xxxx ; 94 Bb 6 1864 536 hi 01111011 10111110 ; 95 B 6 1975 506 hi 01110011 0000xxxx ; 95 B 6 1975 506 hi 10011011 0000xxxx ; 95 B 6 1975 506 hi 11110011 1001xxxx ; 96 C 7 2093 477 hi 11101110 1100xxxx ; 96 C 7 2093 477 hi 01100011 10111110 ; 96 C 7 2093 477 hi 01100011 0000xxxx ; 97 C# 7 2217 450 hi 11001100 110xxxxx ; 97 C# 7 2217 450 hi 11001011 1100xxxx ; 98 D 7 2349 425 hi 11011011 11101110 ; 98 D 7 2349 425 hi 11011000 10100xxx ; ; air pressure measurement: ; ; +-----+--------------------------------- VCC ; | | ; ...|.....|... +-----1M0----+ ; . 10k 10k . | |\ | ; pressure . +------------------+---|- \ | ; sensor . | | . | >---+------- WIND ; SCC05GD2 . | +------------+---|+ / ; . 10k 10k . | |/ amp=200 ; ...|.....|... R_offs MCP6022 ; | | | ; +-----+------------+-------------------- GND ; ; R_offs is about 1M Ohm to adjust WIND to ca. 1/3 VCC ; ; connector MCLR --- (1) (3) --- PGC/SND ; for MIDI VCC ----- (4) (5) ---- PGD/MIDI ; and ISP GND --------- (2) ; ; SND is connected through 2x470R resistors to a phono plug ; (or a small speaker) and through 4.7kOhm to PGC. ; MIDI is connected over a 330R resistor to PGD. ; ; When the supply voltage has bypass capacitors programming ; with the PicStart Plus programmer fails. With a 3 terminal ; connector the pressure sensor, opamp and bypass capacitor ; can be detached during programming. ; ; The 16 keys pull L1..L8 and R1..R8 to GND when pressed. ; L5, L6 and R1..R8 need external 10kOhm pullups to VCC. ; An 8MHz xtal and two 22pF caps are attached to XI and XO. ; ; ********** ********** ; * *** * ; MCLR MCLR ** 1 28 ** B7 PGD ; * * ; WIND A0 ** 2 27 ** B6 PGC ; * * ; R8 A1 ** 3 26 ** B5 L7 ; * * ; R7 A2 ** 4 25 ** B4 L8 ; * * ; R6 A3 ** 5 24 ** B3 L1 ; * * ; R5 A4 ** 6 23 ** B2 L2 ; * * ; L6 A5 ** 7 22 ** B1 L3 ; * * ; GND GND ** 8 21 ** B0 L4 ; * * ; XTAL XI ** 9 20 ** VCC +5V ; * * ; XTAL XO ** 10 19 ** GND GND ; * * ; R4 C0 ** 11 18 ** C7 GND ; * * ; R3 C1 ** 12 17 ** C6 MIDI ; * * ; R2 C2 ** 13 16 ** C5 L5 ; * * ; R1 C3 ** 14 15 ** C4 SND ; * PIC16F876A * ; *********************** __IDLOCS H'FFFF' __CONFIG H'3F72' ; PWRTE, LVP off, WDT off, HS osc INDF EQU 0 ; indirect file access TMR0 EQU 1 ; real time clock counter PCL EQU 2 ; program counter lsb STATUS EQU 3 ; program status FSR EQU 4 ; file selection register PORTA EQU 5 ; i/o port PORTB EQU 6 ; i/o port PORTC EQU 7 ; i/o port PCLATH EQU H'0A' ; program counter msb (CALL, GOTO > H'800') INTCON EQU H'0B' ; interrupt control PIR1 EQU H'0C' ; peripheral interrupt flags PIR2 EQU H'0D' ; peripheral interrupt flags TMR1L EQU H'0E' ; timer 1 lsb TMR1H EQU H'0F' ; timer 1 msb T1CON EQU H'10' ; timer 1 control TMR2 EQU H'11' ; timer 2 T2CON EQU H'12' ; timer 2 control SSPBUF EQU H'13' ; synchronous serial port rx/tx data SSPCON EQU H'14' ; synchronous serial port control CCPR1L EQU H'15' ; capture/compare/pwm lsb CCPR1H EQU H'16' ; capture/compare/pwm msb CCP1CON EQU H'17' ; capture/compare control RCSTA EQU H'18' ; USART receiver control and status TXREG EQU H'19' ; USART transmit data RCREG EQU H'1A' ; USART receive data CCPR2L EQU H'1B' ; capture/compare/pwm lsb CCPR2H EQU H'1C' ; capture/compare/pwm msb CCP2CON EQU H'1D' ; capture/compare control ADRESH EQU H'1E' ; A/D result high byte ADCON0 EQU H'1F' ; A/D control _OPTION EQU H'81' ; OPTION register in bank 1 _TRISA EQU H'85' ; tristate register in bank 1 _TRISB EQU H'86' ; tristate register in bank 1 _TRISC EQU H'87' ; tristate register in bank 1 _PIE1 EQU H'8C' ; peripheral interrupt enable _PIE2 EQU H'8D' ; peripheral interrupt enable _PCON EQU H'8E' ; power control/status _PR2 EQU H'92' ; timer 2 period _SSPADD EQU H'93' ; synchronous serial port I2C address _SSPSTA EQU H'94' ; synchronous serial port status _TXSTA EQU H'98' ; USART transmitter control and status _SPBRG EQU H'99' ; USART baud rate _ADRESL EQU H'9E' ; A/D result low byte _ADCON1 EQU H'9F' ; A/D control in bank 1 C EQU 0 ; carry DC EQU 1 ; digit carry Z EQU 2 ; zero PD EQU 3 ; power down TO EQU 4 ; watch dog time out RP0 EQU 5 ; register bank select RP1 EQU 6 ; register bank select IRP EQU 7 ; register bank select (indirect) SND EQU 4 ; sound output on PORTC ORG H'020' ; RAM savw RES 1 ; interrupt context save savs RES 1 ; interrupt context save savf RES 1 ; interrupt context save flgs RES 1 ; 0=event tmp0 RES 1 ; temporary data tmp1 RES 1 ; temporary data tmp2 RES 1 ; temporary data tmp3 RES 1 ; temporary data inhib RES 1 ; wind transition inhibit keyss RES 1 ; keys same state counter cnote RES 1 ; current note anote RES 1 ; active note cvolu RES 1 ; current volume avolu RES 1 ; active volume lastr RES 1 ; last key states lastl RES 1 ; last key states fingr RES 1 ; fingering and holes fingl RES 1 ; fingering and holes presl RES 1 ; current air pressure presh RES 1 ; current air pressure summl RES 1 ; idle pressure * 64 summh RES 1 ; idle pressure * 64 avrgl RES 1 ; average idle pressure avrgh RES 1 ; average idle pressure ORG H'0A0' ; RAM page 2 _savw RES 1 ; interrupt context save ORG H'000' ; reset GOTO main ORG H'004' ; interrupt intserv MOVWF savw ; save W SWAPF STATUS,W ; status to W BCF STATUS,RP0 ; set bank 0 MOVWF savs ; save STATUS MOVF FSR,W ; save FSR MOVWF savf ; BCF PIR1,0 ; clear TMR1IF MOVF avolu,W ; SND off if avolu == 0 BTFSC STATUS,Z ; GOTO intnof ; intset BCF T1CON,0 ; stop timer CLRF TMR1L ; load new timeout MOVF anote,W ; CALL tablo ; SUBWF TMR1L,F ; MOVF anote,W ; CALL tabhi ; SUBWF TMR1H,F ; MOVLW D'40' ; correction for timer setup ADDWF TMR1L,F ; BTFSS STATUS,C ; DECF TMR1H,F ; BSF T1CON,0 ; start timer inttog MOVLW 1 << SND ; toggle SND port XORWF PORTC,F ; GOTO intend ; intnof BCF PORTC,SND ; intend MOVF savf,W ; restore FSR MOVWF FSR ; SWAPF savs,W ; restore STATUS MOVWF STATUS ; SWAPF savw,F ; restore W SWAPF savw,W ; RETFIE ; ORG H'040' ; main MOVLW B'11111111' ; to PORTA MOVWF PORTA ; MOVLW B'11111111' ; to PORTB MOVWF PORTB ; MOVLW B'11101111' ; to PORTC (4=sound) MOVWF PORTC ; BSF STATUS,RP0 ; set bank 1 MOVLW B'01010111' ; pullup, int rising, rtc internal, rtc:256 MOVWF _OPTION ; MOVLW B'10001110' ; A0 analog, right justified MOVWF _ADCON1 ; MOVLW B'11111111' ; A inputs MOVWF _TRISA ; MOVLW B'11111111' ; B inputs MOVWF _TRISB ; MOVLW B'10101111' ; C4, C6 outputs MOVWF _TRISC ; BCF STATUS,RP0 ; set bank 0 MOVLW H'20' ; reset vars in bank 0 MOVWF FSR ; initvar CLRF INDF ; INCF FSR,F ; MOVLW H'80' ; XORWF FSR,W ; BTFSS STATUS,Z ; GOTO initvar ; MOVLW B'00000111' ; code H'000' rom tables H'700' MOVWF PCLATH ; MOVLW B'10000001' ; osz/32=4us, channel 0, power on MOVWF ADCON0 ; BSF STATUS,RP0 ; set bank 1 MOVLW D'3' ; baudrate = 8MHz / (64*(3+1)) = 31250 MOVWF _SPBRG ; BCF STATUS,RP0 ; set bank 0 CLRF TMR1L ; CLRF TMR1H ; MOVLW B'00000000' ; presc 1, osz off, sync, intrnl clk, on MOVWF T1CON ; BSF T1CON,0 ; start timer 1 BSF STATUS,RP0 ; set bank 1 BSF _PIE1,0 ; enable timer 1 interrupt BCF STATUS,RP0 ; set bank 0 MOVLW B'10000000' ; async port enable MOVWF RCSTA ; BSF STATUS,RP0 ; set bank 1 MOVLW B'00100010' ; enable transmitter MOVWF _TXSTA ; BCF STATUS,RP0 ; set bank 0 MOVLW B'11000000' ; enable global and peripheral interrupts MOVWF INTCON ; MOVLW D'69' ; A 440Hz MOVWF anote ; BSF avolu,0 ; beep hello MOVLW D'64' ; zero adjust air sensor MOVWF tmp2 ; airz BSF ADCON0,2 ; start ad conversion GOTO $+1 ; airw BTFSC ADCON0,2 ; wait for conversion complete GOTO airw ; BSF STATUS,RP0 ; set bank 1 MOVF _ADRESL,W ; read ad converter BCF STATUS,RP0 ; set bank 0 ADDWF summl,F BTFSC STATUS,C INCF summh,F MOVF ADRESH,W ; read ad converter ADDWF summh,F MOVLW D'10' CALL delay DECFSZ tmp2,F ; 16 samples added? GOTO airz MOVLW H'B0' ; all sounds off CALL txbyte MOVLW D'120' CALL txbyte MOVLW H'00' CALL txbyte CLRF avolu MOVLW H'C0' ; program change CALL txbyte MOVLW D'73' ; flute CALL txbyte loop CALL airck CALL keyck CALL sndck GOTO loop airck MOVLW D'16' ; oversampling (total ca. 1ms) MOVWF tmp2 CLRF presl CLRF presh airlp BSF ADCON0,2 ; start ad conversion GOTO $+1 ; airwt BTFSC ADCON0,2 ; wait for conversion complete GOTO airwt BSF STATUS,RP0 ; set bank 1 MOVF _ADRESL,W ; read ad converter BCF STATUS,RP0 ; set bank 0 ADDWF presl,F BTFSC STATUS,C INCF presh,F MOVF ADRESH,W ; read ad converter ADDWF presh,F MOVLW D'8' ; delay before next conversion MOVWF tmp0 airdly DECFSZ tmp0,F GOTO airdly DECFSZ tmp2,F ; 16 samples added? GOTO airlp BCF STATUS,C RLF presl,F ; * 2 RLF presh,F RLF presl,F ; * 4 RLF presh,F MOVF summl,W ; pres - summ = current SUBWF presl,F BTFSS STATUS,C DECF presh,F MOVF summh,W SUBWF presh,F BTFSS STATUS,C ; pressure neg? GOTO airoff MOVF presh,W ; pressure overflow? ANDLW H'C0' BTFSS STATUS,Z GOTO airovl RLF presl,F ; * 2 RLF presh,F RLF presl,F ; * 4 RLF presh,F MOVLW D'12' ; subtract minimum pressure SUBWF presh,F BTFSS STATUS,C GOTO airoff BTFSC STATUS,Z GOTO airoff MOVLW D'42' ; limit for high pressure SUBWF presh,W BTFSS STATUS,C GOTO airex ; low pressure MOVWF presh ; high pressure MOVLW D'10' ; emphasize high notes ADDWF presh,F ; and avoid zero value MOVLW D'127' ; truncate to upper limit BTFSC presh,7 MOVWF presh BSF presh,7 ; mark high pressure MOVLW D'20' ; set falling inhibit MOVWF inhib GOTO airhi ; skip inhibit airex MOVF inhib,F ; check inhib delay BTFSS STATUS,Z DECF inhib,F BTFSS STATUS,Z RETLW 0 ; no action if inhib airhi MOVF presh,W ; copy to cvolu MOVWF cvolu SUBWF avolu,W ; calculate volume change BTFSS STATUS,C ; positive difference XORLW H'FF' BTFSS STATUS,C ADDLW 1 SUBLW D'5' ; minimum change (=x+1) BTFSS STATUS,C BSF flgs,0 ; signal event if changed enough RETLW 0 airoff MOVLW D'20' ; set rising inhibit MOVWF inhib CLRF cvolu MOVF avolu,W ; if sound on: BTFSS STATUS,Z BSF flgs,0 ; signal event to turn sound off RETLW 0 airovl MOVLW D'255' ; overflow volume and high flag MOVWF cvolu INCF avolu,W ; if sound not at limit: BTFSS STATUS,Z BSF flgs,0 ; signal event for full volume RETLW 0 keyck RRF PORTA,W ; read keys to fingl:fingr ANDLW H'0F' MOVWF fingr SWAPF PORTC,W ANDLW H'F0' IORWF fingr,F SWAPF PORTB,W ANDLW H'F3' MOVWF fingl BTFSC PORTA,5 BSF fingl,2 BTFSC PORTC,5 BSF fingl,3 MOVLW H'FF' ; invert all bits XORWF fingr,F XORWF fingl,F MOVF lastr,W ; compare to last keystate XORWF fingr,W BTFSS STATUS,Z GOTO keychg MOVF lastl,W XORWF fingl,W BTFSS STATUS,Z GOTO keychg INCFSZ keyss,W ; same: increment counter INCF keyss,F XORLW D'8' ; accept at this count BTFSC STATUS,Z BSF flgs,0 ; signal event RETLW 0 keychg CLRF keyss MOVF fingr,W ; copy current to last MOVWF lastr MOVF fingl,W MOVWF lastl RETLW 0 sndck BTFSS flgs,0 ; event? RETLW 0 BCF flgs,0 CALL ckfing ; check if fingering is valid MOVWF cnote MOVF avolu,W ; no note on? BTFSC STATUS,Z GOTO isoff MOVF cnote,W ; valid note? BTFSC STATUS,Z GOTO noteoff MOVF cvolu,W ; no pressure? BTFSC STATUS,Z GOTO noteoff MOVF anote,W ; note changed? XORWF cnote,W BTFSC STATUS,Z GOTO presr ; no: change only pressure CALL noteoff ; yes: old note off GOTO noteon ; and new note on isoff MOVF cvolu,W ; air pressure on? BTFSC STATUS,Z RETURN MOVF cnote,W ; and valid fingering? BTFSC STATUS,Z RETURN noteon MOVLW H'90' ; send note on command CALL txbyte MOVF cnote,W MOVWF anote ; copy to active note CALL txbyte MOVLW H'40' ; default velocity CALL txbyte GOTO presr noteoff MOVLW H'90' ; turn note off CALL txbyte MOVF anote,W CALL txbyte MOVLW H'00' CALL txbyte CLRF avolu RETLW 0 ; amount of airflow is sent as channel pressure (aftertouch) and it's ; up to the sound module what to do with this. Another possibility - ; the repetition of note on commands for dynamic sound - did not work ; with my midi device since multiple note on with the same note number ; accumulated to a louder sound; and mono on (B07E00) did not help. ; Changing the channel volume (B007XX) caused clicks in the sound. presr MOVLW H'D0' ; channel pressure CALL txbyte MOVF cvolu,W ; volume for pressure MOVWF avolu ; copy to active volume ANDLW H'7F' CALL txbyte RETLW 0 delay MOVWF tmp1 ; delay W * ms dly1 MOVLW D'249' MOVWF tmp0 dly0 GOTO $+1 ; [2] GOTO $+1 ; [4] NOP ; [5] DECFSZ tmp0,F ; [6] GOTO dly0 ; [8] DECFSZ tmp1,F GOTO dly1 RETURN txbyte BSF STATUS,RP0 ; set bank 1 txbytw BTFSS _TXSTA,1 ; wait for transmitter empty GOTO txbytw ; BCF STATUS,RP0 ; set bank 0 MOVWF TXREG ; transmit RETURN ; ; check fingering and assing a note, start with key to hole conversion ckfing MOVLW B'11000000' ; ini 11000000 00001000 MOVWF fingl MOVLW B'00001000' MOVWF fingr BTFSC lastl,7 ; L1 ..1..... ........ BSF fingl,5 BTFSC lastl,6 ; L2 ....11.. ........ BSF fingl,3 BTFSC lastl,6 BSF fingl,2 BTFSC lastl,5 ; L3 ......11 ........ BSF fingl,1 BTFSC lastl,5 BSF fingl,0 BTFSC lastl,4 ; L4 .......0 ........ BCF fingl,0 BTFSC lastl,3 ; L5 ...11... ........ BSF fingl,4 BTFSC lastl,3 BSF fingl,3 BTFSC lastl,2 ; L6 ...1.... ........ BSF fingl,4 BTFSC lastl,1 ; L7 ....1... ........ BSF fingl,3 BTFSC lastl,0 ; L8 .0...... ........ BCF fingl,6 BTFSC lastr,7 ; R1 ....1... 11...... BSF fingl,3 BTFSC lastr,7 BSF fingr,7 BTFSC lastr,7 BSF fingr,6 BTFSC lastr,6 ; R2 ........ 1.1..... BSF fingr,7 BTFSC lastr,6 BSF fingr,5 BTFSC lastr,5 ; R3 ........ 1..1.... BSF fingr,7 BTFSC lastr,5 BSF fingr,4 BTFSC lastr,4 ; R4 ........ ....0... BCF fingr,3 BTFSC lastr,3 ; R5 0....... ........ BCF fingl,7 BTFSC lastr,2 ; R6 ........ .....1.. BSF fingr,2 BTFSC lastr,1 ; R7 ........ .....11. BSF fingr,2 BTFSC lastr,1 BSF fingr,1 BTFSC lastr,0 ; R8 ........ .....111 BSF fingr,2 BTFSC lastr,0 BSF fingr,1 BTFSC lastr,0 BSF fingr,0 BTFSS cvolu,7 ; high volume flag? GOTO ckflo MOVF cvolu,W ; forte? ADDLW D'10' BTFSS STATUS,C GOTO ckfhi MOVF fingl,W ; 91 G 6 ff 11111111 0000xxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'91' MOVF fingl,W ; 93 A 6 ff 11111100 0000xxxx XORLW B'11111100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'93' MOVF fingl,W ; 93 A 6 ff 11111111 1101xxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11010000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'93' ckfhi MOVF fingl,W ; 76 E 5 hi 11x11111 1110xxxx XORLW B'11111111' ANDLW B'11011111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11100000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'76' MOVF fingl,W ; 77 F 5 hi 11111111 110xxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'77' MOVF fingl,W ; 78 F# 5 hi 11111111 10xxxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10000000' ANDLW B'11000000' BTFSC STATUS,Z RETLW D'78' MOVF fingl,W ; 79 G 5 hi 11111111 0xxxxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'10000000' BTFSC STATUS,Z RETLW D'79' MOVF fingl,W ; 80 G# 5 hi 11111110 xx0xxxxx XORLW B'11111110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00100000' BTFSC STATUS,Z RETLW D'80' MOVF fingl,W ; 81 A 5 hi 11111100 xx0xxxxx XORLW B'11111100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00100000' BTFSC STATUS,Z RETLW D'81' MOVF fingl,W ; 82 Bb 5 hi 111110x0 xx00xxxx XORLW B'11111000' ANDLW B'11111101' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00110000' BTFSC STATUS,Z RETLW D'82' MOVF fingl,W ; 83 B 5 hi 11110000 0000xxxx XORLW B'11110000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'83' MOVF fingl,W ; 84 C 6 hi 1110x000 xx00xxxx XORLW B'11100000' ANDLW B'11110111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00110000' BTFSC STATUS,Z RETLW D'84' MOVF fingl,W ; 85 C# 6 hi 11000000 0000xxxx XORLW B'11000000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'85' MOVF fingl,W ; 86 D 6 hi 11011111 0000xxxx XORLW B'11011111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'86' MOVF fingl,W ; 86 D 6 hi 01100000 0000xxxx XORLW B'01100000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'86' MOVF fingl,W ; 86 D 6 hi 10000000 0000xxxx XORLW B'10000000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'86' MOVF fingl,W ; 87 D# 6 hi 11111110 11110xxx XORLW B'11111110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11110000' ANDLW B'11111000' BTFSC STATUS,Z RETLW D'87' MOVF fingl,W ; 87 D# 6 hi 00000000 0000xxxx XORLW B'00000000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'87' MOVF fingl,W ; 87 D# 6 hi 01011111 0000xxxx XORLW B'01011111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'87' MOVF fingl,W ; 88 E 6 hi 11111100 111xxxxx XORLW B'11111100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11100000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'88' MOVF fingl,W ; 88 E 6 hi 11011100 0000xxxx XORLW B'11011100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'88' MOVF fingl,W ; 88 E 6 hi 01111100 0000xxxx XORLW B'01111100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'88' MOVF fingl,W ; 89 F 6 hi 11111011 110xxxxx XORLW B'11111011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'89' MOVF fingl,W ; 89 F 6 hi 11111000 111xxxxx XORLW B'11111000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11100000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'89' MOVF fingl,W ; 90 F# 6 hi 11110011 100xxxxx XORLW B'11110011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'90' MOVF fingl,W ; 90 F# 6 hi 11101100 111xxxxx XORLW B'11101100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11100000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'90' MOVF fingl,W ; 90 F# 6 hi 01110000 0000xxxx XORLW B'01110000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'90' MOVF fingl,W ; 91 G 6 hi 11101111 0000xxxx XORLW B'11101111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'91' MOVF fingl,W ; 91 G 6 hi 11101011 110xxxxx XORLW B'11101011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'91' MOVF fingl,W ; 91 G 6 hi 11100011 1001xxxx XORLW B'11100011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10010000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'91' MOVF fingl,W ; 92 G# 6 hi 11001110 0000xxxx XORLW B'11001110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'92' MOVF fingl,W ; 92 G# 6 hi 11000011 100xxxxx XORLW B'11000011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'92' MOVF fingl,W ; 92 G# 6 hi 11001111 0000xxxx XORLW B'11001111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'92' MOVF fingl,W ; 92 G# 6 hi 10101111 0000xxxx XORLW B'10101111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'92' MOVF fingl,W ; 93 A 6 hi 11011100 1100xxxx XORLW B'11011100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'93' MOVF fingl,W ; 93 A 6 hi 10001111 0000xxxx XORLW B'10001111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'93' MOVF fingl,W ; 93 A 6 hi 00101110 0000xxxx XORLW B'00101110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'93' MOVF fingl,W ; 94 Bb 6 hi 1x011000 1100xxxx XORLW B'10011000' ANDLW B'10111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 94 Bb 6 hi 10111011 1001xxxx XORLW B'10111011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10010000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 94 Bb 6 hi 00001111 0000xxxx XORLW B'00001111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 94 Bb 6 hi 00011100 1100xxxx XORLW B'00011100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 94 Bb 6 hi 10011011 1100xxxx XORLW B'10011011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 94 Bb 6 hi 01111011 10111110 XORLW B'01111011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10111110' ANDLW B'11111111' BTFSC STATUS,Z RETLW D'94' MOVF fingl,W ; 95 B 6 hi 01110011 0000xxxx XORLW B'01110011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'95' MOVF fingl,W ; 95 B 6 hi 10011011 0000xxxx XORLW B'10011011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'95' MOVF fingl,W ; 95 B 6 hi 11110011 1001xxxx XORLW B'11110011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10010000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'95' MOVF fingl,W ; 96 C 7 hi 11101110 1100xxxx XORLW B'11101110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'96' MOVF fingl,W ; 96 C 7 hi 01100011 10111110 XORLW B'01100011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10111110' ANDLW B'11111111' BTFSC STATUS,Z RETLW D'96' MOVF fingl,W ; 96 C 7 hi 01100011 0000xxxx XORLW B'01100011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'96' MOVF fingl,W ; 97 C# 7 hi 11001100 110xxxxx XORLW B'11001100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'97' MOVF fingl,W ; 97 C# 7 hi 11001011 1100xxxx XORLW B'11001011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'97' MOVF fingl,W ; 98 D 7 hi 11011011 11101110 XORLW B'11011011' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11101110' ANDLW B'11111111' BTFSC STATUS,Z RETLW D'98' MOVF fingl,W ; 98 D 7 hi 11011000 10100xxx XORLW B'11011000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10100000' ANDLW B'11111000' BTFSC STATUS,Z RETLW D'98' ckflo MOVF fingl,W ; 59 B 3 lo 11111111 11111111 XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11111111' ANDLW B'11111111' BTFSC STATUS,Z RETLW D'59' MOVF fingl,W ; 60 C 4 lo 11111111 11111110 XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11111110' ANDLW B'11111111' BTFSC STATUS,Z RETLW D'60' MOVF fingl,W ; 61 C# 4 lo 11111111 1111110x XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11111100' ANDLW B'11111110' BTFSC STATUS,Z RETLW D'61' MOVF fingl,W ; 62 D 4 lo 11111111 111110xx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11111000' ANDLW B'11111100' BTFSC STATUS,Z RETLW D'62' MOVF fingl,W ; 63 D# 4 lo 11111111 11110xxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11110000' ANDLW B'11111000' BTFSC STATUS,Z RETLW D'63' MOVF fingl,W ; 64 E 4 lo 11111111 1110xxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11100000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'64' MOVF fingl,W ; 65 F 4 lo 11111111 110xxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11000000' ANDLW B'11100000' BTFSC STATUS,Z RETLW D'65' MOVF fingl,W ; 66 F# 4 lo 11111111 10xxxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'10000000' ANDLW B'11000000' BTFSC STATUS,Z RETLW D'66' MOVF fingl,W ; 67 G 4 lo 11111111 0xxxxxxx XORLW B'11111111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'10000000' BTFSC STATUS,Z RETLW D'67' MOVF fingl,W ; 68 G# 4 lo 11111110 xx0xxxxx XORLW B'11111110' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00100000' BTFSC STATUS,Z RETLW D'68' MOVF fingl,W ; 69 A 4 lo 11111100 xx0xxxxx XORLW B'11111100' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00100000' BTFSC STATUS,Z RETLW D'69' MOVF fingl,W ; 70 Bb 4 lo 111110x0 xx00xxxx XORLW B'11111000' ANDLW B'11111101' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00110000' BTFSC STATUS,Z RETLW D'70' MOVF fingl,W ; 71 B 4 lo 11110000 0000xxxx XORLW B'11110000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'71' MOVF fingl,W ; 72 C 5 lo 1110x000 xx00xxxx XORLW B'11100000' ANDLW B'11110111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'00110000' BTFSC STATUS,Z RETLW D'72' MOVF fingl,W ; 73 C# 5 lo 11000000 0000xxxx XORLW B'11000000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'73' MOVF fingl,W ; 74 D 5 lo 11011111 111110xx XORLW B'11011111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11111000' ANDLW B'11111100' BTFSC STATUS,Z RETLW D'74' MOVF fingl,W ; 74 D 5 lo 10x00000 0000xxxx XORLW B'10000000' ANDLW B'11011111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'74' MOVF fingl,W ; 75 D# 5 lo 11011111 11110xxx XORLW B'11011111' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'11110000' ANDLW B'11111000' BTFSC STATUS,Z RETLW D'75' MOVF fingl,W ; 75 D# 5 lo 01000000 0000xxxx XORLW B'01000000' ANDLW B'11111111' BTFSS STATUS,Z GOTO $+6 MOVF fingr,W XORLW B'00000000' ANDLW B'11110000' BTFSC STATUS,Z RETLW D'75' RETLW 0 ; fingering not known ORG H'700' tablo ADDLW -D'59' ; lsb table for sound interrupt ADDWF PCL,F RETLW D'209' ; 59 B 246 4049 RETLW D'238' ; 60 C 261 3822 RETLW D'23' ; 61 C# 277 3607 RETLW D'77' ; 62 D 293 3405 RETLW D'142' ; 63 D# 311 3214 RETLW D'217' ; 64 E 329 3033 RETLW D'47' ; 65 F 349 2863 RETLW D'142' ; 66 F# 369 2702 RETLW D'247' ; 67 G 391 2551 RETLW D'103' ; 68 G# 415 2407 RETLW D'224' ; 69 A 440 2272 RETLW D'97' ; 70 Bb 466 2145 RETLW D'232' ; 71 B 493 2024 RETLW D'119' ; 72 C 523 1911 RETLW D'11' ; 73 C# 554 1803 RETLW D'166' ; 74 D 587 1702 RETLW D'71' ; 75 D# 622 1607 RETLW D'236' ; 76 E 659 1516 RETLW D'151' ; 77 F 698 1431 RETLW D'71' ; 78 F# 739 1351 RETLW D'251' ; 79 G 783 1275 RETLW D'179' ; 80 G# 830 1203 RETLW D'112' ; 81 A 880 1136 RETLW D'48' ; 82 Bb 932 1072 RETLW D'244' ; 83 B 987 1012 RETLW D'187' ; 84 C 1046 955 RETLW D'133' ; 85 C# 1108 901 RETLW D'83' ; 86 D 1174 851 RETLW D'35' ; 87 D# 1244 803 RETLW D'246' ; 88 E 1318 758 RETLW D'203' ; 89 F 1396 715 RETLW D'163' ; 90 F# 1479 675 RETLW D'125' ; 91 G 1567 637 RETLW D'89' ; 92 G# 1661 601 RETLW D'56' ; 93 A 1760 568 RETLW D'24' ; 94 Bb 1864 536 RETLW D'250' ; 95 B 1975 506 RETLW D'221' ; 96 C 2093 477 RETLW D'194' ; 97 C# 2217 450 RETLW D'169' ; 98 D 2349 425 ORG H'740' tabhi ADDLW -D'59' ; msb table for sound interrupt ADDWF PCL,F RETLW D'15' ; 59 B 246 4049 RETLW D'14' ; 60 C 261 3822 RETLW D'14' ; 61 C# 277 3607 RETLW D'13' ; 62 D 293 3405 RETLW D'12' ; 63 D# 311 3214 RETLW D'11' ; 64 E 329 3033 RETLW D'11' ; 65 F 349 2863 RETLW D'10' ; 66 F# 369 2702 RETLW D'9' ; 67 G 391 2551 RETLW D'9' ; 68 G# 415 2407 RETLW D'8' ; 69 A 440 2272 RETLW D'8' ; 70 Bb 466 2145 RETLW D'7' ; 71 B 493 2024 RETLW D'7' ; 72 C 523 1911 RETLW D'7' ; 73 C# 554 1803 RETLW D'6' ; 74 D 587 1702 RETLW D'6' ; 75 D# 622 1607 RETLW D'5' ; 76 E 659 1516 RETLW D'5' ; 77 F 698 1431 RETLW D'5' ; 78 F# 739 1351 RETLW D'4' ; 79 G 783 1275 RETLW D'4' ; 80 G# 830 1203 RETLW D'4' ; 81 A 880 1136 RETLW D'4' ; 82 Bb 932 1072 RETLW D'3' ; 83 B 987 1012 RETLW D'3' ; 84 C 1046 955 RETLW D'3' ; 85 C# 1108 901 RETLW D'3' ; 86 D 1174 851 RETLW D'3' ; 87 D# 1244 803 RETLW D'2' ; 88 E 1318 758 RETLW D'2' ; 89 F 1396 715 RETLW D'2' ; 90 F# 1479 675 RETLW D'2' ; 91 G 1567 637 RETLW D'2' ; 92 G# 1661 601 RETLW D'2' ; 93 A 1760 568 RETLW D'2' ; 94 Bb 1864 536 RETLW D'1' ; 95 B 1975 506 RETLW D'1' ; 96 C 2093 477 RETLW D'1' ; 97 C# 2217 450 RETLW D'1' ; 98 D 2349 425 END;