MPASM 02.15 Released EXPT11.ASM 3-4-2002 9:42:49 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 ;Expt11.asm 00002 ;Project: Sound Detection 00003 ;List P = 16F84 00004 ;#include 00005 ;__CONFIG 1Bh    ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC 00006 00007 0000 00008 ORG 0 ;This is the start of memory for the program. 0000 1683 00009 SETUP BSF 03,5 ;Go to Bank 1 0001 0186 00010 CLRF 06 ;Make all port B output 0002 3002 00011 MOVLW 02 ;Load W with 0000 0010 0003 0085 00012 MOVWF 05 ;Make RA1 input 0004 1283 00013 BCF 03,5 ;Go to Bank 0 - the program memory area. 0005 019F 00014 CLRF 1F ;Clear detection flag 0006 0185 00015 CLRF 05 ;Clear display 0007 0186 00016 CLRF 06 ;Clear display 0008 280D 00017 GOTO MAIN 00018 0009 0000 00019 DELAY NOP ;Create 1mS delay 000A 0B9A 00020 DECFSZ 1A,1 000B 2809 00021 GOTO DELAY 000C 0008 00022 RETURN 00023 000D 1C85 00024 MAIN BTFSS 05,1 ;Test the input line on port A 000E 2816 00025 GOTO MAIN1 ;LOW detected 000F 181F 00026 BTFSC 1F,0 ;HIGH detected. First pass of routine? 0010 280D 00027 GOTO MAIN ;HIGH already detected 0011 1406 00028 BSF 06,0 ;Turn on LED 0012 2009 00029 CALL DELAY 0013 1006 00030 BCF 06,0 ;Turn off LED 0014 141F 00031 BSF 1F,0 ;Set the detection flag 0015 280D 00032 GOTO MAIN 0016 101F 00033 MAIN1 BCF 1F,0 ;Clear the detection flag 0017 280D 00034 GOTO MAIN 00035 00036 END ;Tells assembler end of program MPASM 02.15 Released EXPT11.ASM 3-4-2002 9:42:49 PAGE 2 SYMBOL TABLE LABEL VALUE DELAY 00000009 MAIN 0000000D MAIN1 00000016 SETUP 00000000 __16F84 00000001 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : XXXXXXXXXXXXXXXX XXXXXXXX-------- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 24 Program Memory Words Free: 1000 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 0 reported, 0 suppressed