MPASM 02.15 Released EXPT7.ASM 3-3-2002 1:22:47 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 ;Expt7.asm 00002 ;Project: Siren Sound 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 1283 00011 BCF 03,5 ;Go to Bank 0 - the program memory area. 0003 0186 00012 CLRF 06 ;Clear display 0004 2805 00013 GOTO SIREN 00014 0005 3080 00015 SIREN MOVLW 80H ;Number of cycles for each tone 0006 008E 00016 MOVWF 0EH 0007 0090 00017 MOVWF 10H 0008 3050 00018 MOVLW 50H ;Number of steps 0009 008F 00019 MOVWF 0FH ;File 0F holds the number of steps 000A 3050 00020 MOVLW 50H ;Determines frequency 000B 008C 00021 MOVWF 0CH ;File 0C determines the frequency 000C 080C 00022 REPEAT MOVF 0CH,0 ;File 0C is moved to W 000D 008D 00023 MOVWF 0D ;W is moved to file 0D for decrementing 000E 1786 00024 ON BSF 06,7 ;Length of HIGH time to Piezo 000F 0B8D 00025 DECFSZ 0D,1 0010 280E 00026 GOTO ON ; 0011 008D 00027 MOVWF 0DH ;W is moved to file 0D again 0012 1386 00028 OFF BCF 06,7 ;Length of LOW time to Piezo 0013 0B8D 00029 DECFSZ 0D,1 0014 2812 00030 GOTO OFF ; 0015 0B90 00031 DECFSZ 10H,1 ;Number of cycles for each tone 0016 280C 00032 GOTO REPEAT 0017 038C 00033 DECF 0C,1 ;HIGH and LOW is shortened -tone rises 0018 0A8E 00034 INCF 0E,1 ;Increase the number of cycles 0019 080E 00035 MOVF 0E,0 ;File 0E to W 001A 0090 00036 MOVWF 10H ;W to file 10h 001B 0B8F 00037 DECFSZ 0F,1 ;Number of steps 001C 280C 00038 GOTO REPEAT ; 001D 2805 00039 GOTO SIREN 00040 00041 END ;Tells assembler end of program MPASM 02.15 Released EXPT7.ASM 3-3-2002 1:22:47 PAGE 2 SYMBOL TABLE LABEL VALUE OFF 00000012 ON 0000000E REPEAT 0000000C SETUP 00000000 SIREN 00000005 __16F84 00000001 MEMORY USAGE MAP ('X' = Used, '-' = Unused) 0000 : XXXXXXXXXXXXXXXX XXXXXXXXXXXXXX-- ---------------- ---------------- All other memory blocks unused. Program Memory Words Used: 30 Program Memory Words Free: 994 Errors : 0 Warnings : 0 reported, 0 suppressed Messages : 0 reported, 0 suppressed