CPU = 16F876 MHZ = 10 CONFIG 16254 ;*********************************************** ; http://www.basicmicro.com ; Title : lookup.bas ; Author : Dale Kubin ; Date : 04/29/02 ; Lookup command. Play Mary Had a Little lamb ; using a Lookup table. ;*********************************************** AH con 440*2 ;assigns a value for the note and octave AS con 466*2 ;the note is 466*2 = A sharp second octave BH con 494*2 CH con 523*2 CS con 554*2 DH con 587*2 DS con 622*2 EH con 659*2 FH con 698*2 FS con 740*2 GH con 784*2 GS con 831*2 ;above we assign our notes as constants with values for the FEQOUT command temp var byte temp2 var word main for temp = 0 to 33 lookup temp,[CS,BH,AH,BH,CS,0,CS,0,CS,BH,0,BH,0,BH,0,CS,| EH, 0,EH,CS,BH,AH,BH,CS,0,CS,0,CS,BH,0,BH,CS,BH,AH],temp2 ; the above statement must be formatted to work correctly ; the "|" or symbol is used to indicate a line break, when ; a command is too long to fit on one line. if temp2 = 0 then finish freqout B0,500,temp2 finish: next pause 5000 goto main