MP2COD 4.04, COFF to COD File Converter
Copyright (c) 2006 Microchip Technology Inc.
Listing File Generated: Sat Oct 17 20:14:35 2009


Address  Value    Disassembly              Source                                                                           File
-------  -------  -----------------------  -------------------------------------------------------------------------------  -----
                                           ;************************************************************************        D:\PIC18_Project\p18MATH.ASM
                                           ;*	Microchip Technology Inc. 2002										*                                     D:\PIC18_Project\p18MATH.ASM
                                           ;*	Assembler version: 2.0000											*                                         D:\PIC18_Project\p18MATH.ASM
                                           ;*	Filename: 															*                                                    D:\PIC18_Project\p18MATH.ASM
                                           ;*		p18math.asm (main routine)   									*                                      D:\PIC18_Project\p18MATH.ASM
                                           ;*	March 14,2002														*                                                  D:\PIC18_Project\p18MATH.ASM
                                           ;*      Designed to run at 4MHz                                         *        D:\PIC18_Project\p18MATH.ASM
                                           ;* 	PICDEM 2 PLUS DEMO code                                   			*               D:\PIC18_Project\p18MATH.ASM
                                           ;*																		*                                                            D:\PIC18_Project\p18MATH.ASM
                                           ;* Revisions:															*                                                    D:\PIC18_Project\p18MATH.ASM
                                           ;* 1/23/04 Replaced "CLRW" instruction with "clrf	w" instruction.		*             D:\PIC18_Project\p18MATH.ASM
                                           ;*		Changed the 16/8 divide routine.								*                                    D:\PIC18_Project\p18MATH.ASM
                                           ;************************************************************************        D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           	list	p=18f452                                                                   D:\PIC18_Project\p18MATH.ASM
                                           	#include	p18f452.inc                                                            D:\PIC18_Project\p18MATH.ASM
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                           ; P18F452.INC  Standard Header File, Version 1.4   Microchip Technology, Inc.    C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           	#define	_C	STATUS,0                                                             D:\PIC18_Project\p18MATH.ASM
                                           	                                                                                D:\PIC18_Project\p18MATH.ASM
                                           MSB			equ	7                                                                      D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           MATH_VAR	UDATA                                                                   D:\PIC18_Project\p18MATH.ASM
                                           AARGB0		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           AARGB1		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           AARGB2		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           AARGB3		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           AARGB5		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           BARGB0		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           BARGB1		RES 1                                                                    D:\PIC18_Project\p18MATH.ASM
                                           REMB0		RES 1                                                                     D:\PIC18_Project\p18MATH.ASM
                                           REMB1		RES 1                                                                     D:\PIC18_Project\p18MATH.ASM
                                           TEMP		RES 1                                                                      D:\PIC18_Project\p18MATH.ASM
                                           LOOPCOUNT	RES 1                                                                  D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           	GLOBAL	AARGB0, AARGB1, BARGB0                                                   D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           PROG2	CODE                                                                       D:\PIC18_Project\p18MATH.ASM
                                           ;---------------- 8 * 8 UNSIGNED MULTIPLY -----------------------                D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           ;       Max Timing:     3+12+6*8+7 = 70 clks                                     D:\PIC18_Project\p18MATH.ASM
                                           ;       Min Timing:     3+7*6+5+3 = 53 clks                                      D:\PIC18_Project\p18MATH.ASM
                                           ;       PM: 19            DM: 4                                                  D:\PIC18_Project\p18MATH.ASM
                                           UMUL0808L                                                                        D:\PIC18_Project\p18MATH.ASM
00092e   6b95     CLRF      0x95,0x1       		CLRF    AARGB1                                                                 D:\PIC18_Project\p18MATH.ASM
000930   0e08     MOVLW     0x8                            MOVLW   0x08                                                     D:\PIC18_Project\p18MATH.ASM
000932   6f9e     MOVWF     0x9e,0x1                       MOVWF   LOOPCOUNT                                                D:\PIC18_Project\p18MATH.ASM
000934   5194     MOVF      0x94,0x0,0x1                   MOVF    AARGB0,W                                                 D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           LOOPUM0808A                                                                      D:\PIC18_Project\p18MATH.ASM
000936   3399     RRCF      0x99,0x1,0x1                   RRCF     BARGB0, F                                               D:\PIC18_Project\p18MATH.ASM
000938   b0d8     BTFSC     0xd8,0x0,0x0                   BTFSC   _C                                                       D:\PIC18_Project\p18MATH.ASM
00093a   d004     BRA       0x944                          bra    LUM0808NAP                                                D:\PIC18_Project\p18MATH.ASM
00093c   2f9e     DECFSZ    0x9e,0x1,0x1                   DECFSZ  LOOPCOUNT, F                                             D:\PIC18_Project\p18MATH.ASM
00093e   d7fb     BRA       0x936                          bra    LOOPUM0808A                                               D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000940   6b94     CLRF      0x94,0x1                       CLRF    AARGB0                                                   D:\PIC18_Project\p18MATH.ASM
000942   0c00     RETLW     0x0                            RETLW   0x00                                                     D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           LUM0808NAP                                                                       D:\PIC18_Project\p18MATH.ASM
000944   90d8     BCF       0xd8,0x0,0x0                   BCF     _C                                                       D:\PIC18_Project\p18MATH.ASM
000946   d003     BRA       0x94e                          bra    LUM0808NA                                                 D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           LOOPUM0808                                                                       D:\PIC18_Project\p18MATH.ASM
000948   3399     RRCF      0x99,0x1,0x1                   RRCF             BARGB0, F                                       D:\PIC18_Project\p18MATH.ASM
00094a   b0d8     BTFSC     0xd8,0x0,0x0                   BTFSC   _C                                                       D:\PIC18_Project\p18MATH.ASM
00094c   2794     ADDWF     0x94,0x1,0x1                   ADDWF   AARGB0, F                                                D:\PIC18_Project\p18MATH.ASM
00094e   3394     RRCF      0x94,0x1,0x1   LUM0808NA       RRCF    AARGB0, F                                                D:\PIC18_Project\p18MATH.ASM
000950   3395     RRCF      0x95,0x1,0x1                   RRCF    AARGB1, F                                                D:\PIC18_Project\p18MATH.ASM
000952   2f9e     DECFSZ    0x9e,0x1,0x1                   DECFSZ          LOOPCOUNT, F                                     D:\PIC18_Project\p18MATH.ASM
000954   d7f9     BRA       0x948                          bra            LOOPUM0808                                        D:\PIC18_Project\p18MATH.ASM
000956   0012     RETURN    0x0            		return                                                                         D:\PIC18_Project\p18MATH.ASM
                                           		GLOBAL	UMUL0808L                                                               D:\PIC18_Project\p18MATH.ASM
                                           ;----------------  16/8 UNSIGNED DIVIDE	  ------------------------               D:\PIC18_Project\p18MATH.ASM
                                           FXD1608U                                                                         D:\PIC18_Project\p18MATH.ASM
                                           		GLOBAL		FXD1608U                                                               D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000958   0e01     MOVLW     0x1            		MOVLW		0x01                                                                    D:\PIC18_Project\p18MATH.ASM
00095a   6599     CPFSGT    0x99,0x1       		CPFSGT		BARGB0                                                                 D:\PIC18_Project\p18MATH.ASM
00095c   efed     GOTO      0x9da          		GOTO		DREMZERO8                                                                D:\PIC18_Project\p18MATH.ASM
00095e   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           FXD1608U1                                                                        D:\PIC18_Project\p18MATH.ASM
                                           		GLOBAL		FXD1608U1                                                              D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000960   90d8     BCF       0xd8,0x0,0x0   		BCF		_C                                                                        D:\PIC18_Project\p18MATH.ASM
000962   6af7     CLRF      0xf7,0x0       		CLRF		TBLPTRH                                                                  D:\PIC18_Project\p18MATH.ASM
000964   3599     RLCF      0x99,0x0,0x1   		RLCF		BARGB0,W                                                                 D:\PIC18_Project\p18MATH.ASM
000966   36f7     RLCF      0xf7,0x1,0x0   		RLCF		TBLPTRH,F                                                                D:\PIC18_Project\p18MATH.ASM
000968   0fdf     ADDLW     0xdf           		ADDLW		LOW (IBXTBL256+1)	; access reciprocal table                             D:\PIC18_Project\p18MATH.ASM
00096a   6ef6     MOVWF     0xf6,0x0       		MOVWF		TBLPTRL                                                                 D:\PIC18_Project\p18MATH.ASM
00096c   0e09     MOVLW     0x9            		MOVLW		HIGH (IBXTBL256)                                                        D:\PIC18_Project\p18MATH.ASM
00096e   22f7     ADDWFC    0xf7,0x1,0x0   		ADDWFC		TBLPTRH,F                                                              D:\PIC18_Project\p18MATH.ASM
000970   000a     TBLRDPOSTDEC             		TBLRD		*-                                                                      D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           FXD1608U2                                                                        D:\PIC18_Project\p18MATH.ASM
                                           		GLOBAL		FXD1608U2                                                              D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000972   c094     MOVFF     0x94,0x9c      		MOVFF		AARGB0,REMB1                                                            D:\PIC18_Project\p18MATH.ASM
000974   f09c                                                                                                               
000976   c095     MOVFF     0x95,0x9b      		MOVFF		AARGB1,REMB0                                                            D:\PIC18_Project\p18MATH.ASM
000978   f09b                                                                                                               
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
00097a   50f5     MOVF      0xf5,0x0,0x0   		MOVF		TABLAT,W		; estimate quotient                                            D:\PIC18_Project\p18MATH.ASM
00097c   039c     MULWF     0x9c,0x1       		MULWF		REMB1                                                                   D:\PIC18_Project\p18MATH.ASM
00097e   cff4     MOVFF     0xff4,0x94     		MOVFF		PRODH,AARGB0                                                            D:\PIC18_Project\p18MATH.ASM
000980   f094                                                                                                               
000982   cff3     MOVFF     0xff3,0x95     		MOVFF		PRODL,AARGB1                                                            D:\PIC18_Project\p18MATH.ASM
000984   f095                                                                                                               
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000986   0009     TBLRDPOSTINC             		TBLRD		*+                                                                      D:\PIC18_Project\p18MATH.ASM
000988   50f5     MOVF      0xf5,0x0,0x0   		MOVF		TABLAT,W                                                                 D:\PIC18_Project\p18MATH.ASM
00098a   039b     MULWF     0x9b,0x1       		MULWF		REMB0                                                                   D:\PIC18_Project\p18MATH.ASM
00098c   cff4     MOVFF     0xff4,0x96     		MOVFF		PRODH,AARGB2                                                            D:\PIC18_Project\p18MATH.ASM
00098e   f096                                                                                                               
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
000990   039c     MULWF     0x9c,0x1       		MULWF		REMB1                                                                   D:\PIC18_Project\p18MATH.ASM
000992   50f3     MOVF      0xf3,0x0,0x0   		MOVF		PRODL,W                                                                  D:\PIC18_Project\p18MATH.ASM
000994   2796     ADDWF     0x96,0x1,0x1   		ADDWF		AARGB2,F                                                                D:\PIC18_Project\p18MATH.ASM
000996   50f4     MOVF      0xf4,0x0,0x0   		MOVF		PRODH,W                                                                  D:\PIC18_Project\p18MATH.ASM
000998   2395     ADDWFC    0x95,0x1,0x1   		ADDWFC		AARGB1,F                                                               D:\PIC18_Project\p18MATH.ASM
00099a   6ae8     CLRF      0xe8,0x0       		CLRF		WREG                                                                     D:\PIC18_Project\p18MATH.ASM
00099c   2394     ADDWFC    0x94,0x1,0x1   		ADDWFC		AARGB0,F                                                               D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
00099e   000a     TBLRDPOSTDEC             		TBLRD		*-                                                                      D:\PIC18_Project\p18MATH.ASM
0009a0   50f5     MOVF      0xf5,0x0,0x0   		MOVF		TABLAT,W                                                                 D:\PIC18_Project\p18MATH.ASM
0009a2   039b     MULWF     0x9b,0x1       		MULWF		REMB0                                                                   D:\PIC18_Project\p18MATH.ASM
0009a4   50f3     MOVF      0xf3,0x0,0x0   		MOVF		PRODL,W                                                                  D:\PIC18_Project\p18MATH.ASM
0009a6   2796     ADDWF     0x96,0x1,0x1   		ADDWF		AARGB2,F                                                                D:\PIC18_Project\p18MATH.ASM
0009a8   50f4     MOVF      0xf4,0x0,0x0   		MOVF		PRODH,W                                                                  D:\PIC18_Project\p18MATH.ASM
0009aa   2395     ADDWFC    0x95,0x1,0x1   		ADDWFC		AARGB1,F                                                               D:\PIC18_Project\p18MATH.ASM
0009ac   6ae8     CLRF      0xe8,0x0       		CLRF		WREG                                                                     D:\PIC18_Project\p18MATH.ASM
0009ae   2394     ADDWFC    0x94,0x1,0x1   		ADDWFC		AARGB0,F                                                               D:\PIC18_Project\p18MATH.ASM
                                           		                                                                               D:\PIC18_Project\p18MATH.ASM
0009b0   5199     MOVF      0x99,0x0,0x1   		MOVF		BARGB0,W                                                                 D:\PIC18_Project\p18MATH.ASM
0009b2   0395     MULWF     0x95,0x1       		MULWF		AARGB1                                                                  D:\PIC18_Project\p18MATH.ASM
0009b4   cff3     MOVFF     0xff3,0x97     		MOVFF		PRODL,AARGB3                                                            D:\PIC18_Project\p18MATH.ASM
0009b6   f097                                                                                                               
0009b8   cff4     MOVFF     0xff4,0x96     		MOVFF		PRODH,AARGB2                                                            D:\PIC18_Project\p18MATH.ASM
0009ba   f096                                                                                                               
0009bc   0394     MULWF     0x94,0x1       		MULWF		AARGB0                                                                  D:\PIC18_Project\p18MATH.ASM
0009be   50f3     MOVF      0xf3,0x0,0x0   		MOVF		PRODL,W                                                                  D:\PIC18_Project\p18MATH.ASM
0009c0   2796     ADDWF     0x96,0x1,0x1   		ADDWF		AARGB2,F                                                                D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009c2   5197     MOVF      0x97,0x0,0x1   		MOVF		AARGB3,W		; estimate remainder                                           D:\PIC18_Project\p18MATH.ASM
0009c4   5f9b     SUBWF     0x9b,0x1,0x1   		SUBWF		REMB0,F                                                                 D:\PIC18_Project\p18MATH.ASM
0009c6   5196     MOVF      0x96,0x0,0x1   		MOVF		AARGB2,W                                                                 D:\PIC18_Project\p18MATH.ASM
0009c8   5b9c     SUBWFB    0x9c,0x1,0x1   		SUBWFB		REMB1,F                                                                D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009ca   af9c     BTFSS     0x9c,0x7,0x1   		BTFSS		REMB1,MSB		; test remainder                                             D:\PIC18_Project\p18MATH.ASM
0009cc   0c00     RETLW     0x0            		RETLW		0x00                                                                    D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009ce   0795     DECF      0x95,0x1,0x1   		DECF		AARGB1,F                                                                 D:\PIC18_Project\p18MATH.ASM
0009d0   6ae8     CLRF      0xe8,0x0       		CLRF		WREG                                                                     D:\PIC18_Project\p18MATH.ASM
0009d2   5b94     SUBWFB    0x94,0x1,0x1   		SUBWFB		AARGB0,F                                                               D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009d4   5199     MOVF      0x99,0x0,0x1   		MOVF		BARGB0,W                                                                 D:\PIC18_Project\p18MATH.ASM
0009d6   279b     ADDWF     0x9b,0x1,0x1   		ADDWF		REMB0,F                                                                 D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009d8   0c00     RETLW     0x0                    RETLW       0x00                                                         D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           ;----------------------------------------------------------------------------------------------         D:\PIC18_Project\p18MATH.ASM
                                           DREMZERO8                                                                        D:\PIC18_Project\p18MATH.ASM
0009da   6b9b     CLRF      0x9b,0x1       		CLRF		REMB0                                                                    D:\PIC18_Project\p18MATH.ASM
0009dc   0c00     RETLW     0x0            		RETLW		0x00                                                                    D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           ;---------------------------------------------------------------------------------------------- D:\PIC18_Project\p18MATH.ASM
                                           ;	The table IBXTBL256 is used by all routines and consists of 16-bit             D:\PIC18_Project\p18MATH.ASM
                                           ;	upper bound approximations to the reciprocal of BARGB0.                        D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           IBXTBL256                                                                        D:\PIC18_Project\p18MATH.ASM
                                           		GLOBAL	IBXTBL256                                                               D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
0009de   0000     NOP                      		DATA	0x0000                                                                    D:\PIC18_Project\p18MATH.ASM
0009e0   0001     HALT                     		DATA	0x0001                                                                    D:\PIC18_Project\p18MATH.ASM
0009e2   8001     BSF       0x1,0x0,0x0    		DATA	0x8001                                                                    D:\PIC18_Project\p18MATH.ASM
0009e4   5556     SUBFWB    0x56,0x0,0x1   		DATA	0x5556                                                                    D:\PIC18_Project\p18MATH.ASM
0009e6   4001     RRNCF     0x1,0x0,0x0    		DATA	0x4001                                                                    D:\PIC18_Project\p18MATH.ASM
0009e8   3334     RRCF      0x34,0x1,0x1   		DATA	0x3334                                                                    D:\PIC18_Project\p18MATH.ASM
0009ea   2aab     INCF      0xab,0x1,0x0   		DATA	0x2AAB                                                                    D:\PIC18_Project\p18MATH.ASM
0009ec   2493     ADDWF     0x93,0x0,0x0   		DATA	0x2493                                                                    D:\PIC18_Project\p18MATH.ASM
0009ee   2001     ADDWFC    0x1,0x0,0x0    		DATA	0x2001                                                                    D:\PIC18_Project\p18MATH.ASM
0009f0   1c72     COMF      0x72,0x0,0x0   		DATA	0x1C72                                                                    D:\PIC18_Project\p18MATH.ASM
0009f2   199a     XORWF     0x9a,0x0,0x1   		DATA	0x199A                                                                    D:\PIC18_Project\p18MATH.ASM
0009f4   1746     ANDWF     0x46,0x1,0x1   		DATA	0x1746                                                                    D:\PIC18_Project\p18MATH.ASM
0009f6   1556     ANDWF     0x56,0x0,0x1   		DATA	0x1556                                                                    D:\PIC18_Project\p18MATH.ASM
0009f8   13b2     IORWF     0xb2,0x1,0x1   		DATA	0x13B2                                                                    D:\PIC18_Project\p18MATH.ASM
0009fa   124a     IORWF     0x4a,0x1,0x0   		DATA	0x124A                                                                    D:\PIC18_Project\p18MATH.ASM
0009fc   1112     IORWF     0x12,0x0,0x1   		DATA	0x1112                                                                    D:\PIC18_Project\p18MATH.ASM
0009fe   1001     IORWF     0x1,0x0,0x0    		DATA	0x1001                                                                    D:\PIC18_Project\p18MATH.ASM
000a00   0f10     ADDLW     0x10           		DATA	0x0F10                                                                    D:\PIC18_Project\p18MATH.ASM
000a02   0e39     MOVLW     0x39           		DATA	0x0E39                                                                    D:\PIC18_Project\p18MATH.ASM
000a04   0d7a     MULLW     0x7a           		DATA	0x0D7A                                                                    D:\PIC18_Project\p18MATH.ASM
000a06   0ccd     RETLW     0xcd           		DATA	0x0CCD                                                                    D:\PIC18_Project\p18MATH.ASM
000a08   0c31     RETLW     0x31           		DATA	0x0C31                                                                    D:\PIC18_Project\p18MATH.ASM
000a0a   0ba3     ANDLW     0xa3           		DATA	0x0BA3                                                                    D:\PIC18_Project\p18MATH.ASM
000a0c   0b22     ANDLW     0x22           		DATA	0x0B22                                                                    D:\PIC18_Project\p18MATH.ASM
000a0e   0aab     XORLW     0xab           		DATA	0x0AAB                                                                    D:\PIC18_Project\p18MATH.ASM
000a10   0a3e     XORLW     0x3e           		DATA	0x0A3E                                                                    D:\PIC18_Project\p18MATH.ASM
000a12   09d9     IORLW     0xd9           		DATA	0x09D9                                                                    D:\PIC18_Project\p18MATH.ASM
000a14   097c     IORLW     0x7c           		DATA	0x097C                                                                    D:\PIC18_Project\p18MATH.ASM
000a16   0925     IORLW     0x25           		DATA	0x0925                                                                    D:\PIC18_Project\p18MATH.ASM
000a18   08d4     SUBLW     0xd4           		DATA	0x08D4                                                                    D:\PIC18_Project\p18MATH.ASM
000a1a   0889     SUBLW     0x89           		DATA	0x0889                                                                    D:\PIC18_Project\p18MATH.ASM
000a1c   0843     SUBLW     0x43           		DATA	0x0843                                                                    D:\PIC18_Project\p18MATH.ASM
000a1e   0801     SUBLW     0x1            		DATA	0x0801                                                                    D:\PIC18_Project\p18MATH.ASM
000a20   07c2     DECF      0xc2,0x1,0x1   		DATA	0x07C2                                                                    D:\PIC18_Project\p18MATH.ASM
000a22   0788     DECF      0x88,0x1,0x1   		DATA	0x0788                                                                    D:\PIC18_Project\p18MATH.ASM
000a24   0751     DECF      0x51,0x1,0x1   		DATA	0x0751                                                                    D:\PIC18_Project\p18MATH.ASM
000a26   071d     DECF      0x1d,0x1,0x1   		DATA	0x071D                                                                    D:\PIC18_Project\p18MATH.ASM
000a28   06ec     DECF      0xec,0x1,0x0   		DATA	0x06EC                                                                    D:\PIC18_Project\p18MATH.ASM
000a2a   06bd     DECF      0xbd,0x1,0x0   		DATA	0x06BD                                                                    D:\PIC18_Project\p18MATH.ASM
000a2c   0691     DECF      0x91,0x1,0x0   		DATA	0x0691                                                                    D:\PIC18_Project\p18MATH.ASM
000a2e   0667     DECF      0x67,0x1,0x0   		DATA	0x0667                                                                    D:\PIC18_Project\p18MATH.ASM
000a30   063f     DECF      0x3f,0x1,0x0   		DATA	0x063F                                                                    D:\PIC18_Project\p18MATH.ASM
000a32   0619     DECF      0x19,0x1,0x0   		DATA	0x0619                                                                    D:\PIC18_Project\p18MATH.ASM
000a34   05f5     DECF      0xf5,0x0,0x1   		DATA	0x05F5                                                                    D:\PIC18_Project\p18MATH.ASM
000a36   05d2     DECF      0xd2,0x0,0x1   		DATA	0x05D2                                                                    D:\PIC18_Project\p18MATH.ASM
000a38   05b1     DECF      0xb1,0x0,0x1   		DATA	0x05B1                                                                    D:\PIC18_Project\p18MATH.ASM
000a3a   0591     DECF      0x91,0x0,0x1   		DATA	0x0591                                                                    D:\PIC18_Project\p18MATH.ASM
000a3c   0573     DECF      0x73,0x0,0x1   		DATA	0x0573                                                                    D:\PIC18_Project\p18MATH.ASM
000a3e   0556     DECF      0x56,0x0,0x1   		DATA	0x0556                                                                    D:\PIC18_Project\p18MATH.ASM
000a40   053a     DECF      0x3a,0x0,0x1   		DATA	0x053A                                                                    D:\PIC18_Project\p18MATH.ASM
000a42   051f     DECF      0x1f,0x0,0x1   		DATA	0x051F                                                                    D:\PIC18_Project\p18MATH.ASM
000a44   0506     DECF      0x6,0x0,0x1    		DATA	0x0506                                                                    D:\PIC18_Project\p18MATH.ASM
000a46   04ed     DECF      0xed,0x0,0x0   		DATA	0x04ED                                                                    D:\PIC18_Project\p18MATH.ASM
000a48   04d5     DECF      0xd5,0x0,0x0   		DATA	0x04D5                                                                    D:\PIC18_Project\p18MATH.ASM
000a4a   04be     DECF      0xbe,0x0,0x0   		DATA	0x04BE                                                                    D:\PIC18_Project\p18MATH.ASM
000a4c   04a8     DECF      0xa8,0x0,0x0   		DATA	0x04A8                                                                    D:\PIC18_Project\p18MATH.ASM
000a4e   0493     DECF      0x93,0x0,0x0   		DATA	0x0493                                                                    D:\PIC18_Project\p18MATH.ASM
000a50   047e     DECF      0x7e,0x0,0x0   		DATA	0x047E                                                                    D:\PIC18_Project\p18MATH.ASM
000a52   046a     DECF      0x6a,0x0,0x0   		DATA	0x046A                                                                    D:\PIC18_Project\p18MATH.ASM
000a54   0457     DECF      0x57,0x0,0x0   		DATA	0x0457                                                                    D:\PIC18_Project\p18MATH.ASM
000a56   0445     DECF      0x45,0x0,0x0   		DATA	0x0445                                                                    D:\PIC18_Project\p18MATH.ASM
000a58   0433     DECF      0x33,0x0,0x0   		DATA	0x0433                                                                    D:\PIC18_Project\p18MATH.ASM
000a5a   0422     DECF      0x22,0x0,0x0   		DATA	0x0422                                                                    D:\PIC18_Project\p18MATH.ASM
000a5c   0411     DECF      0x11,0x0,0x0   		DATA	0x0411                                                                    D:\PIC18_Project\p18MATH.ASM
000a5e   0401     DECF      0x1,0x0,0x0    		DATA	0x0401                                                                    D:\PIC18_Project\p18MATH.ASM
000a60   03f1     MULWF     0xf1,0x1       		DATA	0x03F1                                                                    D:\PIC18_Project\p18MATH.ASM
000a62   03e1     MULWF     0xe1,0x1       		DATA	0x03E1                                                                    D:\PIC18_Project\p18MATH.ASM
000a64   03d3     MULWF     0xd3,0x1       		DATA	0x03D3                                                                    D:\PIC18_Project\p18MATH.ASM
000a66   03c4     MULWF     0xc4,0x1       		DATA	0x03C4                                                                    D:\PIC18_Project\p18MATH.ASM
000a68   03b6     MULWF     0xb6,0x1       		DATA	0x03B6                                                                    D:\PIC18_Project\p18MATH.ASM
000a6a   03a9     MULWF     0xa9,0x1       		DATA	0x03A9                                                                    D:\PIC18_Project\p18MATH.ASM
000a6c   039c     MULWF     0x9c,0x1       		DATA	0x039C                                                                    D:\PIC18_Project\p18MATH.ASM
000a6e   038f     MULWF     0x8f,0x1       		DATA	0x038F                                                                    D:\PIC18_Project\p18MATH.ASM
000a70   0382     MULWF     0x82,0x1       		DATA	0x0382                                                                    D:\PIC18_Project\p18MATH.ASM
000a72   0376     MULWF     0x76,0x1       		DATA	0x0376                                                                    D:\PIC18_Project\p18MATH.ASM
000a74   036a     MULWF     0x6a,0x1       		DATA	0x036A                                                                    D:\PIC18_Project\p18MATH.ASM
000a76   035f     MULWF     0x5f,0x1       		DATA	0x035F                                                                    D:\PIC18_Project\p18MATH.ASM
000a78   0354     MULWF     0x54,0x1       		DATA	0x0354                                                                    D:\PIC18_Project\p18MATH.ASM
000a7a   0349     MULWF     0x49,0x1       		DATA	0x0349                                                                    D:\PIC18_Project\p18MATH.ASM
000a7c   033e     MULWF     0x3e,0x1       		DATA	0x033E                                                                    D:\PIC18_Project\p18MATH.ASM
000a7e   0334     MULWF     0x34,0x1       		DATA	0x0334                                                                    D:\PIC18_Project\p18MATH.ASM
000a80   032a     MULWF     0x2a,0x1       		DATA	0x032A                                                                    D:\PIC18_Project\p18MATH.ASM
000a82   0320     MULWF     0x20,0x1       		DATA	0x0320                                                                    D:\PIC18_Project\p18MATH.ASM
000a84   0316     MULWF     0x16,0x1       		DATA	0x0316                                                                    D:\PIC18_Project\p18MATH.ASM
000a86   030d     MULWF     0xd,0x1        		DATA	0x030D                                                                    D:\PIC18_Project\p18MATH.ASM
000a88   0304     MULWF     0x4,0x1        		DATA	0x0304                                                                    D:\PIC18_Project\p18MATH.ASM
000a8a   02fb     MULWF     0xfb,0x0       		DATA	0x02FB                                                                    D:\PIC18_Project\p18MATH.ASM
000a8c   02f2     MULWF     0xf2,0x0       		DATA	0x02F2                                                                    D:\PIC18_Project\p18MATH.ASM
000a8e   02e9     MULWF     0xe9,0x0       		DATA	0x02E9                                                                    D:\PIC18_Project\p18MATH.ASM
000a90   02e1     MULWF     0xe1,0x0       		DATA	0x02E1                                                                    D:\PIC18_Project\p18MATH.ASM
000a92   02d9     MULWF     0xd9,0x0       		DATA	0x02D9                                                                    D:\PIC18_Project\p18MATH.ASM
000a94   02d1     MULWF     0xd1,0x0       		DATA	0x02D1                                                                    D:\PIC18_Project\p18MATH.ASM
000a96   02c9     MULWF     0xc9,0x0       		DATA	0x02C9                                                                    D:\PIC18_Project\p18MATH.ASM
000a98   02c1     MULWF     0xc1,0x0       		DATA	0x02C1                                                                    D:\PIC18_Project\p18MATH.ASM
000a9a   02ba     MULWF     0xba,0x0       		DATA	0x02BA                                                                    D:\PIC18_Project\p18MATH.ASM
000a9c   02b2     MULWF     0xb2,0x0       		DATA	0x02B2                                                                    D:\PIC18_Project\p18MATH.ASM
000a9e   02ab     MULWF     0xab,0x0       		DATA	0x02AB                                                                    D:\PIC18_Project\p18MATH.ASM
000aa0   02a4     MULWF     0xa4,0x0       		DATA	0x02A4                                                                    D:\PIC18_Project\p18MATH.ASM
000aa2   029d     MULWF     0x9d,0x0       		DATA	0x029D                                                                    D:\PIC18_Project\p18MATH.ASM
000aa4   0296     MULWF     0x96,0x0       		DATA	0x0296                                                                    D:\PIC18_Project\p18MATH.ASM
000aa6   0290     MULWF     0x90,0x0       		DATA	0x0290                                                                    D:\PIC18_Project\p18MATH.ASM
000aa8   0289     MULWF     0x89,0x0       		DATA	0x0289                                                                    D:\PIC18_Project\p18MATH.ASM
000aaa   0283     MULWF     0x83,0x0       		DATA	0x0283                                                                    D:\PIC18_Project\p18MATH.ASM
000aac   027d     MULWF     0x7d,0x0       		DATA	0x027D                                                                    D:\PIC18_Project\p18MATH.ASM
000aae   0277     MULWF     0x77,0x0       		DATA	0x0277                                                                    D:\PIC18_Project\p18MATH.ASM
000ab0   0271     MULWF     0x71,0x0       		DATA	0x0271                                                                    D:\PIC18_Project\p18MATH.ASM
000ab2   026b     MULWF     0x6b,0x0       		DATA	0x026B                                                                    D:\PIC18_Project\p18MATH.ASM
000ab4   0265     MULWF     0x65,0x0       		DATA	0x0265                                                                    D:\PIC18_Project\p18MATH.ASM
000ab6   025f     MULWF     0x5f,0x0       		DATA	0x025F                                                                    D:\PIC18_Project\p18MATH.ASM
000ab8   025a     MULWF     0x5a,0x0       		DATA	0x025A                                                                    D:\PIC18_Project\p18MATH.ASM
000aba   0254     MULWF     0x54,0x0       		DATA	0x0254                                                                    D:\PIC18_Project\p18MATH.ASM
000abc   024f     MULWF     0x4f,0x0       		DATA	0x024F                                                                    D:\PIC18_Project\p18MATH.ASM
000abe   024a     MULWF     0x4a,0x0       		DATA	0x024A                                                                    D:\PIC18_Project\p18MATH.ASM
000ac0   0244     MULWF     0x44,0x0       		DATA	0x0244                                                                    D:\PIC18_Project\p18MATH.ASM
000ac2   023f     MULWF     0x3f,0x0       		DATA	0x023F                                                                    D:\PIC18_Project\p18MATH.ASM
000ac4   023a     MULWF     0x3a,0x0       		DATA	0x023A                                                                    D:\PIC18_Project\p18MATH.ASM
000ac6   0235     MULWF     0x35,0x0       		DATA	0x0235                                                                    D:\PIC18_Project\p18MATH.ASM
000ac8   0231     MULWF     0x31,0x0       		DATA	0x0231                                                                    D:\PIC18_Project\p18MATH.ASM
000aca   022c     MULWF     0x2c,0x0       		DATA	0x022C                                                                    D:\PIC18_Project\p18MATH.ASM
000acc   0227     MULWF     0x27,0x0       		DATA	0x0227                                                                    D:\PIC18_Project\p18MATH.ASM
000ace   0223     MULWF     0x23,0x0       		DATA	0x0223                                                                    D:\PIC18_Project\p18MATH.ASM
000ad0   021e     MULWF     0x1e,0x0       		DATA	0x021E                                                                    D:\PIC18_Project\p18MATH.ASM
000ad2   021a     MULWF     0x1a,0x0       		DATA	0x021A                                                                    D:\PIC18_Project\p18MATH.ASM
000ad4   0215     MULWF     0x15,0x0       		DATA	0x0215                                                                    D:\PIC18_Project\p18MATH.ASM
000ad6   0211     MULWF     0x11,0x0       		DATA	0x0211                                                                    D:\PIC18_Project\p18MATH.ASM
000ad8   020d     MULWF     0xd,0x0        		DATA	0x020D                                                                    D:\PIC18_Project\p18MATH.ASM
000ada   0209     MULWF     0x9,0x0        		DATA	0x0209                                                                    D:\PIC18_Project\p18MATH.ASM
000adc   0205     MULWF     0x5,0x0        		DATA	0x0205                                                                    D:\PIC18_Project\p18MATH.ASM
000ade   0201     MULWF     0x1,0x0        		DATA	0x0201                                                                    D:\PIC18_Project\p18MATH.ASM
000ae0   01fd     MOVLB     0xfd           		DATA	0x01FD                                                                    D:\PIC18_Project\p18MATH.ASM
000ae2   01f9     MOVLB     0xf9           		DATA	0x01F9                                                                    D:\PIC18_Project\p18MATH.ASM
000ae4   01f5     MOVLB     0xf5           		DATA	0x01F5                                                                    D:\PIC18_Project\p18MATH.ASM
000ae6   01f1     MOVLB     0xf1           		DATA	0x01F1                                                                    D:\PIC18_Project\p18MATH.ASM
000ae8   01ed     MOVLB     0xed           		DATA	0x01ED                                                                    D:\PIC18_Project\p18MATH.ASM
000aea   01ea     MOVLB     0xea           		DATA	0x01EA                                                                    D:\PIC18_Project\p18MATH.ASM
000aec   01e6     MOVLB     0xe6           		DATA	0x01E6                                                                    D:\PIC18_Project\p18MATH.ASM
000aee   01e2     MOVLB     0xe2           		DATA	0x01E2                                                                    D:\PIC18_Project\p18MATH.ASM
000af0   01df     MOVLB     0xdf           		DATA	0x01DF                                                                    D:\PIC18_Project\p18MATH.ASM
000af2   01db     MOVLB     0xdb           		DATA	0x01DB                                                                    D:\PIC18_Project\p18MATH.ASM
000af4   01d8     MOVLB     0xd8           		DATA	0x01D8                                                                    D:\PIC18_Project\p18MATH.ASM
000af6   01d5     MOVLB     0xd5           		DATA	0x01D5                                                                    D:\PIC18_Project\p18MATH.ASM
000af8   01d1     MOVLB     0xd1           		DATA	0x01D1                                                                    D:\PIC18_Project\p18MATH.ASM
000afa   01ce     MOVLB     0xce           		DATA	0x01CE                                                                    D:\PIC18_Project\p18MATH.ASM
000afc   01cb     MOVLB     0xcb           		DATA	0x01CB                                                                    D:\PIC18_Project\p18MATH.ASM
000afe   01c8     MOVLB     0xc8           		DATA	0x01C8                                                                    D:\PIC18_Project\p18MATH.ASM
000b00   01c4     MOVLB     0xc4           		DATA	0x01C4                                                                    D:\PIC18_Project\p18MATH.ASM
000b02   01c1     MOVLB     0xc1           		DATA	0x01C1                                                                    D:\PIC18_Project\p18MATH.ASM
000b04   01be     MOVLB     0xbe           		DATA	0x01BE                                                                    D:\PIC18_Project\p18MATH.ASM
000b06   01bb     MOVLB     0xbb           		DATA	0x01BB                                                                    D:\PIC18_Project\p18MATH.ASM
000b08   01b8     MOVLB     0xb8           		DATA	0x01B8                                                                    D:\PIC18_Project\p18MATH.ASM
000b0a   01b5     MOVLB     0xb5           		DATA	0x01B5                                                                    D:\PIC18_Project\p18MATH.ASM
000b0c   01b3     MOVLB     0xb3           		DATA	0x01B3                                                                    D:\PIC18_Project\p18MATH.ASM
000b0e   01b0     MOVLB     0xb0           		DATA	0x01B0                                                                    D:\PIC18_Project\p18MATH.ASM
000b10   01ad     MOVLB     0xad           		DATA	0x01AD                                                                    D:\PIC18_Project\p18MATH.ASM
000b12   01aa     MOVLB     0xaa           		DATA	0x01AA                                                                    D:\PIC18_Project\p18MATH.ASM
000b14   01a7     MOVLB     0xa7           		DATA	0x01A7                                                                    D:\PIC18_Project\p18MATH.ASM
000b16   01a5     MOVLB     0xa5           		DATA	0x01A5                                                                    D:\PIC18_Project\p18MATH.ASM
000b18   01a2     MOVLB     0xa2           		DATA	0x01A2                                                                    D:\PIC18_Project\p18MATH.ASM
000b1a   019f     MOVLB     0x9f           		DATA	0x019F                                                                    D:\PIC18_Project\p18MATH.ASM
000b1c   019d     MOVLB     0x9d           		DATA	0x019D                                                                    D:\PIC18_Project\p18MATH.ASM
000b1e   019a     MOVLB     0x9a           		DATA	0x019A                                                                    D:\PIC18_Project\p18MATH.ASM
000b20   0198     MOVLB     0x98           		DATA	0x0198                                                                    D:\PIC18_Project\p18MATH.ASM
000b22   0195     MOVLB     0x95           		DATA	0x0195                                                                    D:\PIC18_Project\p18MATH.ASM
000b24   0193     MOVLB     0x93           		DATA	0x0193                                                                    D:\PIC18_Project\p18MATH.ASM
000b26   0190     MOVLB     0x90           		DATA	0x0190                                                                    D:\PIC18_Project\p18MATH.ASM
000b28   018e     MOVLB     0x8e           		DATA	0x018E                                                                    D:\PIC18_Project\p18MATH.ASM
000b2a   018b     MOVLB     0x8b           		DATA	0x018B                                                                    D:\PIC18_Project\p18MATH.ASM
000b2c   0189     MOVLB     0x89           		DATA	0x0189                                                                    D:\PIC18_Project\p18MATH.ASM
000b2e   0187     MOVLB     0x87           		DATA	0x0187                                                                    D:\PIC18_Project\p18MATH.ASM
000b30   0184     MOVLB     0x84           		DATA	0x0184                                                                    D:\PIC18_Project\p18MATH.ASM
000b32   0182     MOVLB     0x82           		DATA	0x0182                                                                    D:\PIC18_Project\p18MATH.ASM
000b34   0180     MOVLB     0x80           		DATA	0x0180                                                                    D:\PIC18_Project\p18MATH.ASM
000b36   017e     MOVLB     0x7e           		DATA	0x017E                                                                    D:\PIC18_Project\p18MATH.ASM
000b38   017b     MOVLB     0x7b           		DATA	0x017B                                                                    D:\PIC18_Project\p18MATH.ASM
000b3a   0179     MOVLB     0x79           		DATA	0x0179                                                                    D:\PIC18_Project\p18MATH.ASM
000b3c   0177     MOVLB     0x77           		DATA	0x0177                                                                    D:\PIC18_Project\p18MATH.ASM
000b3e   0175     MOVLB     0x75           		DATA	0x0175                                                                    D:\PIC18_Project\p18MATH.ASM
000b40   0173     MOVLB     0x73           		DATA	0x0173                                                                    D:\PIC18_Project\p18MATH.ASM
000b42   0171     MOVLB     0x71           		DATA	0x0171                                                                    D:\PIC18_Project\p18MATH.ASM
000b44   016f     MOVLB     0x6f           		DATA	0x016F                                                                    D:\PIC18_Project\p18MATH.ASM
000b46   016d     MOVLB     0x6d           		DATA	0x016D                                                                    D:\PIC18_Project\p18MATH.ASM
000b48   016b     MOVLB     0x6b           		DATA	0x016B                                                                    D:\PIC18_Project\p18MATH.ASM
000b4a   0169     MOVLB     0x69           		DATA	0x0169                                                                    D:\PIC18_Project\p18MATH.ASM
000b4c   0167     MOVLB     0x67           		DATA	0x0167                                                                    D:\PIC18_Project\p18MATH.ASM
000b4e   0165     MOVLB     0x65           		DATA	0x0165                                                                    D:\PIC18_Project\p18MATH.ASM
000b50   0163     MOVLB     0x63           		DATA	0x0163                                                                    D:\PIC18_Project\p18MATH.ASM
000b52   0161     MOVLB     0x61           		DATA	0x0161                                                                    D:\PIC18_Project\p18MATH.ASM
000b54   015f     MOVLB     0x5f           		DATA	0x015F                                                                    D:\PIC18_Project\p18MATH.ASM
000b56   015d     MOVLB     0x5d           		DATA	0x015D                                                                    D:\PIC18_Project\p18MATH.ASM
000b58   015b     MOVLB     0x5b           		DATA	0x015B                                                                    D:\PIC18_Project\p18MATH.ASM
000b5a   0159     MOVLB     0x59           		DATA	0x0159                                                                    D:\PIC18_Project\p18MATH.ASM
000b5c   0158     MOVLB     0x58           		DATA	0x0158                                                                    D:\PIC18_Project\p18MATH.ASM
000b5e   0156     MOVLB     0x56           		DATA	0x0156                                                                    D:\PIC18_Project\p18MATH.ASM
000b60   0154     MOVLB     0x54           		DATA	0x0154                                                                    D:\PIC18_Project\p18MATH.ASM
000b62   0152     MOVLB     0x52           		DATA	0x0152                                                                    D:\PIC18_Project\p18MATH.ASM
000b64   0151     MOVLB     0x51           		DATA	0x0151                                                                    D:\PIC18_Project\p18MATH.ASM
000b66   014f     MOVLB     0x4f           		DATA	0x014F                                                                    D:\PIC18_Project\p18MATH.ASM
000b68   014d     MOVLB     0x4d           		DATA	0x014D                                                                    D:\PIC18_Project\p18MATH.ASM
000b6a   014b     MOVLB     0x4b           		DATA	0x014B                                                                    D:\PIC18_Project\p18MATH.ASM
000b6c   014a     MOVLB     0x4a           		DATA	0x014A                                                                    D:\PIC18_Project\p18MATH.ASM
000b6e   0148     MOVLB     0x48           		DATA	0x0148                                                                    D:\PIC18_Project\p18MATH.ASM
000b70   0147     MOVLB     0x47           		DATA	0x0147                                                                    D:\PIC18_Project\p18MATH.ASM
000b72   0145     MOVLB     0x45           		DATA	0x0145                                                                    D:\PIC18_Project\p18MATH.ASM
000b74   0143     MOVLB     0x43           		DATA	0x0143                                                                    D:\PIC18_Project\p18MATH.ASM
000b76   0142     MOVLB     0x42           		DATA	0x0142                                                                    D:\PIC18_Project\p18MATH.ASM
000b78   0140     MOVLB     0x40           		DATA	0x0140                                                                    D:\PIC18_Project\p18MATH.ASM
000b7a   013f     MOVLB     0x3f           		DATA	0x013F                                                                    D:\PIC18_Project\p18MATH.ASM
000b7c   013d     MOVLB     0x3d           		DATA	0x013D                                                                    D:\PIC18_Project\p18MATH.ASM
000b7e   013c     MOVLB     0x3c           		DATA	0x013C                                                                    D:\PIC18_Project\p18MATH.ASM
000b80   013a     MOVLB     0x3a           		DATA	0x013A                                                                    D:\PIC18_Project\p18MATH.ASM
000b82   0139     MOVLB     0x39           		DATA	0x0139                                                                    D:\PIC18_Project\p18MATH.ASM
000b84   0137     MOVLB     0x37           		DATA	0x0137                                                                    D:\PIC18_Project\p18MATH.ASM
000b86   0136     MOVLB     0x36           		DATA	0x0136                                                                    D:\PIC18_Project\p18MATH.ASM
000b88   0134     MOVLB     0x34           		DATA	0x0134                                                                    D:\PIC18_Project\p18MATH.ASM
000b8a   0133     MOVLB     0x33           		DATA	0x0133                                                                    D:\PIC18_Project\p18MATH.ASM
000b8c   0131     MOVLB     0x31           		DATA	0x0131                                                                    D:\PIC18_Project\p18MATH.ASM
000b8e   0130     MOVLB     0x30           		DATA	0x0130                                                                    D:\PIC18_Project\p18MATH.ASM
000b90   012f     MOVLB     0x2f           		DATA	0x012F                                                                    D:\PIC18_Project\p18MATH.ASM
000b92   012d     MOVLB     0x2d           		DATA	0x012D                                                                    D:\PIC18_Project\p18MATH.ASM
000b94   012c     MOVLB     0x2c           		DATA	0x012C                                                                    D:\PIC18_Project\p18MATH.ASM
000b96   012a     MOVLB     0x2a           		DATA	0x012A                                                                    D:\PIC18_Project\p18MATH.ASM
000b98   0129     MOVLB     0x29           		DATA	0x0129                                                                    D:\PIC18_Project\p18MATH.ASM
000b9a   0128     MOVLB     0x28           		DATA	0x0128                                                                    D:\PIC18_Project\p18MATH.ASM
000b9c   0126     MOVLB     0x26           		DATA	0x0126                                                                    D:\PIC18_Project\p18MATH.ASM
000b9e   0125     MOVLB     0x25           		DATA	0x0125                                                                    D:\PIC18_Project\p18MATH.ASM
000ba0   0124     MOVLB     0x24           		DATA	0x0124                                                                    D:\PIC18_Project\p18MATH.ASM
000ba2   0122     MOVLB     0x22           		DATA	0x0122                                                                    D:\PIC18_Project\p18MATH.ASM
000ba4   0121     MOVLB     0x21           		DATA	0x0121                                                                    D:\PIC18_Project\p18MATH.ASM
000ba6   0120     MOVLB     0x20           		DATA	0x0120                                                                    D:\PIC18_Project\p18MATH.ASM
000ba8   011f     MOVLB     0x1f           		DATA	0x011F                                                                    D:\PIC18_Project\p18MATH.ASM
000baa   011d     MOVLB     0x1d           		DATA	0x011D                                                                    D:\PIC18_Project\p18MATH.ASM
000bac   011c     MOVLB     0x1c           		DATA	0x011C                                                                    D:\PIC18_Project\p18MATH.ASM
000bae   011b     MOVLB     0x1b           		DATA	0x011B                                                                    D:\PIC18_Project\p18MATH.ASM
000bb0   011a     MOVLB     0x1a           		DATA	0x011A                                                                    D:\PIC18_Project\p18MATH.ASM
000bb2   0119     MOVLB     0x19           		DATA	0x0119                                                                    D:\PIC18_Project\p18MATH.ASM
000bb4   0117     MOVLB     0x17           		DATA	0x0117                                                                    D:\PIC18_Project\p18MATH.ASM
000bb6   0116     MOVLB     0x16           		DATA	0x0116                                                                    D:\PIC18_Project\p18MATH.ASM
000bb8   0115     MOVLB     0x15           		DATA	0x0115                                                                    D:\PIC18_Project\p18MATH.ASM
000bba   0114     MOVLB     0x14           		DATA	0x0114                                                                    D:\PIC18_Project\p18MATH.ASM
000bbc   0113     MOVLB     0x13           		DATA	0x0113                                                                    D:\PIC18_Project\p18MATH.ASM
000bbe   0112     MOVLB     0x12           		DATA	0x0112                                                                    D:\PIC18_Project\p18MATH.ASM
000bc0   0110     MOVLB     0x10           		DATA	0x0110                                                                    D:\PIC18_Project\p18MATH.ASM
000bc2   010f     MOVLB     0xf            		DATA	0x010F                                                                    D:\PIC18_Project\p18MATH.ASM
000bc4   010e     MOVLB     0xe            		DATA	0x010E                                                                    D:\PIC18_Project\p18MATH.ASM
000bc6   010d     MOVLB     0xd            		DATA	0x010D                                                                    D:\PIC18_Project\p18MATH.ASM
000bc8   010c     MOVLB     0xc            		DATA	0x010C                                                                    D:\PIC18_Project\p18MATH.ASM
000bca   010b     MOVLB     0xb            		DATA	0x010B                                                                    D:\PIC18_Project\p18MATH.ASM
000bcc   010a     MOVLB     0xa            		DATA	0x010A                                                                    D:\PIC18_Project\p18MATH.ASM
000bce   0109     MOVLB     0x9            		DATA	0x0109                                                                    D:\PIC18_Project\p18MATH.ASM
000bd0   0108     MOVLB     0x8            		DATA	0x0108                                                                    D:\PIC18_Project\p18MATH.ASM
000bd2   0107     MOVLB     0x7            		DATA	0x0107                                                                    D:\PIC18_Project\p18MATH.ASM
000bd4   0106     MOVLB     0x6            		DATA	0x0106                                                                    D:\PIC18_Project\p18MATH.ASM
000bd6   0105     MOVLB     0x5            		DATA	0x0105                                                                    D:\PIC18_Project\p18MATH.ASM
000bd8   0104     MOVLB     0x4            		DATA	0x0104                                                                    D:\PIC18_Project\p18MATH.ASM
000bda   0103     MOVLB     0x3            		DATA	0x0103                                                                    D:\PIC18_Project\p18MATH.ASM
000bdc   0102     MOVLB     0x2            		DATA	0x0102                                                                    D:\PIC18_Project\p18MATH.ASM
000bde   0101     MOVLB     0x1            		DATA	0x0101	                                                                   D:\PIC18_Project\p18MATH.ASM
                                                                                                                            D:\PIC18_Project\p18MATH.ASM
                                           		end                                                                            D:\PIC18_Project\p18MATH.ASM
                                           ;************************************************************************        D:\PIC18_Project\p18LCD.ASM
                                           ;*	Microchip Technology Inc. 2002					*                                          D:\PIC18_Project\p18LCD.ASM
                                           ;*	Assembler version: 2.0000					*                                               D:\PIC18_Project\p18LCD.ASM
                                           ;*	Filename: 							*                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;*		p18lcd.asm (main routine)   				*                                            D:\PIC18_Project\p18LCD.ASM
                                           ;*	Dependents:							*                                                           D:\PIC18_Project\p18LCD.ASM
                                           ;*		p18demo.asm						*                                                           D:\PIC18_Project\p18LCD.ASM
                                           ;*		p18math.asm						*                                                           D:\PIC18_Project\p18LCD.ASM
                                           ;*		16f877.lkr						*                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;*	March 14,2002							*                                                         D:\PIC18_Project\p18LCD.ASM
                                           ;* 	PICDEM 2 PLUS DEMO code. The following functions are included 	*             D:\PIC18_Project\p18LCD.ASM
                                           ;*	with this code:							*                                                       D:\PIC18_Project\p18LCD.ASM
                                           ;*		1. Voltmeter						*                                                          D:\PIC18_Project\p18LCD.ASM
                                           ;*			The center tap of R16 is connected to RA0, the	*                            D:\PIC18_Project\p18LCD.ASM
                                           ;*			A/D converter converts this analog voltage and	*                            D:\PIC18_Project\p18LCD.ASM
                                           ;*			the result is displayed on the LCD in a range	*                             D:\PIC18_Project\p18LCD.ASM
                                           ;*			from 0.00V - 5.00V.				*                                                    D:\PIC18_Project\p18LCD.ASM
                                           ;*		2. Buzzer						*                                                             D:\PIC18_Project\p18LCD.ASM
                                           ;*			The Piezo buzzer is connected to RC2 and is	*                               D:\PIC18_Project\p18LCD.ASM
                                           ;*			driven by the CCP1 module. The period and duty	*                            D:\PIC18_Project\p18LCD.ASM
                                           ;*			cycle are adjustable on the fly through the LCD	*                           D:\PIC18_Project\p18LCD.ASM
                                           ;*			and push-buttons.				*                                                      D:\PIC18_Project\p18LCD.ASM
                                           ;*		3. Temperature						*                                                        D:\PIC18_Project\p18LCD.ASM
                                           ;*			A TC74 Serial Digital Thermal Sensor is used to	*                           D:\PIC18_Project\p18LCD.ASM
                                           ;*			measure ambient temperature. The PIC and TC74	*                             D:\PIC18_Project\p18LCD.ASM
                                           ;* 			communicate using the MSSP module. The TC74 is	*                           D:\PIC18_Project\p18LCD.ASM
                                           ;*			connected to the SDA & SCL I/O pins of the PIC	*                            D:\PIC18_Project\p18LCD.ASM
                                           ;*			and functions as a slave.			*                                               D:\PIC18_Project\p18LCD.ASM
                                           ;*		4. Clock						*                                                              D:\PIC18_Project\p18LCD.ASM
                                           ;*			This function is a real-time clock. When the	*                              D:\PIC18_Project\p18LCD.ASM
                                           ;*			mode is entered, time begins at 00:00:00. The 	*                            D:\PIC18_Project\p18LCD.ASM
                                           ;*			user can set the time if desired.		*                                        D:\PIC18_Project\p18LCD.ASM
                                           ;************************************************************************        D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	list p=18f452                                                                   D:\PIC18_Project\p18LCD.ASM
                                           	#include p18f452.inc                                                            D:\PIC18_Project\p18LCD.ASM
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                           ; P18F452.INC  Standard Header File, Version 1.4   Microchip Technology, Inc.    C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D4		PORTD, 0	; LCD data bits                                         D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D5		PORTD, 1                                                         D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D6		PORTD, 2                                                         D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D7		PORTD, 3                                                         D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D4_DIR	TRISD, 0	; LCD data bits                                      D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D5_DIR	TRISD, 1                                                      D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D6_DIR	TRISD, 2                                                      D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_D7_DIR	TRISD, 3                                                      D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_E		PORTA, 1	; LCD E clock                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_RW		PORTA, 2	; LCD read/write line                                   D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_RS		PORTA, 3	; LCD register select line                              D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_E_DIR	TRISA, 1	                                                      D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_RW_DIR	TRISA, 2	                                                     D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_RS_DIR	TRISA, 3	                                                     D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_INS		0	                                                              D:\PIC18_Project\p18LCD.ASM
                                           #define	LCD_DATA	1                                                               D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           D_LCD_DATA	UDATA                                                                 D:\PIC18_Project\p18LCD.ASM
                                           COUNTER		res	1                                                                   D:\PIC18_Project\p18LCD.ASM
                                           delay		res	1                                                                     D:\PIC18_Project\p18LCD.ASM
                                           temp_wr		res	1                                                                   D:\PIC18_Project\p18LCD.ASM
                                           temp_rd		res	1                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	temp_wr                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           PROG1	CODE                                                                       D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;***************************************************************************     D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
                                           LCDLine_1                                                                        D:\PIC18_Project\p18LCD.ASM
00002a   0e80     MOVLW     0x80           	movlw	0x80                                                                      D:\PIC18_Project\p18LCD.ASM
00002c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
00002e   d80e     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
000030   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	LCDLine_1                                                                D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           LCDLine_2                                                                        D:\PIC18_Project\p18LCD.ASM
000032   0ec0     MOVLW     0xc0           	movlw	0xC0                                                                      D:\PIC18_Project\p18LCD.ASM
000034   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
000036   d80a     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
000038   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	LCDLine_2                                                                D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	;write data                                                                     D:\PIC18_Project\p18LCD.ASM
                                           d_write                                                                          D:\PIC18_Project\p18LCD.ASM
00003a   c0a1     MOVFF     0xa1,0xfad     	movff	temp_wr,TXREG                                                             D:\PIC18_Project\p18LCD.ASM
00003c   ffad                                                                                                               
00003e   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT                                                                D:\PIC18_Project\p18LCD.ASM
000040   ef1f     GOTO      0x3e           	goto	$-2                                                                        D:\PIC18_Project\p18LCD.ASM
000042   f000                                                                                                               
000044   d8a5     RCALL     0x190          	rcall	LCDBusy                                                                   D:\PIC18_Project\p18LCD.ASM
000046   80d8     BSF       0xd8,0x0,0x0   	bsf	STATUS, C	                                                                  D:\PIC18_Project\p18LCD.ASM
000048   d860     RCALL     0x10a          	rcall	LCDWrite                                                                  D:\PIC18_Project\p18LCD.ASM
00004a   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	d_write                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	;write instruction                                                              D:\PIC18_Project\p18LCD.ASM
                                           i_write                                                                          D:\PIC18_Project\p18LCD.ASM
00004c   d8a1     RCALL     0x190          	rcall	LCDBusy                                                                   D:\PIC18_Project\p18LCD.ASM
00004e   90d8     BCF       0xd8,0x0,0x0   	bcf	STATUS, C                                                                   D:\PIC18_Project\p18LCD.ASM
000050   d85c     RCALL     0x10a          	rcall	LCDWrite                                                                  D:\PIC18_Project\p18LCD.ASM
000052   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                            	GLOBAL	i_write                                                                 D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           rlcd	macro	MYREGISTER                                                            D:\PIC18_Project\p18LCD.ASM
                                            IF MYREGISTER == 1                                                              D:\PIC18_Project\p18LCD.ASM
                                           	bsf	STATUS, C                                                                   D:\PIC18_Project\p18LCD.ASM
                                           	rcall	LCDRead                                                                   D:\PIC18_Project\p18LCD.ASM
                                            ELSE                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	bcf	STATUS, C                                                                   D:\PIC18_Project\p18LCD.ASM
                                           	rcall	LCDRead                                                                   D:\PIC18_Project\p18LCD.ASM
                                            ENDIF                                                                           D:\PIC18_Project\p18LCD.ASM
                                           	endm                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;****************************************************************************    D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           LCDInit                                                                          D:\PIC18_Project\p18LCD.ASM
000054   6a80     CLRF      0x80,0x0       	clrf	PORTA                                                                      D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
000056   9292     BCF       0x92,0x1,0x0   	bcf	LCD_E_DIR		;configure control lines                                         D:\PIC18_Project\p18LCD.ASM
000058   9492     BCF       0x92,0x2,0x0   	bcf	LCD_RW_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
00005a   9692     BCF       0x92,0x3,0x0   	bcf	LCD_RS_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
00005c   0e0e     MOVLW     0xe            	movlw	b'00001110'                                                               D:\PIC18_Project\p18LCD.ASM
00005e   6ec1     MOVWF     0xc1,0x0       	movwf	ADCON1	                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000060   0eff     MOVLW     0xff           	movlw	0xff			; Wait ~15ms @ 20 MHz                                              D:\PIC18_Project\p18LCD.ASM
000062   6f9f     MOVWF     0x9f,0x1       	movwf	COUNTER                                                                   D:\PIC18_Project\p18LCD.ASM
                                           lil1                                                                             D:\PIC18_Project\p18LCD.ASM
000064   0eff     MOVLW     0xff           	movlw	0xFF                                                                      D:\PIC18_Project\p18LCD.ASM
000066   6fa0     MOVWF     0xa0,0x1       	movwf	delay                                                                     D:\PIC18_Project\p18LCD.ASM
000068   d898     RCALL     0x19a          	rcall	DelayXCycles                                                              D:\PIC18_Project\p18LCD.ASM
00006a   2f9f     DECFSZ    0x9f,0x1,0x1   	decfsz	COUNTER,F                                                                D:\PIC18_Project\p18LCD.ASM
00006c   d7fb     BRA       0x64           	bra	lil1                                                                        D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
00006e   0e30     MOVLW     0x30           	movlw	b'00110000'		;#1 Send control sequence                                    D:\PIC18_Project\p18LCD.ASM
000070   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
000072   90d8     BCF       0xd8,0x0,0x0   	bcf	STATUS,C                                                                    D:\PIC18_Project\p18LCD.ASM
000074   d82a     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000076   0eff     MOVLW     0xff           	movlw	0xff			;Wait ~4ms @ 20 MHz                                                D:\PIC18_Project\p18LCD.ASM
000078   6f9f     MOVWF     0x9f,0x1       	movwf	COUNTER                                                                   D:\PIC18_Project\p18LCD.ASM
                                           lil2                                                                             D:\PIC18_Project\p18LCD.ASM
00007a   0eff     MOVLW     0xff           	movlw	0xFF                                                                      D:\PIC18_Project\p18LCD.ASM
00007c   6fa0     MOVWF     0xa0,0x1       	movwf	delay                                                                     D:\PIC18_Project\p18LCD.ASM
00007e   d88d     RCALL     0x19a          	rcall	DelayXCycles                                                              D:\PIC18_Project\p18LCD.ASM
000080   2f9f     DECFSZ    0x9f,0x1,0x1   	decfsz	COUNTER,F                                                                D:\PIC18_Project\p18LCD.ASM
000082   d7fb     BRA       0x7a           	bra	lil2                                                                        D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000084   0e30     MOVLW     0x30           	movlw	b'00110000'		;#2 Send control sequence                                    D:\PIC18_Project\p18LCD.ASM
000086   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
000088   90d8     BCF       0xd8,0x0,0x0   	bcf	STATUS,C                                                                    D:\PIC18_Project\p18LCD.ASM
00008a   d81f     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00008c   0eff     MOVLW     0xff           	movlw	0xFF			;Wait ~100us @ 20 MHz                                              D:\PIC18_Project\p18LCD.ASM
00008e   6fa0     MOVWF     0xa0,0x1       	movwf	delay                                                                     D:\PIC18_Project\p18LCD.ASM
000090   d884     RCALL     0x19a          	rcall	DelayXCycles                                                              D:\PIC18_Project\p18LCD.ASM
                                           						                                                                           D:\PIC18_Project\p18LCD.ASM
000092   0e18     MOVLW     0x18           	movlw	b'0011000'		;#3 Send control sequence                                     D:\PIC18_Project\p18LCD.ASM
000094   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
000096   90d8     BCF       0xd8,0x0,0x0   	bcf	STATUS,C                                                                    D:\PIC18_Project\p18LCD.ASM
000098   d818     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           		;test delay                                                                    D:\PIC18_Project\p18LCD.ASM
00009a   0eff     MOVLW     0xff           	movlw	0xFF			;Wait ~100us @ 20 MHz                                              D:\PIC18_Project\p18LCD.ASM
00009c   6fa0     MOVWF     0xa0,0x1       	movwf	delay                                                                     D:\PIC18_Project\p18LCD.ASM
00009e   d87d     RCALL     0x19a          	rcall	DelayXCycles                                                              D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000a0   0e20     MOVLW     0x20           	movlw	b'00100000'		;#4 set 4-bit                                                D:\PIC18_Project\p18LCD.ASM
0000a2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000a4   90d8     BCF       0xd8,0x0,0x0   	bcf	STATUS,C                                                                    D:\PIC18_Project\p18LCD.ASM
0000a6   d811     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000a8   d873     RCALL     0x190          	rcall	LCDBusy			;Busy?                                                          D:\PIC18_Project\p18LCD.ASM
                                           				                                                                             D:\PIC18_Project\p18LCD.ASM
0000aa   0e28     MOVLW     0x28           	movlw	b'00101000'		;#5   Function set                                           D:\PIC18_Project\p18LCD.ASM
0000ac   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000ae   dfce     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000b0   0e0d     MOVLW     0xd            	movlw	b'00001101'		;#6  Display = ON                                            D:\PIC18_Project\p18LCD.ASM
0000b2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000b4   dfcb     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
                                           			                                                                              D:\PIC18_Project\p18LCD.ASM
0000b6   0e01     MOVLW     0x1            	movlw	b'00000001'		;#7   Display Clear                                          D:\PIC18_Project\p18LCD.ASM
0000b8   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000ba   dfc8     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000bc   0e06     MOVLW     0x6            	movlw	b'00000110'		;#8   Entry Mode                                             D:\PIC18_Project\p18LCD.ASM
0000be   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000c0   dfc5     RCALL     0x4c           	rcall	i_write	                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000c2   0e80     MOVLW     0x80           	movlw	b'10000000'		;DDRAM addresss 0000                                         D:\PIC18_Project\p18LCD.ASM
0000c4   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18LCD.ASM
0000c6   dfc2     RCALL     0x4c           	rcall	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;	movlw	b'00000010'		;return home                                                D:\PIC18_Project\p18LCD.ASM
                                           ;	movwf	temp_wr                                                                  D:\PIC18_Project\p18LCD.ASM
                                           ;	call	i_write                                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000c8   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	LCDInit	                                                                 D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ;****************************************************************************    D:\PIC18_Project\p18LCD.ASM
                                           ;     _    ______________________________                                        D:\PIC18_Project\p18LCD.ASM
                                           ; RS  _>--<______________________________                                        D:\PIC18_Project\p18LCD.ASM
                                           ;     _____                                                                      D:\PIC18_Project\p18LCD.ASM
                                           ; RW       \_____________________________                                        D:\PIC18_Project\p18LCD.ASM
                                           ;                  __________________                                            D:\PIC18_Project\p18LCD.ASM
                                           ; E   ____________/                  \___                                        D:\PIC18_Project\p18LCD.ASM
                                           ;     _____________                ______                                        D:\PIC18_Project\p18LCD.ASM
                                           ; DB  _____________>--------------<______                                        D:\PIC18_Project\p18LCD.ASM
                                           ;                                                                                D:\PIC18_Project\p18LCD.ASM
                                           LCDWriteNibble                                                                   D:\PIC18_Project\p18LCD.ASM
0000ca   a0d8     BTFSS     0xd8,0x0,0x0   	btfss	STATUS, C		; Set the register select                                      D:\PIC18_Project\p18LCD.ASM
0000cc   9680     BCF       0x80,0x3,0x0   	bcf	LCD_RS                                                                      D:\PIC18_Project\p18LCD.ASM
0000ce   b0d8     BTFSC     0xd8,0x0,0x0   	btfsc	STATUS, C	                                                                D:\PIC18_Project\p18LCD.ASM
0000d0   8680     BSF       0x80,0x3,0x0   	bsf	LCD_RS                                                                      D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000d2   9480     BCF       0x80,0x2,0x0   	bcf	LCD_RW			; Set write mode                                                   D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000d4   9095     BCF       0x95,0x0,0x0   	bcf	LCD_D4_DIR		; Set data bits to outputs                                      D:\PIC18_Project\p18LCD.ASM
0000d6   9295     BCF       0x95,0x1,0x0   	bcf	LCD_D5_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
0000d8   9495     BCF       0x95,0x2,0x0   	bcf	LCD_D6_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
0000da   9695     BCF       0x95,0x3,0x0   	bcf	LCD_D7_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000dc   0000     NOP                      	NOP				; Small delay                                                            D:\PIC18_Project\p18LCD.ASM
0000de   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
0000e0   8280     BSF       0x80,0x1,0x0   	bsf	LCD_E			; Setup to clock data                                               D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
0000e2   afa1     BTFSS     0xa1,0x7,0x1   	btfss	temp_wr, 7			; Set high nibble                                            D:\PIC18_Project\p18LCD.ASM
0000e4   9683     BCF       0x83,0x3,0x0   	bcf	LCD_D7	                                                                     D:\PIC18_Project\p18LCD.ASM
0000e6   bfa1     BTFSC     0xa1,0x7,0x1   	btfsc	temp_wr, 7                                                                D:\PIC18_Project\p18LCD.ASM
0000e8   8683     BSF       0x83,0x3,0x0   	bsf	LCD_D7                                                                      D:\PIC18_Project\p18LCD.ASM
0000ea   ada1     BTFSS     0xa1,0x6,0x1   	btfss	temp_wr, 6                                                                D:\PIC18_Project\p18LCD.ASM
0000ec   9483     BCF       0x83,0x2,0x0   	bcf	LCD_D6	                                                                     D:\PIC18_Project\p18LCD.ASM
0000ee   bda1     BTFSC     0xa1,0x6,0x1   	btfsc	temp_wr, 6                                                                D:\PIC18_Project\p18LCD.ASM
0000f0   8483     BSF       0x83,0x2,0x0   	bsf	LCD_D6                                                                      D:\PIC18_Project\p18LCD.ASM
0000f2   aba1     BTFSS     0xa1,0x5,0x1   	btfss	temp_wr, 5                                                                D:\PIC18_Project\p18LCD.ASM
0000f4   9283     BCF       0x83,0x1,0x0   	bcf	LCD_D5	                                                                     D:\PIC18_Project\p18LCD.ASM
0000f6   bba1     BTFSC     0xa1,0x5,0x1   	btfsc	temp_wr, 5                                                                D:\PIC18_Project\p18LCD.ASM
0000f8   8283     BSF       0x83,0x1,0x0   	bsf	LCD_D5                                                                      D:\PIC18_Project\p18LCD.ASM
0000fa   a9a1     BTFSS     0xa1,0x4,0x1   	btfss	temp_wr, 4                                                                D:\PIC18_Project\p18LCD.ASM
0000fc   9083     BCF       0x83,0x0,0x0   	bcf	LCD_D4                                                                      D:\PIC18_Project\p18LCD.ASM
0000fe   b9a1     BTFSC     0xa1,0x4,0x1   	btfsc	temp_wr, 4                                                                D:\PIC18_Project\p18LCD.ASM
000100   8083     BSF       0x83,0x0,0x0   	bsf	LCD_D4	                                                                     D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000102   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000104   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000106   9280     BCF       0x80,0x1,0x0   	bcf	LCD_E			; Send the data                                                     D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000108   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           LCDWrite                                                                         D:\PIC18_Project\p18LCD.ASM
                                           ;	rcall	LCDBusy                                                                  D:\PIC18_Project\p18LCD.ASM
00010a   dfdf     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
00010c   3ba1     SWAPF     0xa1,0x1,0x1   	swapf	temp_wr,F                                                                 D:\PIC18_Project\p18LCD.ASM
00010e   dfdd     RCALL     0xca           	rcall	LCDWriteNibble                                                            D:\PIC18_Project\p18LCD.ASM
000110   3ba1     SWAPF     0xa1,0x1,0x1   	swapf	temp_wr,F                                                                 D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000112   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	LCDWrite                                                                 D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           ;     _____    _____________________________________________________             D:\PIC18_Project\p18LCD.ASM
                                           ; RS  _____>--<_____________________________________________________             D:\PIC18_Project\p18LCD.ASM
                                           ;               ____________________________________________________             D:\PIC18_Project\p18LCD.ASM
                                           ; RW  _________/                                                                 D:\PIC18_Project\p18LCD.ASM
                                           ;                  ____________________      ____________________                D:\PIC18_Project\p18LCD.ASM
                                           ; E   ____________/                    \____/                    \__             D:\PIC18_Project\p18LCD.ASM
                                           ;     _________________                __________                ___             D:\PIC18_Project\p18LCD.ASM
                                           ; DB  _________________>--------------<__________>--------------<___             D:\PIC18_Project\p18LCD.ASM
                                           ;                                                                                D:\PIC18_Project\p18LCD.ASM
                                           LCDRead                                                                          D:\PIC18_Project\p18LCD.ASM
000114   8095     BSF       0x95,0x0,0x0   	bsf	LCD_D4_DIR		; Set data bits to inputs                                       D:\PIC18_Project\p18LCD.ASM
000116   8295     BSF       0x95,0x1,0x0   	bsf	LCD_D5_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
000118   8495     BSF       0x95,0x2,0x0   	bsf	LCD_D6_DIR                                                                  D:\PIC18_Project\p18LCD.ASM
00011a   8695     BSF       0x95,0x3,0x0   	bsf	LCD_D7_DIR		                                                                D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00011c   a0d8     BTFSS     0xd8,0x0,0x0   	btfss	STATUS, C		; Set the register select                                      D:\PIC18_Project\p18LCD.ASM
00011e   9680     BCF       0x80,0x3,0x0   	bcf	LCD_RS                                                                      D:\PIC18_Project\p18LCD.ASM
000120   b0d8     BTFSC     0xd8,0x0,0x0   	btfsc	STATUS, C	                                                                D:\PIC18_Project\p18LCD.ASM
000122   8680     BSF       0x80,0x3,0x0   	bsf	LCD_RS                                                                      D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000124   8480     BSF       0x80,0x2,0x0   	bsf	LCD_RW			;Read = 1                                                          D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000126   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000128   0000     NOP                      	NOP			                                                                          D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00012a   8280     BSF       0x80,0x1,0x0   	bsf	LCD_E			; Setup to clock data                                               D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00012c   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
00012e   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000130   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000132   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000134   a683     BTFSS     0x83,0x3,0x0   	btfss	LCD_D7			; Get high nibble                                                D:\PIC18_Project\p18LCD.ASM
000136   9fa2     BCF       0xa2,0x7,0x1   	bcf	temp_rd, 7                                                                  D:\PIC18_Project\p18LCD.ASM
000138   b683     BTFSC     0x83,0x3,0x0   	btfsc	LCD_D7                                                                    D:\PIC18_Project\p18LCD.ASM
00013a   8fa2     BSF       0xa2,0x7,0x1   	bsf	temp_rd, 7                                                                  D:\PIC18_Project\p18LCD.ASM
00013c   a483     BTFSS     0x83,0x2,0x0   	btfss	LCD_D6			                                                                 D:\PIC18_Project\p18LCD.ASM
00013e   9da2     BCF       0xa2,0x6,0x1   	bcf	temp_rd, 6                                                                  D:\PIC18_Project\p18LCD.ASM
000140   b483     BTFSC     0x83,0x2,0x0   	btfsc	LCD_D6                                                                    D:\PIC18_Project\p18LCD.ASM
000142   8da2     BSF       0xa2,0x6,0x1   	bsf	temp_rd, 6                                                                  D:\PIC18_Project\p18LCD.ASM
000144   a283     BTFSS     0x83,0x1,0x0   	btfss	LCD_D5			                                                                 D:\PIC18_Project\p18LCD.ASM
000146   9ba2     BCF       0xa2,0x5,0x1   	bcf	temp_rd, 5                                                                  D:\PIC18_Project\p18LCD.ASM
000148   b283     BTFSC     0x83,0x1,0x0   	btfsc	LCD_D5                                                                    D:\PIC18_Project\p18LCD.ASM
00014a   8ba2     BSF       0xa2,0x5,0x1   	bsf	temp_rd, 5                                                                  D:\PIC18_Project\p18LCD.ASM
00014c   a083     BTFSS     0x83,0x0,0x0   	btfss	LCD_D4			                                                                 D:\PIC18_Project\p18LCD.ASM
00014e   99a2     BCF       0xa2,0x4,0x1   	bcf	temp_rd, 4                                                                  D:\PIC18_Project\p18LCD.ASM
000150   b083     BTFSC     0x83,0x0,0x0   	btfsc	LCD_D4                                                                    D:\PIC18_Project\p18LCD.ASM
000152   89a2     BSF       0xa2,0x4,0x1   	bsf	temp_rd, 4                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000154   9280     BCF       0x80,0x1,0x0   	bcf	LCD_E			; Finished reading the data                                         D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000156   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000158   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
00015a   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
00015c   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
00015e   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000160   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000162   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
000164   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000166   8280     BSF       0x80,0x1,0x0   	bsf	LCD_E			; Setup to clock data                                               D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
000168   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
00016a   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00016c   a683     BTFSS     0x83,0x3,0x0   	btfss	LCD_D7			; Get low nibble                                                 D:\PIC18_Project\p18LCD.ASM
00016e   97a2     BCF       0xa2,0x3,0x1   	bcf	temp_rd, 3                                                                  D:\PIC18_Project\p18LCD.ASM
000170   b683     BTFSC     0x83,0x3,0x0   	btfsc	LCD_D7                                                                    D:\PIC18_Project\p18LCD.ASM
000172   87a2     BSF       0xa2,0x3,0x1   	bsf	temp_rd, 3                                                                  D:\PIC18_Project\p18LCD.ASM
000174   a483     BTFSS     0x83,0x2,0x0   	btfss	LCD_D6			                                                                 D:\PIC18_Project\p18LCD.ASM
000176   95a2     BCF       0xa2,0x2,0x1   	bcf	temp_rd, 2                                                                  D:\PIC18_Project\p18LCD.ASM
000178   b483     BTFSC     0x83,0x2,0x0   	btfsc	LCD_D6                                                                    D:\PIC18_Project\p18LCD.ASM
00017a   85a2     BSF       0xa2,0x2,0x1   	bsf	temp_rd, 2                                                                  D:\PIC18_Project\p18LCD.ASM
00017c   a283     BTFSS     0x83,0x1,0x0   	btfss	LCD_D5			                                                                 D:\PIC18_Project\p18LCD.ASM
00017e   93a2     BCF       0xa2,0x1,0x1   	bcf	temp_rd, 1                                                                  D:\PIC18_Project\p18LCD.ASM
000180   b283     BTFSC     0x83,0x1,0x0   	btfsc	LCD_D5                                                                    D:\PIC18_Project\p18LCD.ASM
000182   83a2     BSF       0xa2,0x1,0x1   	bsf	temp_rd, 1                                                                  D:\PIC18_Project\p18LCD.ASM
000184   a083     BTFSS     0x83,0x0,0x0   	btfss	LCD_D4			                                                                 D:\PIC18_Project\p18LCD.ASM
000186   91a2     BCF       0xa2,0x0,0x1   	bcf	temp_rd, 0                                                                  D:\PIC18_Project\p18LCD.ASM
000188   b083     BTFSC     0x83,0x0,0x0   	btfsc	LCD_D4                                                                    D:\PIC18_Project\p18LCD.ASM
00018a   81a2     BSF       0xa2,0x0,0x1   	bsf	temp_rd, 0                                                                  D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
00018c   9280     BCF       0x80,0x1,0x0   	bcf	LCD_E			; Finished reading the data                                         D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           FinRd                                                                            D:\PIC18_Project\p18LCD.ASM
00018e   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           LCDBusy                                                                          D:\PIC18_Project\p18LCD.ASM
                                           					; Check BF                                                                  D:\PIC18_Project\p18LCD.ASM
000190   90d8     BCF       0xd8,0x0,0x0   	rlcd	LCD_INS                                                                    D:\PIC18_Project\p18LCD.ASM
000192   dfc0     RCALL     0x114                                                                                           
000194   bfa2     BTFSC     0xa2,0x7,0x1   	btfsc	temp_rd, 7                                                                D:\PIC18_Project\p18LCD.ASM
000196   d7fc     BRA       0x190          	bra	LCDBusy                                                                     D:\PIC18_Project\p18LCD.ASM
000198   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	GLOBAL	LCDBusy                                                                  D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           DelayXCycles                                                                     D:\PIC18_Project\p18LCD.ASM
00019a   2fa0     DECFSZ    0xa0,0x1,0x1   	decfsz	delay,F                                                                  D:\PIC18_Project\p18LCD.ASM
00019c   d7fe     BRA       0x19a          	bra	DelayXCycles                                                                D:\PIC18_Project\p18LCD.ASM
00019e   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18LCD.ASM
                                           ; *******************************************************************            D:\PIC18_Project\p18LCD.ASM
                                           	                                                                                D:\PIC18_Project\p18LCD.ASM
                                                                                                                            D:\PIC18_Project\p18LCD.ASM
                                           	END                                                                             D:\PIC18_Project\p18LCD.ASM
                                           ;************************************************************************        D:\PIC18_Project\p18demo.asm
                                           ;*	Microchip Technology Inc. 2002										*                                     D:\PIC18_Project\p18demo.asm
                                           ;*	Assembler version: 2.0000											*                                         D:\PIC18_Project\p18demo.asm
                                           ;*	Filename: 															*                                                    D:\PIC18_Project\p18demo.asm
                                           ;*		p18demo.asm (main routine)   									*                                      D:\PIC18_Project\p18demo.asm
                                           ;*	Dependents:															*                                                   D:\PIC18_Project\p18demo.asm
                                           ;*		p18lcd.asm														*                                                    D:\PIC18_Project\p18demo.asm
                                           ;*		p18math.asm														*                                                   D:\PIC18_Project\p18demo.asm
                                           ;*		p2plsp18.lkr													*                                                   D:\PIC18_Project\p18demo.asm
                                           ;*	March 14,2002														*                                                  D:\PIC18_Project\p18demo.asm
                                           ;* 	PICDEM 2 PLUS DEMO code. The following functions are included 		*            D:\PIC18_Project\p18demo.asm
                                           ;*	with this code:														*                                                D:\PIC18_Project\p18demo.asm
                                           ;*		1. Voltmeter													*                                                   D:\PIC18_Project\p18demo.asm
                                           ;*			The center tap of R16 is connected to RA0, the				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			A/D converter converts this analog voltage and				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			the result is displayed on the LCD in a range				*                          D:\PIC18_Project\p18demo.asm
                                           ;*			from 0.00V - 5.00V.											*                                             D:\PIC18_Project\p18demo.asm
                                           ;*		2. Buzzer														*                                                     D:\PIC18_Project\p18demo.asm
                                           ;*			The Piezo buzzer is connected to RC2 and is					*                           D:\PIC18_Project\p18demo.asm
                                           ;*			driven by the CCP1 module. The period and duty				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			cycle are adjustable on the fly through the LCD				*                        D:\PIC18_Project\p18demo.asm
                                           ;*			and push-buttons.											*                                               D:\PIC18_Project\p18demo.asm
                                           ;*		3. Temperature													*                                                 D:\PIC18_Project\p18demo.asm
                                           ;*			A TC74 Serial Digital Thermal Sensor is used to				*                        D:\PIC18_Project\p18demo.asm
                                           ;*			measure ambient temperature. The PIC and TC74				*                          D:\PIC18_Project\p18demo.asm
                                           ;* 			communicate using the MSSP module. The TC74 is				*                        D:\PIC18_Project\p18demo.asm
                                           ;*			connected to the SDA & SCL I/O pins of the PIC				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			and functions as a slave. Every 2 seconds, the				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			temperature is logged into the external EEPROM  			*                        D:\PIC18_Project\p18demo.asm
                                           ;*			in a specific memory location.								*                                     D:\PIC18_Project\p18demo.asm
                                           ;*		4. Clock														*                                                      D:\PIC18_Project\p18demo.asm
                                           ;*			This function is a real-time clock. When the				*                           D:\PIC18_Project\p18demo.asm
                                           ;*			mode is entered, time begins at 00:00:00. The 				*                         D:\PIC18_Project\p18demo.asm
                                           ;*			user can set the time if desired.							*                                   D:\PIC18_Project\p18demo.asm
                                           ;*																		*                                                            D:\PIC18_Project\p18demo.asm
                                           ;*		The data that is sent to the LCD is also sent to the			*                     D:\PIC18_Project\p18demo.asm
                                           ;*		USART through the RS-232 port to be displayed on a PC			*                    D:\PIC18_Project\p18demo.asm
                                           ;*		HyperTerminal.													*                                                 D:\PIC18_Project\p18demo.asm
                                           ;*																		*                                                            D:\PIC18_Project\p18demo.asm
                                           ;* Revisions:															*                                                    D:\PIC18_Project\p18demo.asm
                                           ;*	1/23/04 Removed comments from Config Word Lines						*                        D:\PIC18_Project\p18demo.asm
                                           ;*		Changed the call for the 16/8 divide routine.					*                          D:\PIC18_Project\p18demo.asm
                                           ;************************************************************************        D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           	list p=18f452                                                                   D:\PIC18_Project\p18demo.asm
                                           	#include p18f452.inc                                                            D:\PIC18_Project\p18demo.asm
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                           ; P18F452.INC  Standard Header File, Version 1.4   Microchip Technology, Inc.    C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                   LIST                                                                     C:\Program Files\Microchip\MPASM Suite\p18f452.inc
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;Program Configuration Registers                                                 D:\PIC18_Project\p18demo.asm
300000   fcff     WORD2     0xcff          		__CONFIG    _CONFIG1H, _OSCS_OFF_1H & _EC_OSC_1H                               D:\PIC18_Project\p18demo.asm
                                           		__CONFIG    _CONFIG2L, _BOR_OFF_2L & _PWRT_ON_2L                               D:\PIC18_Project\p18demo.asm
300002   fefc     WORD2     0xefc          		__CONFIG    _CONFIG2H, _WDT_OFF_2H                                             D:\PIC18_Project\p18demo.asm
300004   feff     WORD2     0xeff          		__CONFIG    _CONFIG3H, _CCP2MX_OFF_3H                                          D:\PIC18_Project\p18demo.asm
300006   fffa     WORD2     0xffa          		__CONFIG    _CONFIG4L, _STVR_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L              D:\PIC18_Project\p18demo.asm
                                           		__CONFIG    _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L   D:\PIC18_Project\p18demo.asm
300008   ffff     WORD2     0xfff          		__CONFIG    _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H                               D:\PIC18_Project\p18demo.asm
                                           		__CONFIG    _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L  D:\PIC18_Project\p18demo.asm
30000a   ffff     WORD2     0xfff          		__CONFIG    _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H              D:\PIC18_Project\p18demo.asm
                                           		__CONFIG    _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L D:\PIC18_Project\p18demo.asm
30000c   ffff     WORD2     0xfff          		__CONFIG    _CONFIG7H, _EBTRB_OFF_7H                                           D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           	#define	scroll_dir	TRISA,4                                                      D:\PIC18_Project\p18demo.asm
                                           	#define	scroll		PORTA,4		;Push-button RA4 on PCB                                D:\PIC18_Project\p18demo.asm
                                           	#define	select_dir	TRISB,0		                                                    D:\PIC18_Project\p18demo.asm
                                           	#define	select		PORTB,0		;Push-button RB0 on PCB                                D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           	EXTERN	LCDInit, temp_wr, d_write, i_write, LCDLine_1, LCDLine_2                 D:\PIC18_Project\p18demo.asm
                                           	EXTERN	UMUL0808L, FXD1608U, AARGB0, AARGB1, BARGB0                              D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ssprw	macro				;check for idle SSP module routine                                D:\PIC18_Project\p18demo.asm
                                           	movlw	0x00                                                                      D:\PIC18_Project\p18demo.asm
                                           	andwf	SSPCON2,W                                                                 D:\PIC18_Project\p18demo.asm
                                           	sublw	0x00                                                                      D:\PIC18_Project\p18demo.asm
                                           	btfss	STATUS,Z                                                                  D:\PIC18_Project\p18demo.asm
                                           	bra	$-8                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           	btfsc	SSPSTAT,R_W                                                               D:\PIC18_Project\p18demo.asm
                                           	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                           	endm                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           variables	UDATA                                                                  D:\PIC18_Project\p18demo.asm
                                           ptr_pos		RES 1                                                                   D:\PIC18_Project\p18demo.asm
                                           ptr_count	RES 1                                                                  D:\PIC18_Project\p18demo.asm
                                           temp_1		RES 1                                                                    D:\PIC18_Project\p18demo.asm
                                           temp_2		RES 1                                                                    D:\PIC18_Project\p18demo.asm
                                           temp_3		RES 1                                                                    D:\PIC18_Project\p18demo.asm
                                           cmd_byte	RES 1                                                                   D:\PIC18_Project\p18demo.asm
                                           temperature	RES 1                                                                D:\PIC18_Project\p18demo.asm
                                           LSD			RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           MsD			RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           MSD			RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           seconds		RES 1                                                                   D:\PIC18_Project\p18demo.asm
                                           minutes		RES 1                                                                   D:\PIC18_Project\p18demo.asm
                                           hours		RES 1                                                                     D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           NumH		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           NumL		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           TenK		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           Thou		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           Hund		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           Tens		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                           Ones		RES 1                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           STARTUP CODE                                                                     D:\PIC18_Project\p18demo.asm
000000   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18demo.asm
000002   ef30     GOTO      0x260          	goto	start                                                                      D:\PIC18_Project\p18demo.asm
000004   f001                                                                                                               
000006   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18demo.asm
000008   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18demo.asm
00000a   0000     NOP                      	NOP                                                                             D:\PIC18_Project\p18demo.asm
                                           PROG1 	CODE                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           stan_table				;table for standard code                                           D:\PIC18_Project\p18demo.asm
                                           	;	"XXXXXXXXXXXXXXXX"                                                            D:\PIC18_Project\p18demo.asm
                                           	;				ptr:                                                                       D:\PIC18_Project\p18demo.asm
0001a0   2020     ADDWFC    0x20,0x0,0x0   	data	"   Voltmeter    "	;0                                                      D:\PIC18_Project\p18demo.asm
0001a2   5620     SUBFWB    0x20,0x1,0x0                                                                                    
0001a4   6c6f     NEGF      0x6f,0x0                                                                                        
0001a6   6d74     NEGF      0x74,0x1                                                                                        
0001a8   7465     BTG       0x65,0x2,0x0                                                                                    
0001aa   7265     BTG       0x65,0x1,0x0                                                                                    
0001ac   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001ae   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001b0   2020     ADDWFC    0x20,0x0,0x0   	data	"     Buzzer     "	;16                                                     D:\PIC18_Project\p18demo.asm
0001b2   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001b4   4220     RRNCF     0x20,0x1,0x0                                                                                    
0001b6   7a75     BTG       0x75,0x5,0x0                                                                                    
0001b8   657a     CPFSGT    0x7a,0x1                                                                                        
0001ba   2072     ADDWFC    0x72,0x0,0x0                                                                                    
0001bc   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001be   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001c0   2020     ADDWFC    0x20,0x0,0x0   	data	"  Temperature   "	;32                                                     D:\PIC18_Project\p18demo.asm
0001c2   6554     CPFSGT    0x54,0x1                                                                                        
0001c4   706d     BTG       0x6d,0x0,0x0                                                                                    
0001c6   7265     BTG       0x65,0x1,0x0                                                                                    
0001c8   7461     BTG       0x61,0x2,0x0                                                                                    
0001ca   7275     BTG       0x75,0x1,0x0                                                                                    
0001cc   2065     ADDWFC    0x65,0x0,0x0                                                                                    
0001ce   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001d0   2020     ADDWFC    0x20,0x0,0x0   	data	"     Clock      "	;48                                                     D:\PIC18_Project\p18demo.asm
0001d2   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001d4   4320     RRNCF     0x20,0x1,0x1                                                                                    
0001d6   6f6c     MOVWF     0x6c,0x1                                                                                        
0001d8   6b63     CLRF      0x63,0x1                                                                                        
0001da   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001dc   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001de   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001e0   4152     RRNCF     0x52,0x0,0x1   	data	"RA4=Next RB0=Now"	;64                                                     D:\PIC18_Project\p18demo.asm
0001e2   3d34     INCFSZ    0x34,0x0,0x1                                                                                    
0001e4   654e     CPFSGT    0x4e,0x1                                                                                        
0001e6   7478     BTG       0x78,0x2,0x0                                                                                    
0001e8   5220     MOVF      0x20,0x1,0x0                                                                                    
0001ea   3042     RRCF      0x42,0x0,0x0                                                                                    
0001ec   4e3d     DCFSNZ    0x3d,0x1,0x0                                                                                    
0001ee   776f     BTG       0x6f,0x3,0x1                                                                                    
0001f0   2020     ADDWFC    0x20,0x0,0x0   	data	"   Microchip    "      ;80                                                D:\PIC18_Project\p18demo.asm
0001f2   4d20     DCFSNZ    0x20,0x0,0x1                                                                                    
0001f4   6369     CPFSEQ    0x69,0x1                                                                                        
0001f6   6f72     MOVWF     0x72,0x1                                                                                        
0001f8   6863     SETF      0x63,0x0                                                                                        
0001fa   7069     BTG       0x69,0x0,0x0                                                                                    
0001fc   2020     ADDWFC    0x20,0x0,0x0                                                                                    
0001fe   2020     ADDWFC    0x20,0x0,0x0                                                                                    
000200   5020     MOVF      0x20,0x0,0x0   	data	" PICDEM 2 PLUS  "	;96                                                     D:\PIC18_Project\p18demo.asm
000202   4349     RRNCF     0x49,0x1,0x1                                                                                    
000204   4544     RLNCF     0x44,0x0,0x1                                                                                    
000206   204d     ADDWFC    0x4d,0x0,0x0                                                                                    
000208   2032     ADDWFC    0x32,0x0,0x0                                                                                    
00020a   4c50     DCFSNZ    0x50,0x0,0x0                                                                                    
00020c   5355     MOVF      0x55,0x1,0x1                                                                                    
00020e   2020     ADDWFC    0x20,0x0,0x0                                                                                    
000210   4152     RRNCF     0x52,0x0,0x1   	data	"RA4=Set RB0=Menu"	;112                                                    D:\PIC18_Project\p18demo.asm
000212   3d34     INCFSZ    0x34,0x0,0x1                                                                                    
000214   6553     CPFSGT    0x53,0x1                                                                                        
000216   2074     ADDWFC    0x74,0x0,0x0                                                                                    
000218   4252     RRNCF     0x52,0x1,0x0                                                                                    
00021a   3d30     INCFSZ    0x30,0x0,0x1                                                                                    
00021c   654d     CPFSGT    0x4d,0x1                                                                                        
00021e   756e     BTG       0x6e,0x2,0x1                                                                                    
000220   4152     RRNCF     0x52,0x0,0x1   	data	"RA4= --> RBO= ++"	;128                                                    D:\PIC18_Project\p18demo.asm
000222   3d34     INCFSZ    0x34,0x0,0x1                                                                                    
000224   2d20     DECFSZ    0x20,0x0,0x1                                                                                    
000226   3e2d     INCFSZ    0x2d,0x1,0x0                                                                                    
000228   5220     MOVF      0x20,0x1,0x0                                                                                    
00022a   4f42     DCFSNZ    0x42,0x1,0x1                                                                                    
00022c   203d     ADDWFC    0x3d,0x0,0x0                                                                                    
00022e   2b2b     INCF      0x2b,0x1,0x1                                                                                    
000230   2020     ADDWFC    0x20,0x0,0x0   	data	"   RB0 = Exit 	 "	;144                                                    D:\PIC18_Project\p18demo.asm
000232   5220     MOVF      0x20,0x1,0x0                                                                                    
000234   3042     RRCF      0x42,0x0,0x0                                                                                    
000236   3d20     INCFSZ    0x20,0x0,0x1                                                                                    
000238   4520     RLNCF     0x20,0x0,0x1                                                                                    
00023a   6978     SETF      0x78,0x1                                                                                        
00023c   2074     ADDWFC    0x74,0x0,0x0                                                                                    
00023e   2020     ADDWFC    0x20,0x0,0x0                                                                                    
000240   6f56     MOVWF     0x56,0x1       	data	"Volts =	 "	;160                                                           D:\PIC18_Project\p18demo.asm
000242   746c     BTG       0x6c,0x2,0x0                                                                                    
000244   2073     ADDWFC    0x73,0x0,0x0                                                                                    
000246   203d     ADDWFC    0x3d,0x0,0x0                                                                                    
000248   2020     ADDWFC    0x20,0x0,0x0                                                                                    
00024a   2020     ADDWFC    0x20,0x0,0x0                                                                                    
00024c   2020     ADDWFC    0x20,0x0,0x0                                                                                    
00024e   2020     ADDWFC    0x20,0x0,0x0                                                                                    
000250   7250     BTG       0x50,0x1,0x0   	data	"Prd.=128 DC=128 "	;176                                                    D:\PIC18_Project\p18demo.asm
000252   2e64     DECFSZ    0x64,0x1,0x0                                                                                    
000254   313d     RRCF      0x3d,0x0,0x1                                                                                    
000256   3832     SWAPF     0x32,0x0,0x0                                                                                    
000258   4420     RLNCF     0x20,0x0,0x0                                                                                    
00025a   3d43     INCFSZ    0x43,0x0,0x1                                                                                    
00025c   3231     RRCF      0x31,0x1,0x0                                                                                    
00025e   2038     ADDWFC    0x38,0x0,0x0                                                                                    
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           start	                                                                           D:\PIC18_Project\p18demo.asm
000260   ec2a     CALL      0x54,0x0       	call LCDInit                                                                    D:\PIC18_Project\p18demo.asm
000262   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
000264   0ea4     MOVLW     0xa4           	movlw	B'10100100'		;initialize USART                                            D:\PIC18_Project\p18demo.asm
000266   6eac     MOVWF     0xac,0x0       	movwf	TXSTA			;8-bit, Async, High Speed                                         D:\PIC18_Project\p18demo.asm
000268   0e19     MOVLW     0x19           	movlw	.25                                                                       D:\PIC18_Project\p18demo.asm
00026a   6eaf     MOVWF     0xaf,0x0       	movwf	SPBRG			;9.6kbaud @ 4MHz                                                  D:\PIC18_Project\p18demo.asm
00026c   0e90     MOVLW     0x90           	movlw	B'10010000'                                                               D:\PIC18_Project\p18demo.asm
00026e   6eab     MOVWF     0xab,0x0       	movwf	RCSTA                                                                     D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000270   9494     BCF       0x94,0x2,0x0   	bcf	TRISC,2			;configure CCP1 module for buzzer                                 D:\PIC18_Project\p18demo.asm
                                           ;	bcf	TRISC,6                                                                    D:\PIC18_Project\p18demo.asm
000272   0e80     MOVLW     0x80           	movlw	0x80                                                                      D:\PIC18_Project\p18demo.asm
000274   6ecb     MOVWF     0xcb,0x0       	movwf	PR2			;initialize PWM period                                              D:\PIC18_Project\p18demo.asm
000276   0e80     MOVLW     0x80           	movlw	0x80			;initialize PWM duty cycle                                         D:\PIC18_Project\p18demo.asm
000278   6ebe     MOVWF     0xbe,0x0       	movwf	CCPR1L                                                                    D:\PIC18_Project\p18demo.asm
00027a   9abd     BCF       0xbd,0x5,0x0   	bcf	CCP1CON,CCP1X                                                               D:\PIC18_Project\p18demo.asm
00027c   98bd     BCF       0xbd,0x4,0x0   	bcf	CCP1CON,CCP1Y                                                               D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00027e   0e05     MOVLW     0x5            	movlw	0x05			;postscale 1:1, prescaler 4, Timer2 ON                             D:\PIC18_Project\p18demo.asm
000280   6eca     MOVWF     0xca,0x0       	movwf	T2CON                                                                     D:\PIC18_Project\p18demo.asm
                                           		                                                                               D:\PIC18_Project\p18demo.asm
000282   8892     BSF       0x92,0x4,0x0   	bsf	TRISA,4			;make switch RA4 an Input                                         D:\PIC18_Project\p18demo.asm
000284   8093     BSF       0x93,0x0,0x0   	bsf	TRISB,0			;make switch RB0 an Input                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;**************** STANDARD CODE MENU SELECTION *******************               D:\PIC18_Project\p18demo.asm
                                           			;Introduction                                                                 D:\PIC18_Project\p18demo.asm
000286   0e50     MOVLW     0x50           	movlw	.80			;send "Microchip" to LCD                                            D:\PIC18_Project\p18demo.asm
000288   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
00028a   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
00028c   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00028e   0e60     MOVLW     0x60           	movlw	.96			;send "PICDEM 2 PLUS" to LCD                                        D:\PIC18_Project\p18demo.asm
000290   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
000292   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
000294   f003                                                                                                               
000296   eca8     CALL      0x750,0x0      	call	delay_1s		;delay for display                                               D:\PIC18_Project\p18demo.asm
000298   f003                                                                                                               
00029a   eca8     CALL      0x750,0x0      	call	delay_1s		;delay for display                                               D:\PIC18_Project\p18demo.asm
00029c   f003                                                                                                               
                                           menu                                                                             D:\PIC18_Project\p18demo.asm
                                           ;------------------ VOLT MEASUREMENT  ----------------------------               D:\PIC18_Project\p18demo.asm
00029e   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for RA4 release                                            D:\PIC18_Project\p18demo.asm
0002a0   ef4f     GOTO      0x29e          	goto	$-2		                                                                      D:\PIC18_Project\p18demo.asm
0002a2   f001                                                                                                               
0002a4   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
0002a6   ef52     GOTO      0x2a4          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
0002a8   f001                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002aa   0e00     MOVLW     0x0            	movlw	0x00			;voltmeter                                                         D:\PIC18_Project\p18demo.asm
0002ac   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002ae   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
0002b0   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002b2   0e40     MOVLW     0x40           	movlw	.64				;RA4=Next  RB0=Now                                                 D:\PIC18_Project\p18demo.asm
0002b4   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002b6   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
0002b8   f003                                                                                                               
                                           v_wait                                                                           D:\PIC18_Project\p18demo.asm
0002ba   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;voltmeter measurement ??                                        D:\PIC18_Project\p18demo.asm
0002bc   d038     BRA       0x32e          	bra		voltmeter                                                                  D:\PIC18_Project\p18demo.asm
0002be   b880     BTFSC     0x80,0x4,0x0   	btfsc	scroll			;next mode ??                                                    D:\PIC18_Project\p18demo.asm
0002c0   d7fc     BRA       0x2ba          	bra		v_wait			;NO                                                               D:\PIC18_Project\p18demo.asm
0002c2   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;YES                                                             D:\PIC18_Project\p18demo.asm
0002c4   d7fe     BRA       0x2c2          	bra		$-2				;wait for RA4 release                                               D:\PIC18_Project\p18demo.asm
                                           ;------------------ BUZZER --------------------------------------                D:\PIC18_Project\p18demo.asm
                                           menu_buz                                                                         D:\PIC18_Project\p18demo.asm
0002c6   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
0002c8   d7fe     BRA       0x2c6          	bra	$-2			                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002ca   0e10     MOVLW     0x10           	movlw	.16			;buzzer                                                             D:\PIC18_Project\p18demo.asm
0002cc   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002ce   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
0002d0   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002d2   0e40     MOVLW     0x40           	movlw	.64			;RA4=Next  RB0=Now                                                  D:\PIC18_Project\p18demo.asm
0002d4   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002d6   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
0002d8   f003                                                                                                               
                                           b_wait                                                                           D:\PIC18_Project\p18demo.asm
0002da   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;Buzzer sound ??                                                 D:\PIC18_Project\p18demo.asm
0002dc   ef0f     GOTO      0x41e          	goto	buzzer			;YES                                                              D:\PIC18_Project\p18demo.asm
0002de   f002                                                                                                               
0002e0   b880     BTFSC     0x80,0x4,0x0   	btfsc	scroll			;NO, next mode ??                                                D:\PIC18_Project\p18demo.asm
0002e2   ef6d     GOTO      0x2da          	goto	b_wait			;NO                                                               D:\PIC18_Project\p18demo.asm
0002e4   f001                                                                                                               
0002e6   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;YES                                                             D:\PIC18_Project\p18demo.asm
0002e8   d7fe     BRA       0x2e6          	bra	$-2			;wait for RA4 release                                                 D:\PIC18_Project\p18demo.asm
                                           ;----------------- TEMPERATURE MEASUREMENT ----------------------                D:\PIC18_Project\p18demo.asm
                                           menu_temp                                                                        D:\PIC18_Project\p18demo.asm
0002ea   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for RA4 release                                            D:\PIC18_Project\p18demo.asm
0002ec   d7fe     BRA       0x2ea          	bra	$-2		                                                                       D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002ee   0e20     MOVLW     0x20           	movlw	.32			;temperature                                                        D:\PIC18_Project\p18demo.asm
0002f0   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002f2   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
0002f4   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0002f6   0e40     MOVLW     0x40           	movlw	.64			;RA4=Next  RB0=Now                                                  D:\PIC18_Project\p18demo.asm
0002f8   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0002fa   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
0002fc   f003                                                                                                               
                                           t_wait                                                                           D:\PIC18_Project\p18demo.asm
0002fe   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;temperature measurement ??                                      D:\PIC18_Project\p18demo.asm
000300   d0e6     BRA       0x4ce          	bra	temp			;YES                                                                 D:\PIC18_Project\p18demo.asm
000302   b880     BTFSC     0x80,0x4,0x0   	btfsc	scroll			;NO, next mode ??                                                D:\PIC18_Project\p18demo.asm
000304   d7fc     BRA       0x2fe          	bra	t_wait			;NO                                                                D:\PIC18_Project\p18demo.asm
000306   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;YES                                                             D:\PIC18_Project\p18demo.asm
000308   d7fe     BRA       0x306          	bra	$-2			;wait for release                                                     D:\PIC18_Project\p18demo.asm
                                           ;------------------ CLOCK TIME ----------------------------------                D:\PIC18_Project\p18demo.asm
                                           menu_clock                                                                       D:\PIC18_Project\p18demo.asm
00030a   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
00030c   d7fe     BRA       0x30a          	bra	$-2		                                                                       D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00030e   0e30     MOVLW     0x30           	movlw	.48			;clock                                                              D:\PIC18_Project\p18demo.asm
000310   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
000312   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
000314   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000316   0e40     MOVLW     0x40           	movlw	.64			;RA4=Next  RB0=Now                                                  D:\PIC18_Project\p18demo.asm
000318   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
00031a   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
00031c   f003                                                                                                               
                                           c_wait                                                                           D:\PIC18_Project\p18demo.asm
00031e   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;goto time ??                                                    D:\PIC18_Project\p18demo.asm
000320   d16b     BRA       0x5f8          	bra	clock			;YES                                                                D:\PIC18_Project\p18demo.asm
000322   b880     BTFSC     0x80,0x4,0x0   	btfsc	scroll			;NO, next mode ??                                                D:\PIC18_Project\p18demo.asm
000324   d7fc     BRA       0x31e          	bra	c_wait			;NO                                                                D:\PIC18_Project\p18demo.asm
000326   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;YES                                                             D:\PIC18_Project\p18demo.asm
000328   d7fe     BRA       0x326          	bra	$-2			;wait for release                                                     D:\PIC18_Project\p18demo.asm
                                           ;-------------------------------------------------------------------             D:\PIC18_Project\p18demo.asm
00032a   d7b9     BRA       0x29e          	bra	menu			;begining of menu                                                    D:\PIC18_Project\p18demo.asm
00032c   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;*******************************************************************             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;************* STANDARD USER CODE **********************************             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;------------- Voltmeter--------------------------------------------             D:\PIC18_Project\p18demo.asm
                                           voltmeter                                                                        D:\PIC18_Project\p18demo.asm
00032e   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
000330   d7fe     BRA       0x32e          	bra		$-2                                                                        D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000332   0e41     MOVLW     0x41           	movlw	B'01000001'		;configure A/D converter	                                    D:\PIC18_Project\p18demo.asm
000334   6ec2     MOVWF     0xc2,0x0       	movwf	ADCON0			;turn A/D on                                                     D:\PIC18_Project\p18demo.asm
000336   0e0e     MOVLW     0xe            	movlw	b'00001110'		;RA0 = analog input                                          D:\PIC18_Project\p18demo.asm
000338   6ec1     MOVWF     0xc1,0x0       	movwf	ADCON1                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00033a   0ea0     MOVLW     0xa0           	movlw	.160			;send "Volts = " to the LCD                                        D:\PIC18_Project\p18demo.asm
00033c   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
00033e   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
000340   f003                                                                                                               
                                           volts_again                                                                      D:\PIC18_Project\p18demo.asm
000342   84c2     BSF       0xc2,0x2,0x0   	bsf		ADCON0,GO		;start conversion                                               D:\PIC18_Project\p18demo.asm
                                           again	                                                                           D:\PIC18_Project\p18demo.asm
000344   b4c2     BTFSC     0xc2,0x2,0x0   	btfsc	ADCON0,GO                                                                 D:\PIC18_Project\p18demo.asm
000346   efa2     GOTO      0x344          	goto	again                                                                      D:\PIC18_Project\p18demo.asm
000348   f001                                                                                                               
00034a   50c4     MOVF      0xc4,0x0,0x0   	movf	ADRESH,W		;ADRESH --> WREG                                                 D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00034c   6f94     MOVWF     0x94,0x1       	movwf	AARGB0			;move ADRESH into AARGB0                                         D:\PIC18_Project\p18demo.asm
00034e   0ec3     MOVLW     0xc3           	movlw	0xC3			;19.5mV/step   0xC3 = 195                                          D:\PIC18_Project\p18demo.asm
000350   6f99     MOVWF     0x99,0x1       	movwf	BARGB0                                                                    D:\PIC18_Project\p18demo.asm
000352   ec97     CALL      0x92e,0x0      	call	UMUL0808L	                                                                 D:\PIC18_Project\p18demo.asm
000354   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
000356   0e64     MOVLW     0x64           	movlw	0x64			;divide result by 100 (0x64)                                       D:\PIC18_Project\p18demo.asm
000358   6f99     MOVWF     0x99,0x1       	movwf	BARGB0                                                                    D:\PIC18_Project\p18demo.asm
00035a   ecac     CALL      0x958,0x0      	call	FXD1608U                                                                   D:\PIC18_Project\p18demo.asm
00035c   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00035e   5194     MOVF      0x94,0x0,0x1   	movf	AARGB0,W		;prepare for 16-bit binary to BCD                                D:\PIC18_Project\p18demo.asm
000360   6f8d     MOVWF     0x8d,0x1       	movwf	NumH                                                                      D:\PIC18_Project\p18demo.asm
000362   5195     MOVF      0x95,0x0,0x1   	movf	AARGB1,W                                                                   D:\PIC18_Project\p18demo.asm
000364   6f8e     MOVWF     0x8e,0x1       	movwf	NumL                                                                      D:\PIC18_Project\p18demo.asm
000366   ec28     CALL      0x850,0x0      	call	bin16_bcd		;get volts ready for LCD                                        D:\PIC18_Project\p18demo.asm
000368   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00036a   ec19     CALL      0x32,0x0       	call	LCDLine_2		;display A/D result on 2nd line                                 D:\PIC18_Project\p18demo.asm
00036c   f000                                                                                                               
00036e   5191     MOVF      0x91,0x0,0x1   	movf	Hund,W			;get hunds                                                        D:\PIC18_Project\p18demo.asm
000370   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000372   f004                                                                                                               
000374   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send high digit from the LSD #.xx	                                D:\PIC18_Project\p18demo.asm
000376   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000378   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00037a   f000                                                                                                               
00037c   0e2e     MOVLW     0x2e           	movlw	A'.'			;send decimal point "."                                            D:\PIC18_Project\p18demo.asm
00037e   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000380   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000382   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
000384   5192     MOVF      0x92,0x0,0x1   	movf	Tens,W			;get tens                                                         D:\PIC18_Project\p18demo.asm
000386   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000388   f004                                                                                                               
00038a   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit   x.#x                                             D:\PIC18_Project\p18demo.asm
00038c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00038e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000390   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000392   5193     MOVF      0x93,0x0,0x1   	movf	Ones,W			;get ones                                                         D:\PIC18_Project\p18demo.asm
000394   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000396   f004                                                                                                               
000398   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit   x.x#                                             D:\PIC18_Project\p18demo.asm
00039a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00039c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00039e   f000                                                                                                               
0003a0   0e56     MOVLW     0x56           	movlw	A'V'			;send "V" unit                                                     D:\PIC18_Project\p18demo.asm
0003a2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003a4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003a6   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0003a8   0e20     MOVLW     0x20           	movlw	0x20			;3 spaces	                                                         D:\PIC18_Project\p18demo.asm
0003aa   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003ac   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003ae   f000                                                                                                               
0003b0   0e20     MOVLW     0x20           	movlw	0x20			                                                                   D:\PIC18_Project\p18demo.asm
0003b2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003b4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003b6   f000                                                                                                               
0003b8   0e20     MOVLW     0x20           	movlw	0x20			                                                                   D:\PIC18_Project\p18demo.asm
0003ba   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003bc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003be   f000                                                                                                               
0003c0   0e52     MOVLW     0x52           	movlw	A'R'			;send "RB0=Exit" to LCD                                            D:\PIC18_Project\p18demo.asm
0003c2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003c4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003c6   f000                                                                                                               
0003c8   0e42     MOVLW     0x42           	movlw	A'B'			                                                                   D:\PIC18_Project\p18demo.asm
0003ca   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003cc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003ce   f000                                                                                                               
0003d0   0e30     MOVLW     0x30           	movlw	A'0'			                                                                   D:\PIC18_Project\p18demo.asm
0003d2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003d4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003d6   f000                                                                                                               
0003d8   0e3d     MOVLW     0x3d           	movlw	A'='			                                                                   D:\PIC18_Project\p18demo.asm
0003da   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003dc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003de   f000                                                                                                               
0003e0   0e45     MOVLW     0x45           	movlw	A'E'			                                                                   D:\PIC18_Project\p18demo.asm
0003e2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003e4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003e6   f000                                                                                                               
0003e8   0e78     MOVLW     0x78           	movlw	A'x'		                                                                    D:\PIC18_Project\p18demo.asm
0003ea   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003ec   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003ee   f000                                                                                                               
0003f0   0e69     MOVLW     0x69           	movlw	A'i'			                                                                   D:\PIC18_Project\p18demo.asm
0003f2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003f4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003f6   f000                                                                                                               
0003f8   0e74     MOVLW     0x74           	movlw	A't'			                                                                   D:\PIC18_Project\p18demo.asm
0003fa   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0003fc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0003fe   f000                                                                                                               
000400   0e20     MOVLW     0x20           	movlw	0x20			;2 spaces	                                                         D:\PIC18_Project\p18demo.asm
000402   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000404   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000406   f000                                                                                                               
000408   0e20     MOVLW     0x20           	movlw	0x20			                                                                   D:\PIC18_Project\p18demo.asm
00040a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00040c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00040e   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000410   0e0d     MOVLW     0xd            	movlw	"\r"			;move data into TXREG                                              D:\PIC18_Project\p18demo.asm
000412   6ead     MOVWF     0xad,0x0       	movwf	TXREG			;carriage return                                                  D:\PIC18_Project\p18demo.asm
000414   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT		;wait for data TX                                             D:\PIC18_Project\p18demo.asm
000416   d7fe     BRA       0x414          	bra		$-2                                                                        D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000418   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;exit volt measurement ??                                        D:\PIC18_Project\p18demo.asm
00041a   d755     BRA       0x2c6          	bra		menu_buz		;YES                                                             D:\PIC18_Project\p18demo.asm
00041c   d792     BRA       0x342          	bra		volts_again		;NO, do conversion again                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;--------------------- BUZZER --------------------------------------             D:\PIC18_Project\p18demo.asm
                                           buzzer                                                                           D:\PIC18_Project\p18demo.asm
00041e   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
000420   d7fe     BRA       0x41e          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000422   0e80     MOVLW     0x80           	movlw	0x80			;start at these PWM values                                         D:\PIC18_Project\p18demo.asm
000424   6ecb     MOVWF     0xcb,0x0       	movwf	PR2			;initialize PWM period                                              D:\PIC18_Project\p18demo.asm
000426   0e80     MOVLW     0x80           	movlw	0x80			                                                                   D:\PIC18_Project\p18demo.asm
000428   6ebe     MOVWF     0xbe,0x0       	movwf	CCPR1L			;initialize PWM duty cycle                                       D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00042a   ec15     CALL      0x2a,0x0       	call	LCDLine_1                                                                  D:\PIC18_Project\p18demo.asm
00042c   f000                                                                                                               
00042e   0eb0     MOVLW     0xb0           	movlw	.176			;send "Prd.=128 DC=128" to LCD                                     D:\PIC18_Project\p18demo.asm
000430   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
000432   ec5d     CALL      0x6ba,0x0      	call	stan_char_1                                                                D:\PIC18_Project\p18demo.asm
000434   f003                                                                                                               
000436   ec19     CALL      0x32,0x0       	call	LCDLine_2                                                                  D:\PIC18_Project\p18demo.asm
000438   f000                                                                                                               
00043a   0e80     MOVLW     0x80           	movlw	.128			;send "RA4= -> RB0 = ++" to LCD                                    D:\PIC18_Project\p18demo.asm
00043c   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
00043e   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
000440   f003                                                                                                               
                                           		                                                                               D:\PIC18_Project\p18demo.asm
000442   0e0f     MOVLW     0xf            	movlw	0x0F			;turn buzzer on	                                                   D:\PIC18_Project\p18demo.asm
000444   6ebd     MOVWF     0xbd,0x0       	movwf	CCP1CON	                                                                  D:\PIC18_Project\p18demo.asm
                                           		                                                                               D:\PIC18_Project\p18demo.asm
                                           pr2_again			                                                                     D:\PIC18_Project\p18demo.asm
000446   b081     BTFSC     0x81,0x0,0x0   	btfsc	select			;increment PR2 ???                                               D:\PIC18_Project\p18demo.asm
000448   d005     BRA       0x454          	bra	pr2_out			;NO                                                               D:\PIC18_Project\p18demo.asm
00044a   ec9f     CALL      0x73e,0x0      	call	delay_100ms		;YES                                                          D:\PIC18_Project\p18demo.asm
00044c   f003                                                                                                               
00044e   ec9f     CALL      0x73e,0x0      	call	delay_100ms		                                                              D:\PIC18_Project\p18demo.asm
000450   f003                                                                                                               
000452   2acb     INCF      0xcb,0x1,0x0   	incf	PR2,F			;increment PR2                                                     D:\PIC18_Project\p18demo.asm
                                           pr2_out                                                                          D:\PIC18_Project\p18demo.asm
000454   0e85     MOVLW     0x85           	movlw	0x85			;move cursor into position                                         D:\PIC18_Project\p18demo.asm
000456   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000458   ec26     CALL      0x4c,0x0       	call	i_write                                                                    D:\PIC18_Project\p18demo.asm
00045a   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           pol1                                                                             D:\PIC18_Project\p18demo.asm
00045c   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;goto increment CCPR1L                                           D:\PIC18_Project\p18demo.asm
00045e   d012     BRA       0x484          	bra	inc_dc                                                                      D:\PIC18_Project\p18demo.asm
000460   b081     BTFSC     0x81,0x0,0x0   	btfsc	select			;wait for RB0 press                                              D:\PIC18_Project\p18demo.asm
000462   d7fc     BRA       0x45c          	bra	pol1                                                                        D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000464   50cb     MOVF      0xcb,0x0,0x0   	movf	PR2,W			;send PR2 register to conversion                                   D:\PIC18_Project\p18demo.asm
000466   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000468   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00046a   5189     MOVF      0x89,0x0,0x1   	movf	MSD,W			;send high digit                                                   D:\PIC18_Project\p18demo.asm
00046c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00046e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000470   f000                                                                                                               
000472   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
000474   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000476   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000478   f000                                                                                                               
00047a   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
00047c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00047e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000480   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000482   d7e1     BRA       0x446          	bra	pr2_again		                                                                 D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;------------------------                                                        D:\PIC18_Project\p18demo.asm
                                           		;adjust Duty Cycle                                                             D:\PIC18_Project\p18demo.asm
                                           inc_dc                                                                           D:\PIC18_Project\p18demo.asm
000484   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for button release                                         D:\PIC18_Project\p18demo.asm
000486   d7fe     BRA       0x484          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           inc_ccpr1l	                                                                      D:\PIC18_Project\p18demo.asm
000488   b081     BTFSC     0x81,0x0,0x0   	btfsc	select			;increment CCPR1L ???                                            D:\PIC18_Project\p18demo.asm
00048a   ef4c     GOTO      0x498          	goto	ccpr1l_out		;NO                                                            D:\PIC18_Project\p18demo.asm
00048c   f002                                                                                                               
00048e   ec9f     CALL      0x73e,0x0      	call	delay_100ms		;YES                                                          D:\PIC18_Project\p18demo.asm
000490   f003                                                                                                               
000492   ec9f     CALL      0x73e,0x0      	call	delay_100ms                                                                D:\PIC18_Project\p18demo.asm
000494   f003                                                                                                               
000496   2abe     INCF      0xbe,0x1,0x0   	incf	CCPR1L,F		;increment CCPR1L                                                D:\PIC18_Project\p18demo.asm
                                           ccpr1l_out                                                                       D:\PIC18_Project\p18demo.asm
000498   0e8c     MOVLW     0x8c           	movlw	0x8C			;move cursor into position                                         D:\PIC18_Project\p18demo.asm
00049a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00049c   ec26     CALL      0x4c,0x0       	call	i_write                                                                    D:\PIC18_Project\p18demo.asm
00049e   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           col1                                                                             D:\PIC18_Project\p18demo.asm
0004a0   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;exit?                                                           D:\PIC18_Project\p18demo.asm
0004a2   d012     BRA       0x4c8          	bra	pwm_out                                                                     D:\PIC18_Project\p18demo.asm
0004a4   b081     BTFSC     0x81,0x0,0x0   	btfsc	select			;wait for RB0 press                                              D:\PIC18_Project\p18demo.asm
0004a6   d7fc     BRA       0x4a0          	bra	col1                                                                        D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0004a8   50be     MOVF      0xbe,0x0,0x0   	movf	CCPR1L,W		;send PR2 register to conversion                                 D:\PIC18_Project\p18demo.asm
0004aa   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
0004ac   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0004ae   5189     MOVF      0x89,0x0,0x1   	movf	MSD,W			;send high digit                                                   D:\PIC18_Project\p18demo.asm
0004b0   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0004b2   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0004b4   f000                                                                                                               
0004b6   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
0004b8   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0004ba   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0004bc   f000                                                                                                               
0004be   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
0004c0   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0004c2   ec1d     CALL      0x3a,0x0       	call	d_write			                                                                 D:\PIC18_Project\p18demo.asm
0004c4   f000                                                                                                               
0004c6   d7e0     BRA       0x488          	bra	inc_ccpr1l                                                                  D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           pwm_out                                                                          D:\PIC18_Project\p18demo.asm
0004c8   0e00     MOVLW     0x0            	movlw	0                                                                         D:\PIC18_Project\p18demo.asm
0004ca   6ebd     MOVWF     0xbd,0x0       	movwf	CCP1CON			;turn buzzer off                                                D:\PIC18_Project\p18demo.asm
0004cc   d70e     BRA       0x2ea          	bra	menu_temp                                                                   D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;---------------------- Temperature --------------------------------             D:\PIC18_Project\p18demo.asm
                                           temp                                                                             D:\PIC18_Project\p18demo.asm
                                           ;	This code if for the TC74A5-5.0VAT temperature sensor                          D:\PIC18_Project\p18demo.asm
                                           ;		1st. Check if temperature is ready to be read in config reg.                  D:\PIC18_Project\p18demo.asm
                                           ;		2nd. If ready, retireve temperatute in hex.                                   D:\PIC18_Project\p18demo.asm
                                           ;		     If not ready, check config register again.                               D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0004ce   8694     BSF       0x94,0x3,0x0   	bsf	TRISC,3			;initialize MSSP module                                           D:\PIC18_Project\p18demo.asm
0004d0   8894     BSF       0x94,0x4,0x0   	bsf	TRISC,4                                                                     D:\PIC18_Project\p18demo.asm
0004d2   0e28     MOVLW     0x28           	movlw	B'00101000'                                                               D:\PIC18_Project\p18demo.asm
0004d4   6ec6     MOVWF     0xc6,0x0       	movwf	SSPCON1                                                                   D:\PIC18_Project\p18demo.asm
0004d6   8ec7     BSF       0xc7,0x7,0x0   	bsf	SSPSTAT,SMP                                                                 D:\PIC18_Project\p18demo.asm
0004d8   0e05     MOVLW     0x5            	movlw	.5                                                                        D:\PIC18_Project\p18demo.asm
0004da   6ec8     MOVWF     0xc8,0x0       	movwf	SSPADD                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0004dc   909e     BCF       0x9e,0x0,0x0   	bcf	PIR1,TMR1IF                                                                 D:\PIC18_Project\p18demo.asm
0004de   6acf     CLRF      0xcf,0x0       	clrf	TMR1H			;load Timer1 for 2 sec overflow                                    D:\PIC18_Project\p18demo.asm
0004e0   6ace     CLRF      0xce,0x0       	clrf	TMR1L                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           get_temp                                                                         D:\PIC18_Project\p18demo.asm
0004e2   0e01     MOVLW     0x1            	movlw	0x01			;config register command byte                                      D:\PIC18_Project\p18demo.asm
0004e4   6f85     MOVWF     0x85,0x1       	movwf	cmd_byte                                                                  D:\PIC18_Project\p18demo.asm
                                           temp_now                                                                         D:\PIC18_Project\p18demo.asm
0004e6   8cc7     BSF       0xc7,0x6,0x0   	bsf	SSPSTAT,6		;SMBUS spec for TC74                                             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0004e8   80c5     BSF       0xc5,0x0,0x0   	bsf	SSPCON2,SEN		;write to TC74                                                 D:\PIC18_Project\p18demo.asm
0004ea   b0c5     BTFSC     0xc5,0x0,0x0   	btfsc	SSPCON2,SEN                                                               D:\PIC18_Project\p18demo.asm
0004ec   d7fe     BRA       0x4ea          	bra	$-2	                                                                        D:\PIC18_Project\p18demo.asm
0004ee   0e9a     MOVLW     0x9a           	movlw	B'10011010'		;send TC74 ADDRESS (write)                                   D:\PIC18_Project\p18demo.asm
0004f0   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
0004f2   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
0004f4   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
0004f6   0800     SUBLW     0x0                                                                                             
0004f8   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
0004fa   d7fb     BRA       0x4f2                                                                                           
0004fc   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
0004fe   d7fe     BRA       0x4fc                                                                                           
000500   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
000502   d7fe     BRA       0x500          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000504   5185     MOVF      0x85,0x0,0x1   	movf	cmd_byte,W		;send COMMAND byte (config)                                    D:\PIC18_Project\p18demo.asm
000506   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
000508   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
00050a   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
00050c   0800     SUBLW     0x0                                                                                             
00050e   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
000510   d7fb     BRA       0x508                                                                                           
000512   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
000514   d7fe     BRA       0x512                                                                                           
000516   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
000518   d7fe     BRA       0x516          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00051a   82c5     BSF       0xc5,0x1,0x0   	bsf	SSPCON2,RSEN		;send repeated start                                          D:\PIC18_Project\p18demo.asm
00051c   b2c5     BTFSC     0xc5,0x1,0x0   	btfsc	SSPCON2,RSEN                                                              D:\PIC18_Project\p18demo.asm
00051e   d7fe     BRA       0x51c          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
000520   0e9b     MOVLW     0x9b           	movlw	B'10011011'		;send TC74 ADDRESS (read)                                    D:\PIC18_Project\p18demo.asm
000522   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
000524   0e00     MOVLW     0x0            	ssprw				;module idle?                                                          D:\PIC18_Project\p18demo.asm
000526   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
000528   0800     SUBLW     0x0                                                                                             
00052a   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
00052c   d7fb     BRA       0x524                                                                                           
00052e   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
000530   d7fe     BRA       0x52e                                                                                           
000532   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
000534   d7fe     BRA       0x532          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000536   86c5     BSF       0xc5,0x3,0x0   	bsf	SSPCON2,RCEN		;enable receive mode                                          D:\PIC18_Project\p18demo.asm
000538   b6c5     BTFSC     0xc5,0x3,0x0   	btfsc	SSPCON2,RCEN                                                              D:\PIC18_Project\p18demo.asm
00053a   d7fe     BRA       0x538          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00053c   50c9     MOVF      0xc9,0x0,0x0   	movf	SSPBUF,W		;retrieve config reg or temp reg                                 D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00053e   8ac5     BSF       0xc5,0x5,0x0   	bsf	SSPCON2,ACKDT		;send NOT-ACK                                                D:\PIC18_Project\p18demo.asm
000540   88c5     BSF       0xc5,0x4,0x0   	bsf	SSPCON2,ACKEN                                                               D:\PIC18_Project\p18demo.asm
000542   b8c5     BTFSC     0xc5,0x4,0x0   	btfsc	SSPCON2,ACKEN                                                             D:\PIC18_Project\p18demo.asm
000544   d7fe     BRA       0x542          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                           			                                                                              D:\PIC18_Project\p18demo.asm
000546   84c5     BSF       0xc5,0x2,0x0   	bsf	SSPCON2,PEN		;stop                                                          D:\PIC18_Project\p18demo.asm
000548   b4c5     BTFSC     0xc5,0x2,0x0   	btfsc	SSPCON2,PEN                                                               D:\PIC18_Project\p18demo.asm
00054a   d7fe     BRA       0x548          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00054c   a185     BTFSS     0x85,0x0,0x1   	btfss	cmd_byte,0		;config command OR temp command                               D:\PIC18_Project\p18demo.asm
00054e   d007     BRA       0x55e          	bra	convert_temp		;get temperature ready for display                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000550   0b40     ANDLW     0x40           	andlw	0x40			;is temp ready ??                                                  D:\PIC18_Project\p18demo.asm
000552   0840     SUBLW     0x40           	sublw	0x40                                                                      D:\PIC18_Project\p18demo.asm
000554   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z                                                                  D:\PIC18_Project\p18demo.asm
000556   d7c5     BRA       0x4e2          	bra	get_temp                                                                    D:\PIC18_Project\p18demo.asm
000558   0e00     MOVLW     0x0            	movlw	0x00			;temp is ready for reading                                         D:\PIC18_Project\p18demo.asm
00055a   6f85     MOVWF     0x85,0x1       	movwf	cmd_byte		;send temp register command                                     D:\PIC18_Project\p18demo.asm
00055c   d7c4     BRA       0x4e6          	bra	temp_now                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           convert_temp                                                                     D:\PIC18_Project\p18demo.asm
00055e   6f86     MOVWF     0x86,0x1       	movwf	temperature                                                               D:\PIC18_Project\p18demo.asm
000560   ec0d     CALL      0x81a,0x0      	call	bin_bcd			;get temp ready for LCD                                          D:\PIC18_Project\p18demo.asm
000562   f004                                                                                                               
000564   ec15     CALL      0x2a,0x0       	call	LCDLine_1                                                                  D:\PIC18_Project\p18demo.asm
000566   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
000568   0e54     MOVLW     0x54           	movlw	A'T'			;send "Temp=" to LCD                                               D:\PIC18_Project\p18demo.asm
00056a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
00056c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00056e   f000                                                                                                               
000570   0e65     MOVLW     0x65           	movlw	A'e'                                                                      D:\PIC18_Project\p18demo.asm
000572   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
000574   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000576   f000                                                                                                               
000578   0e6d     MOVLW     0x6d           	movlw	A'm'                                                                      D:\PIC18_Project\p18demo.asm
00057a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
00057c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00057e   f000                                                                                                               
000580   0e70     MOVLW     0x70           	movlw	A'p'                                                                      D:\PIC18_Project\p18demo.asm
000582   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
000584   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000586   f000                                                                                                               
000588   0e20     MOVLW     0x20           	movlw	0x20			;space                                                             D:\PIC18_Project\p18demo.asm
00058a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
00058c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00058e   f000                                                                                                               
000590   0e3d     MOVLW     0x3d           	movlw	A'='                                                                      D:\PIC18_Project\p18demo.asm
000592   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
000594   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000596   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000598   0e20     MOVLW     0x20           	movlw	0x20			;space                                                             D:\PIC18_Project\p18demo.asm
00059a   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
00059c   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
00059e   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0005a0   5189     MOVF      0x89,0x0,0x1   	movf	MSD,W			;send high digit                                                   D:\PIC18_Project\p18demo.asm
0005a2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0005a4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005a6   f000                                                                                                               
0005a8   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
0005aa   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0005ac   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005ae   f000                                                                                                               
0005b0   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
0005b2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0005b4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005b6   f000                                                                                                               
0005b8   0e43     MOVLW     0x43           	movlw	A'C'			;send "C" for celcius                                              D:\PIC18_Project\p18demo.asm
0005ba   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
0005bc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005be   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0005c0   0e20     MOVLW     0x20           	movlw	0x20			;space                                                             D:\PIC18_Project\p18demo.asm
0005c2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
0005c4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005c6   f000                                                                                                               
0005c8   0e20     MOVLW     0x20           	movlw	0x20			;space                                                             D:\PIC18_Project\p18demo.asm
0005ca   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
0005cc   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005ce   f000                                                                                                               
0005d0   0e20     MOVLW     0x20           	movlw	0x20			;space                                                             D:\PIC18_Project\p18demo.asm
0005d2   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr	                                                                  D:\PIC18_Project\p18demo.asm
0005d4   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0005d6   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0005d8   ec19     CALL      0x32,0x0       	call	LCDLine_2		;send "RB0 = Exit" to LCD                                       D:\PIC18_Project\p18demo.asm
0005da   f000                                                                                                               
0005dc   0e90     MOVLW     0x90           	movlw	.144                                                                      D:\PIC18_Project\p18demo.asm
0005de   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0005e0   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
0005e2   f003                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0005e4   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 release                                            D:\PIC18_Project\p18demo.asm
0005e6   d7fe     BRA       0x5e4          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
0005e8   ec9f     CALL      0x73e,0x0      	call	delay_100ms                                                                D:\PIC18_Project\p18demo.asm
0005ea   f003                                                                                                               
0005ec   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;exit ?                                                          D:\PIC18_Project\p18demo.asm
0005ee   d68d     BRA       0x30a          	bra	menu_clock		;YES, goto main menu                                            D:\PIC18_Project\p18demo.asm
0005f0   b09e     BTFSC     0x9e,0x0,0x0   	btfsc	PIR1,TMR1IF		;2 second overflow occur ??                                  D:\PIC18_Project\p18demo.asm
0005f2   ec5a     CALL      0x8b4,0x0      	call	write_eeprom		;YES                                                         D:\PIC18_Project\p18demo.asm
0005f4   f004                                                                                                               
0005f6   d775     BRA       0x4e2          	bra	get_temp		;NO, get temperature again                                        D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
                                           ;----------------- CLOCK ------------------------------------------              D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           clock                                                                            D:\PIC18_Project\p18demo.asm
0005f8   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 button release                                     D:\PIC18_Project\p18demo.asm
0005fa   d7fe     BRA       0x5f8          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
0005fc   0e0f     MOVLW     0xf            	movlw	0x0F			;intitialize TIMER1                                                D:\PIC18_Project\p18demo.asm
0005fe   6ecd     MOVWF     0xcd,0x0       	movwf	T1CON                                                                     D:\PIC18_Project\p18demo.asm
000600   6b8a     CLRF      0x8a,0x1       	clrf	seconds                                                                    D:\PIC18_Project\p18demo.asm
000602   6b8b     CLRF      0x8b,0x1       	clrf	minutes                                                                    D:\PIC18_Project\p18demo.asm
000604   6b8c     CLRF      0x8c,0x1       	clrf	hours                                                                      D:\PIC18_Project\p18demo.asm
                                           overflow	                                                                        D:\PIC18_Project\p18demo.asm
000606   909e     BCF       0x9e,0x0,0x0   	bcf	PIR1,TMR1IF                                                                 D:\PIC18_Project\p18demo.asm
000608   0e80     MOVLW     0x80           	movlw	0x80		                                                                    D:\PIC18_Project\p18demo.asm
00060a   6ecf     MOVWF     0xcf,0x0       	movwf	TMR1H			;load regs for 1 sec overflow                                     D:\PIC18_Project\p18demo.asm
00060c   6ace     CLRF      0xce,0x0       	clrf	TMR1L                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00060e   2b8a     INCF      0x8a,0x1,0x1   	incf	seconds,F		;increment seconds                                              D:\PIC18_Project\p18demo.asm
000610   518a     MOVF      0x8a,0x0,0x1   	movf	seconds,W                                                                  D:\PIC18_Project\p18demo.asm
000612   083c     SUBLW     0x3c           	sublw	.60                                                                       D:\PIC18_Project\p18demo.asm
000614   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z		;increment minutes ?                                            D:\PIC18_Project\p18demo.asm
000616   d00e     BRA       0x634          	bra	clk_done                                                                    D:\PIC18_Project\p18demo.asm
000618   2b8b     INCF      0x8b,0x1,0x1   	incf	minutes,F		                                                                D:\PIC18_Project\p18demo.asm
00061a   6b8a     CLRF      0x8a,0x1       	clrf	seconds                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00061c   518b     MOVF      0x8b,0x0,0x1   	movf	minutes,W                                                                  D:\PIC18_Project\p18demo.asm
00061e   083c     SUBLW     0x3c           	sublw	.60                                                                       D:\PIC18_Project\p18demo.asm
000620   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z		;increment hours ?                                              D:\PIC18_Project\p18demo.asm
000622   d008     BRA       0x634          	bra	clk_done	                                                                   D:\PIC18_Project\p18demo.asm
000624   2b8c     INCF      0x8c,0x1,0x1   	incf	hours,F			                                                                 D:\PIC18_Project\p18demo.asm
000626   6b8b     CLRF      0x8b,0x1       	clrf	minutes                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000628   518c     MOVF      0x8c,0x0,0x1   	movf	hours,W                                                                    D:\PIC18_Project\p18demo.asm
00062a   080d     SUBLW     0xd            	sublw	.13                                                                       D:\PIC18_Project\p18demo.asm
00062c   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z                                                                  D:\PIC18_Project\p18demo.asm
00062e   d002     BRA       0x634          	bra	clk_done                                                                    D:\PIC18_Project\p18demo.asm
000630   0e01     MOVLW     0x1            	movlw	.1			;start a new 12 hour period                                          D:\PIC18_Project\p18demo.asm
000632   6f8c     MOVWF     0x8c,0x1       	movwf	hours                                                                     D:\PIC18_Project\p18demo.asm
                                           clk_done                                                                         D:\PIC18_Project\p18demo.asm
000634   518c     MOVF      0x8c,0x0,0x1   	movf	hours,W			;send hours to LCD                                               D:\PIC18_Project\p18demo.asm
000636   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000638   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00063a   ec15     CALL      0x2a,0x0       	call	LCDLine_1		;place time on line 1                                           D:\PIC18_Project\p18demo.asm
00063c   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00063e   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
000640   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000642   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000644   f000                                                                                                               
000646   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
000648   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00064a   ec1d     CALL      0x3a,0x0       	call	d_write	                                                                   D:\PIC18_Project\p18demo.asm
00064c   f000                                                                                                               
00064e   0e3a     MOVLW     0x3a           	movlw	0x3A			;send  :   colon                                                   D:\PIC18_Project\p18demo.asm
000650   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000652   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000654   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000656   518b     MOVF      0x8b,0x0,0x1   	movf	minutes,W		;send minutes to LCD                                            D:\PIC18_Project\p18demo.asm
000658   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
00065a   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00065c   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
00065e   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000660   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000662   f000                                                                                                               
000664   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
000666   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000668   ec1d     CALL      0x3a,0x0       	call	d_write	                                                                   D:\PIC18_Project\p18demo.asm
00066a   f000                                                                                                               
00066c   0e3a     MOVLW     0x3a           	movlw	0x3A			; send :   colon                                                   D:\PIC18_Project\p18demo.asm
00066e   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000670   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000672   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000674   518a     MOVF      0x8a,0x0,0x1   	movf	seconds,W		;send seconds to LCD                                            D:\PIC18_Project\p18demo.asm
000676   ec0d     CALL      0x81a,0x0      	call	bin_bcd                                                                    D:\PIC18_Project\p18demo.asm
000678   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00067a   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send middle digit                                                 D:\PIC18_Project\p18demo.asm
00067c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00067e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000680   f000                                                                                                               
000682   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send low digit                                                    D:\PIC18_Project\p18demo.asm
000684   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000686   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000688   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00068a   0e20     MOVLW     0x20           	movlw	0x20			;send 3 spaces after 00:00:00                                      D:\PIC18_Project\p18demo.asm
00068c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00068e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000690   f000                                                                                                               
000692   0e20     MOVLW     0x20           	movlw	0x20                                                                      D:\PIC18_Project\p18demo.asm
000694   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000696   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000698   f000                                                                                                               
00069a   0e20     MOVLW     0x20           	movlw	0x20                                                                      D:\PIC18_Project\p18demo.asm
00069c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00069e   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0006a0   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0006a2   0e70     MOVLW     0x70           	movlw	.112			;send "RA4=Dn RB0=Menu" to LCD                                     D:\PIC18_Project\p18demo.asm
0006a4   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
0006a6   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
0006a8   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006aa   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;set time ??                                                     D:\PIC18_Project\p18demo.asm
0006ac   d05d     BRA       0x768          	bra	set_time                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006ae   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;return to main menu ??                                          D:\PIC18_Project\p18demo.asm
0006b0   d5f6     BRA       0x29e          	bra	menu                                                                        D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0006b2   a09e     BTFSS     0x9e,0x0,0x0   	btfss	PIR1,TMR1IF		;has timer1 overflowed ?	                                    D:\PIC18_Project\p18demo.asm
0006b4   d7fe     BRA       0x6b2          	bra	$-2			;NO, wait til overflow                                                D:\PIC18_Project\p18demo.asm
0006b6   d7a7     BRA       0x606          	bra	overflow		;YES                                                              D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006b8   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                           ;*******************************************************************             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;************************** ROUTINES ******************************              D:\PIC18_Project\p18demo.asm
                                           ;******************************************************************              D:\PIC18_Project\p18demo.asm
                                           ;******************************************************************              D:\PIC18_Project\p18demo.asm
                                           		                                                                               D:\PIC18_Project\p18demo.asm
                                           ;----Standard code, Place characters on line-1--------------------------         D:\PIC18_Project\p18demo.asm
                                           stan_char_1                                                                      D:\PIC18_Project\p18demo.asm
0006ba   ec15     CALL      0x2a,0x0       	call	LCDLine_1		;mvoe cursor to line 1                                          D:\PIC18_Project\p18demo.asm
0006bc   f000                                                                                                               
0006be   0e10     MOVLW     0x10           	movlw	.16			;1-full line of LCD                                                 D:\PIC18_Project\p18demo.asm
0006c0   6f81     MOVWF     0x81,0x1       	movwf	ptr_count                                                                 D:\PIC18_Project\p18demo.asm
0006c2   0e00     MOVLW     0x0            	movlw	UPPER stan_table                                                          D:\PIC18_Project\p18demo.asm
0006c4   6ef8     MOVWF     0xf8,0x0       	movwf	TBLPTRU                                                                   D:\PIC18_Project\p18demo.asm
0006c6   0e01     MOVLW     0x1            	movlw	HIGH stan_table                                                           D:\PIC18_Project\p18demo.asm
0006c8   6ef7     MOVWF     0xf7,0x0       	movwf	TBLPTRH                                                                   D:\PIC18_Project\p18demo.asm
0006ca   0ea0     MOVLW     0xa0           	movlw	LOW stan_table                                                            D:\PIC18_Project\p18demo.asm
0006cc   6ef6     MOVWF     0xf6,0x0       	movwf	TBLPTRL                                                                   D:\PIC18_Project\p18demo.asm
0006ce   5180     MOVF      0x80,0x0,0x1   	movf	ptr_pos,W                                                                  D:\PIC18_Project\p18demo.asm
0006d0   26f6     ADDWF     0xf6,0x1,0x0   	addwf	TBLPTRL,F                                                                 D:\PIC18_Project\p18demo.asm
0006d2   6ae8     CLRF      0xe8,0x0       	clrf	WREG                                                                       D:\PIC18_Project\p18demo.asm
0006d4   22f7     ADDWFC    0xf7,0x1,0x0   	addwfc	TBLPTRH,F                                                                D:\PIC18_Project\p18demo.asm
0006d6   22f8     ADDWFC    0xf8,0x1,0x0   	addwfc	TBLPTRU,F                                                                D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           stan_next_char_1                                                                 D:\PIC18_Project\p18demo.asm
0006d8   0009     TBLRDPOSTINC             	tblrd	*+                                                                        D:\PIC18_Project\p18demo.asm
0006da   cff5     MOVFF     0xff5,0xa1     	movff	TABLAT,temp_wr			                                                         D:\PIC18_Project\p18demo.asm
0006dc   f0a1                                                                                                               
0006de   ec1d     CALL      0x3a,0x0       	call	d_write			;send character to LCD                                           D:\PIC18_Project\p18demo.asm
0006e0   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006e2   2f81     DECFSZ    0x81,0x1,0x1   	decfsz	ptr_count,F		;move pointer to next char                                  D:\PIC18_Project\p18demo.asm
0006e4   d7f9     BRA       0x6d8          	bra	stan_next_char_1                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006e6   0e0a     MOVLW     0xa            	movlw	"\n"			;move data into TXREG                                              D:\PIC18_Project\p18demo.asm
0006e8   6ead     MOVWF     0xad,0x0       	movwf	TXREG			;next line                                                        D:\PIC18_Project\p18demo.asm
0006ea   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT		;wait for data TX                                             D:\PIC18_Project\p18demo.asm
0006ec   ef75     GOTO      0x6ea          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
0006ee   f003                                                                                                               
0006f0   0e0d     MOVLW     0xd            	movlw	"\r"			;move data into TXREG                                              D:\PIC18_Project\p18demo.asm
0006f2   6ead     MOVWF     0xad,0x0       	movwf	TXREG			;carriage return                                                  D:\PIC18_Project\p18demo.asm
0006f4   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT		;wait for data TX                                             D:\PIC18_Project\p18demo.asm
0006f6   ef7a     GOTO      0x6f4          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
0006f8   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0006fa   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;----Standard code, Place characters on line-2--------------------------         D:\PIC18_Project\p18demo.asm
                                           stan_char_2	                                                                     D:\PIC18_Project\p18demo.asm
0006fc   ec19     CALL      0x32,0x0       	call	LCDLine_2		;move cursor to line 2                                          D:\PIC18_Project\p18demo.asm
0006fe   f000                                                                                                               
000700   0e10     MOVLW     0x10           	movlw	.16			;1-full line of LCD                                                 D:\PIC18_Project\p18demo.asm
000702   6f81     MOVWF     0x81,0x1       	movwf	ptr_count                                                                 D:\PIC18_Project\p18demo.asm
000704   0e00     MOVLW     0x0            	movlw	UPPER stan_table                                                          D:\PIC18_Project\p18demo.asm
000706   6ef8     MOVWF     0xf8,0x0       	movwf	TBLPTRU                                                                   D:\PIC18_Project\p18demo.asm
000708   0e01     MOVLW     0x1            	movlw	HIGH stan_table                                                           D:\PIC18_Project\p18demo.asm
00070a   6ef7     MOVWF     0xf7,0x0       	movwf	TBLPTRH                                                                   D:\PIC18_Project\p18demo.asm
00070c   0ea0     MOVLW     0xa0           	movlw	LOW stan_table                                                            D:\PIC18_Project\p18demo.asm
00070e   6ef6     MOVWF     0xf6,0x0       	movwf	TBLPTRL                                                                   D:\PIC18_Project\p18demo.asm
000710   5180     MOVF      0x80,0x0,0x1   	movf	ptr_pos,W                                                                  D:\PIC18_Project\p18demo.asm
000712   26f6     ADDWF     0xf6,0x1,0x0   	addwf	TBLPTRL,F                                                                 D:\PIC18_Project\p18demo.asm
000714   6ae8     CLRF      0xe8,0x0       	clrf	WREG                                                                       D:\PIC18_Project\p18demo.asm
000716   22f7     ADDWFC    0xf7,0x1,0x0   	addwfc	TBLPTRH,F                                                                D:\PIC18_Project\p18demo.asm
000718   22f8     ADDWFC    0xf8,0x1,0x0   	addwfc	TBLPTRU,F                                                                D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           stan_next_char_2                                                                 D:\PIC18_Project\p18demo.asm
00071a   0009     TBLRDPOSTINC             	tblrd	*+                                                                        D:\PIC18_Project\p18demo.asm
00071c   cff5     MOVFF     0xff5,0xa1     	movff	TABLAT,temp_wr                                                            D:\PIC18_Project\p18demo.asm
00071e   f0a1                                                                                                               
000720   ec1d     CALL      0x3a,0x0       	call	d_write			;send character to LCD                                           D:\PIC18_Project\p18demo.asm
000722   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000724   2f81     DECFSZ    0x81,0x1,0x1   	decfsz	ptr_count,F		;move pointer to next char                                  D:\PIC18_Project\p18demo.asm
000726   d7f9     BRA       0x71a          	bra	stan_next_char_2                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000728   0e0a     MOVLW     0xa            	movlw	"\n"			;move data into TXREG                                              D:\PIC18_Project\p18demo.asm
00072a   6ead     MOVWF     0xad,0x0       	movwf	TXREG			;next line                                                        D:\PIC18_Project\p18demo.asm
00072c   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT		;wait for data TX                                             D:\PIC18_Project\p18demo.asm
00072e   ef96     GOTO      0x72c          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
000730   f003                                                                                                               
000732   0e0d     MOVLW     0xd            	movlw	"\r"			;move data into TXREG                                              D:\PIC18_Project\p18demo.asm
000734   6ead     MOVWF     0xad,0x0       	movwf	TXREG			;carriage return                                                  D:\PIC18_Project\p18demo.asm
000736   a2ac     BTFSS     0xac,0x1,0x0   	btfss	TXSTA,TRMT		;wait for data TX                                             D:\PIC18_Project\p18demo.asm
000738   ef9b     GOTO      0x736          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
00073a   f003                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00073c   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                           ;----------------------------------------------------------------------          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;------------------ 100ms Delay --------------------------------                 D:\PIC18_Project\p18demo.asm
                                           delay_100ms                                                                      D:\PIC18_Project\p18demo.asm
00073e   0eff     MOVLW     0xff           	movlw	0xFF                                                                      D:\PIC18_Project\p18demo.asm
000740   6f82     MOVWF     0x82,0x1       	movwf	temp_1                                                                    D:\PIC18_Project\p18demo.asm
000742   0e83     MOVLW     0x83           	movlw	0x83                                                                      D:\PIC18_Project\p18demo.asm
000744   6f83     MOVWF     0x83,0x1       	movwf	temp_2                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           d100l1                                                                           D:\PIC18_Project\p18demo.asm
000746   2f82     DECFSZ    0x82,0x1,0x1   	decfsz	temp_1,F                                                                 D:\PIC18_Project\p18demo.asm
000748   d7fe     BRA       0x746          	bra	d100l1                                                                      D:\PIC18_Project\p18demo.asm
00074a   2f83     DECFSZ    0x83,0x1,0x1   	decfsz	temp_2,F                                                                 D:\PIC18_Project\p18demo.asm
00074c   d7fc     BRA       0x746          	bra	d100l1                                                                      D:\PIC18_Project\p18demo.asm
00074e   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;---------------- 1s Delay -----------------------------------                   D:\PIC18_Project\p18demo.asm
                                           delay_1s                                                                         D:\PIC18_Project\p18demo.asm
000750   0eff     MOVLW     0xff           	movlw	0xFF                                                                      D:\PIC18_Project\p18demo.asm
000752   6f82     MOVWF     0x82,0x1       	movwf	temp_1                                                                    D:\PIC18_Project\p18demo.asm
000754   6f83     MOVWF     0x83,0x1       	movwf	temp_2                                                                    D:\PIC18_Project\p18demo.asm
000756   0e05     MOVLW     0x5            	movlw	0x05                                                                      D:\PIC18_Project\p18demo.asm
000758   6f84     MOVWF     0x84,0x1       	movwf	temp_3                                                                    D:\PIC18_Project\p18demo.asm
                                           d1l1                                                                             D:\PIC18_Project\p18demo.asm
00075a   2f82     DECFSZ    0x82,0x1,0x1   	decfsz	temp_1,F                                                                 D:\PIC18_Project\p18demo.asm
00075c   d7fe     BRA       0x75a          	bra	d1l1                                                                        D:\PIC18_Project\p18demo.asm
00075e   2f83     DECFSZ    0x83,0x1,0x1   	decfsz	temp_2,F                                                                 D:\PIC18_Project\p18demo.asm
000760   d7fc     BRA       0x75a          	bra	d1l1                                                                        D:\PIC18_Project\p18demo.asm
000762   2f84     DECFSZ    0x84,0x1,0x1   	decfsz	temp_3,F                                                                 D:\PIC18_Project\p18demo.asm
000764   d7fa     BRA       0x75a          	bra	d1l1                                                                        D:\PIC18_Project\p18demo.asm
000766   0012     RETURN    0x0            	return	                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;---------------- Set Current Time ----------------------------                  D:\PIC18_Project\p18demo.asm
                                           set_time                                                                         D:\PIC18_Project\p18demo.asm
000768   0e80     MOVLW     0x80           	movlw	.128			;send "RA4= --> RBO= ++" to LCD                                    D:\PIC18_Project\p18demo.asm
00076a   6f80     MOVWF     0x80,0x1       	movwf	ptr_pos                                                                   D:\PIC18_Project\p18demo.asm
00076c   ec7e     CALL      0x6fc,0x0      	call	stan_char_2                                                                D:\PIC18_Project\p18demo.asm
00076e   f003                                                                                                               
                                           set_time_again                                                                   D:\PIC18_Project\p18demo.asm
000770   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for button release                                         D:\PIC18_Project\p18demo.asm
000772   d7fe     BRA       0x770          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000774   ec15     CALL      0x2a,0x0       	call	LCDLine_1		;start at 0x00 on LCD                                           D:\PIC18_Project\p18demo.asm
000776   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000778   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 button release                                     D:\PIC18_Project\p18demo.asm
00077a   d7fe     BRA       0x778          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
00077c   ec9f     CALL      0x73e,0x0      	call	delay_100ms			                                                             D:\PIC18_Project\p18demo.asm
00077e   f003                                                                                                               
000780   a081     BTFSS     0x81,0x0,0x0   	btfss  	select			;increment hours (tens) ?                                      D:\PIC18_Project\p18demo.asm
000782   d001     BRA       0x786          	bra	inc_hours                                                                   D:\PIC18_Project\p18demo.asm
000784   d006     BRA       0x792          	bra	next_digit                                                                  D:\PIC18_Project\p18demo.asm
                                           inc_hours	                                                                       D:\PIC18_Project\p18demo.asm
000786   2b8c     INCF      0x8c,0x1,0x1   	incf	hours                                                                      D:\PIC18_Project\p18demo.asm
000788   518c     MOVF      0x8c,0x0,0x1   	movf	hours,W			;check if hours has passed 12 ?                                  D:\PIC18_Project\p18demo.asm
00078a   080d     SUBLW     0xd            	sublw	.13                                                                       D:\PIC18_Project\p18demo.asm
00078c   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z                                                                  D:\PIC18_Project\p18demo.asm
00078e   d001     BRA       0x792          	bra	next_digit                                                                  D:\PIC18_Project\p18demo.asm
000790   6b8c     CLRF      0x8c,0x1       	clrf	hours			;YES, reset hours to 00                                            D:\PIC18_Project\p18demo.asm
                                           next_digit                                                                       D:\PIC18_Project\p18demo.asm
000792   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;move to next digit                                              D:\PIC18_Project\p18demo.asm
000794   d010     BRA       0x7b6          	bra	inc_mins                                                                    D:\PIC18_Project\p18demo.asm
000796   518c     MOVF      0x8c,0x0,0x1   	movf	hours,W		                                                                  D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000798   ec0d     CALL      0x81a,0x0      	call	bin_bcd			;get hours ready for display                                     D:\PIC18_Project\p18demo.asm
00079a   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
00079c   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send tens digit                                                   D:\PIC18_Project\p18demo.asm
00079e   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007a0   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0007a2   f000                                                                                                               
0007a4   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send ones digit                                                   D:\PIC18_Project\p18demo.asm
0007a6   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007a8   ec1d     CALL      0x3a,0x0       	call	d_write	                                                                   D:\PIC18_Project\p18demo.asm
0007aa   f000                                                                                                               
0007ac   0e3a     MOVLW     0x3a           	movlw	0x3A			;send   :   colon                                                  D:\PIC18_Project\p18demo.asm
0007ae   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007b0   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
0007b2   f000                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0007b4   d7dd     BRA       0x770          	bra	set_time_again                                                              D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
                                           inc_mins                                                                         D:\PIC18_Project\p18demo.asm
0007b6   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for RA4 button release                                     D:\PIC18_Project\p18demo.asm
0007b8   d7fe     BRA       0x7b6          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
0007ba   ec15     CALL      0x2a,0x0       	call	LCDLine_1                                                                  D:\PIC18_Project\p18demo.asm
0007bc   f000                                                                                                               
0007be   0e14     MOVLW     0x14           	movlw	0x14			;shift cursor to right 3 places                                    D:\PIC18_Project\p18demo.asm
0007c0   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007c2   ec26     CALL      0x4c,0x0       	call	i_write                                                                    D:\PIC18_Project\p18demo.asm
0007c4   f000                                                                                                               
0007c6   0e14     MOVLW     0x14           	movlw	0x14                                                                      D:\PIC18_Project\p18demo.asm
0007c8   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007ca   ec26     CALL      0x4c,0x0       	call	i_write                                                                    D:\PIC18_Project\p18demo.asm
0007cc   f000                                                                                                               
0007ce   0e14     MOVLW     0x14           	movlw	0x14                                                                      D:\PIC18_Project\p18demo.asm
0007d0   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007d2   ec26     CALL      0x4c,0x0       	call	i_write                                                                    D:\PIC18_Project\p18demo.asm
0007d4   f000                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0007d6   a081     BTFSS     0x81,0x0,0x0   	btfss	select			;wait for RB0 button release                                     D:\PIC18_Project\p18demo.asm
0007d8   d7fe     BRA       0x7d6          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
0007da   ec9f     CALL      0x73e,0x0      	call	delay_100ms                                                                D:\PIC18_Project\p18demo.asm
0007dc   f003                                                                                                               
0007de   a081     BTFSS     0x81,0x0,0x0   	btfss  	select			;increment minutes (tens) ?                                    D:\PIC18_Project\p18demo.asm
0007e0   d001     BRA       0x7e4          	bra	inc_minutes                                                                 D:\PIC18_Project\p18demo.asm
0007e2   d006     BRA       0x7f0          	bra	next_digit?                                                                 D:\PIC18_Project\p18demo.asm
                                           inc_minutes	                                                                     D:\PIC18_Project\p18demo.asm
0007e4   2b8b     INCF      0x8b,0x1,0x1   	incf	minutes                                                                    D:\PIC18_Project\p18demo.asm
0007e6   518b     MOVF      0x8b,0x0,0x1   	movf	minutes,W		;check if hours has passed 12 ?                                 D:\PIC18_Project\p18demo.asm
0007e8   083c     SUBLW     0x3c           	sublw	.60                                                                       D:\PIC18_Project\p18demo.asm
0007ea   a4d8     BTFSS     0xd8,0x2,0x0   	btfss	STATUS,Z                                                                  D:\PIC18_Project\p18demo.asm
0007ec   d001     BRA       0x7f0          	bra	next_digit?                                                                 D:\PIC18_Project\p18demo.asm
0007ee   6b8b     CLRF      0x8b,0x1       	clrf	minutes                                                                    D:\PIC18_Project\p18demo.asm
                                           next_digit?                                                                      D:\PIC18_Project\p18demo.asm
0007f0   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;move to next digit                                              D:\PIC18_Project\p18demo.asm
0007f2   d010     BRA       0x814          	bra	set_time_done                                                               D:\PIC18_Project\p18demo.asm
0007f4   518b     MOVF      0x8b,0x0,0x1   	movf	minutes,W                                                                  D:\PIC18_Project\p18demo.asm
                                           		                                                                               D:\PIC18_Project\p18demo.asm
0007f6   ec0d     CALL      0x81a,0x0      	call	bin_bcd			;get minutes ready for display                                   D:\PIC18_Project\p18demo.asm
0007f8   f004                                                                                                               
                                           	                                                                                D:\PIC18_Project\p18demo.asm
0007fa   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W			;send tens digit                                                   D:\PIC18_Project\p18demo.asm
0007fc   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
0007fe   ec1d     CALL      0x3a,0x0       	call	d_write                                                                    D:\PIC18_Project\p18demo.asm
000800   f000                                                                                                               
000802   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W			;send ones digit                                                   D:\PIC18_Project\p18demo.asm
000804   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
000806   ec1d     CALL      0x3a,0x0       	call	d_write	                                                                   D:\PIC18_Project\p18demo.asm
000808   f000                                                                                                               
00080a   0e3a     MOVLW     0x3a           	movlw	0x3A			;send  :   colon                                                   D:\PIC18_Project\p18demo.asm
00080c   6fa1     MOVWF     0xa1,0x1       	movwf	temp_wr                                                                   D:\PIC18_Project\p18demo.asm
00080e   ec1d     CALL      0x3a,0x0       	call	d_write	                                                                   D:\PIC18_Project\p18demo.asm
000810   f000                                                                                                               
000812   d7d1     BRA       0x7b6          	bra	inc_mins                                                                    D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           set_time_done                                                                    D:\PIC18_Project\p18demo.asm
000814   a880     BTFSS     0x80,0x4,0x0   	btfss	scroll			;wait for RA4 button release                                     D:\PIC18_Project\p18demo.asm
000816   d7fe     BRA       0x814          	bra	$-2                                                                         D:\PIC18_Project\p18demo.asm
000818   d6f6     BRA       0x606          	bra	overflow                                                                    D:\PIC18_Project\p18demo.asm
                                           	                                                                                D:\PIC18_Project\p18demo.asm
                                           ;---------------- Binary (8-bit) to BCD -----------------------                  D:\PIC18_Project\p18demo.asm
                                           ;		255 = highest possible result                                                 D:\PIC18_Project\p18demo.asm
                                           bin_bcd                                                                          D:\PIC18_Project\p18demo.asm
00081a   6b89     CLRF      0x89,0x1       	clrf	MSD                                                                        D:\PIC18_Project\p18demo.asm
00081c   6b88     CLRF      0x88,0x1       	clrf	MsD                                                                        D:\PIC18_Project\p18demo.asm
00081e   6f87     MOVWF     0x87,0x1       	movwf	LSD		;move value to LSD                                                   D:\PIC18_Project\p18demo.asm
                                           ghundreth	                                                                       D:\PIC18_Project\p18demo.asm
000820   0e64     MOVLW     0x64           	movlw	.100		;subtract 100 from LSD                                              D:\PIC18_Project\p18demo.asm
000822   5d87     SUBWF     0x87,0x0,0x1   	subwf	LSD,W                                                                     D:\PIC18_Project\p18demo.asm
000824   a0d8     BTFSS     0xd8,0x0,0x0   	btfss	STATUS,C	;is value greater then 100                                       D:\PIC18_Project\p18demo.asm
000826   d003     BRA       0x82e          	bra	gtenth		;NO goto tenths                                                     D:\PIC18_Project\p18demo.asm
000828   6f87     MOVWF     0x87,0x1       	movwf	LSD		;YES, move subtraction result into LSD                               D:\PIC18_Project\p18demo.asm
00082a   2b89     INCF      0x89,0x1,0x1   	incf	MSD,F		;increment hundreths                                                D:\PIC18_Project\p18demo.asm
00082c   d7f9     BRA       0x820          	bra	ghundreth	                                                                  D:\PIC18_Project\p18demo.asm
                                           gtenth                                                                           D:\PIC18_Project\p18demo.asm
00082e   0e0a     MOVLW     0xa            	movlw	.10		;take care of tenths                                                 D:\PIC18_Project\p18demo.asm
000830   5d87     SUBWF     0x87,0x0,0x1   	subwf	LSD,W                                                                     D:\PIC18_Project\p18demo.asm
000832   a0d8     BTFSS     0xd8,0x0,0x0   	btfss	STATUS,C                                                                  D:\PIC18_Project\p18demo.asm
000834   d003     BRA       0x83c          	bra	over		;finished conversion                                                  D:\PIC18_Project\p18demo.asm
000836   6f87     MOVWF     0x87,0x1       	movwf	LSD                                                                       D:\PIC18_Project\p18demo.asm
000838   2b88     INCF      0x88,0x1,0x1   	incf	MsD,F		;increment tenths position                                          D:\PIC18_Project\p18demo.asm
00083a   d7f9     BRA       0x82e          	bra	gtenth                                                                      D:\PIC18_Project\p18demo.asm
                                           over				;0 - 9, high nibble = 3 for LCD                                          D:\PIC18_Project\p18demo.asm
00083c   5189     MOVF      0x89,0x0,0x1   	movf	MSD,W		;get BCD values ready for LCD display                               D:\PIC18_Project\p18demo.asm
00083e   0a30     XORLW     0x30           	xorlw	0x30		;convert to LCD digit                                               D:\PIC18_Project\p18demo.asm
000840   6f89     MOVWF     0x89,0x1       	movwf	MSD                                                                       D:\PIC18_Project\p18demo.asm
000842   5188     MOVF      0x88,0x0,0x1   	movf	MsD,W                                                                      D:\PIC18_Project\p18demo.asm
000844   0a30     XORLW     0x30           	xorlw	0x30		;convert to LCD digit                                               D:\PIC18_Project\p18demo.asm
000846   6f88     MOVWF     0x88,0x1       	movwf	MsD                                                                       D:\PIC18_Project\p18demo.asm
000848   5187     MOVF      0x87,0x0,0x1   	movf	LSD,W                                                                      D:\PIC18_Project\p18demo.asm
00084a   0a30     XORLW     0x30           	xorlw	0x30		;convert to LCD digit                                               D:\PIC18_Project\p18demo.asm
00084c   6f87     MOVWF     0x87,0x1       	movwf	LSD                                                                       D:\PIC18_Project\p18demo.asm
00084e   0c00     RETLW     0x0            	retlw	0                                                                         D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;---------------- Binary (16-bit) to BCD -----------------------                 D:\PIC18_Project\p18demo.asm
                                           ;		xxx = highest possible result                                                 D:\PIC18_Project\p18demo.asm
                                           bin16_bcd                                                                        D:\PIC18_Project\p18demo.asm
                                           	                       ; Takes number in NumH:NumL                              D:\PIC18_Project\p18demo.asm
                                                                           ; Returns decimal in                             D:\PIC18_Project\p18demo.asm
                                                                           ; TenK:Thou:Hund:Tens:Ones                       D:\PIC18_Project\p18demo.asm
000850   398d     SWAPF     0x8d,0x0,0x1           swapf   NumH,W                                                           D:\PIC18_Project\p18demo.asm
000852   0b0f     ANDLW     0xf                    andlw   0x0F                                                             D:\PIC18_Project\p18demo.asm
000854   0ff0     ADDLW     0xf0                   addlw   0xF0                                                             D:\PIC18_Project\p18demo.asm
000856   6f90     MOVWF     0x90,0x1               movwf   Thou                                                             D:\PIC18_Project\p18demo.asm
000858   2790     ADDWF     0x90,0x1,0x1           addwf   Thou,F                                                           D:\PIC18_Project\p18demo.asm
00085a   0fe2     ADDLW     0xe2                   addlw   0xE2                                                             D:\PIC18_Project\p18demo.asm
00085c   6f91     MOVWF     0x91,0x1               movwf   Hund                                                             D:\PIC18_Project\p18demo.asm
00085e   0f32     ADDLW     0x32                   addlw   0x32                                                             D:\PIC18_Project\p18demo.asm
000860   6f93     MOVWF     0x93,0x1               movwf   Ones                                                             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000862   518d     MOVF      0x8d,0x0,0x1           movf    NumH,W                                                           D:\PIC18_Project\p18demo.asm
000864   0b0f     ANDLW     0xf                    andlw   0x0F                                                             D:\PIC18_Project\p18demo.asm
000866   2791     ADDWF     0x91,0x1,0x1           addwf   Hund,F                                                           D:\PIC18_Project\p18demo.asm
000868   2791     ADDWF     0x91,0x1,0x1           addwf   Hund,F                                                           D:\PIC18_Project\p18demo.asm
00086a   2793     ADDWF     0x93,0x1,0x1           addwf   Ones,F                                                           D:\PIC18_Project\p18demo.asm
00086c   0fe9     ADDLW     0xe9                   addlw   0xE9                                                             D:\PIC18_Project\p18demo.asm
00086e   6f92     MOVWF     0x92,0x1               movwf   Tens                                                             D:\PIC18_Project\p18demo.asm
000870   2792     ADDWF     0x92,0x1,0x1           addwf   Tens,F                                                           D:\PIC18_Project\p18demo.asm
000872   2792     ADDWF     0x92,0x1,0x1           addwf   Tens,F                                                           D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000874   398e     SWAPF     0x8e,0x0,0x1           swapf   NumL,W                                                           D:\PIC18_Project\p18demo.asm
000876   0b0f     ANDLW     0xf                    andlw   0x0F                                                             D:\PIC18_Project\p18demo.asm
000878   2792     ADDWF     0x92,0x1,0x1           addwf   Tens,F                                                           D:\PIC18_Project\p18demo.asm
00087a   2793     ADDWF     0x93,0x1,0x1           addwf   Ones,F                                                           D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00087c   3792     RLCF      0x92,0x1,0x1           rlcf     Tens,F                                                          D:\PIC18_Project\p18demo.asm
00087e   3793     RLCF      0x93,0x1,0x1           rlcf     Ones,F                                                          D:\PIC18_Project\p18demo.asm
000880   1f93     COMF      0x93,0x1,0x1           comf    Ones,F                                                           D:\PIC18_Project\p18demo.asm
000882   3793     RLCF      0x93,0x1,0x1           rlcf     Ones,F                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000884   518e     MOVF      0x8e,0x0,0x1           movf    NumL,W                                                           D:\PIC18_Project\p18demo.asm
000886   0b0f     ANDLW     0xf                    andlw   0x0F                                                             D:\PIC18_Project\p18demo.asm
000888   2793     ADDWF     0x93,0x1,0x1           addwf   Ones,F                                                           D:\PIC18_Project\p18demo.asm
00088a   3790     RLCF      0x90,0x1,0x1           rlcf     Thou,F                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00088c   0e07     MOVLW     0x7                    movlw   0x07                                                             D:\PIC18_Project\p18demo.asm
00088e   6f8f     MOVWF     0x8f,0x1               movwf   TenK                                                             D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
000890   0e0a     MOVLW     0xa                    movlw   0x0A                             ; Ten                           D:\PIC18_Project\p18demo.asm
                                           Lb1:                                                                             D:\PIC18_Project\p18demo.asm
000892   0792     DECF      0x92,0x1,0x1           decf    Tens,F                                                           D:\PIC18_Project\p18demo.asm
000894   2793     ADDWF     0x93,0x1,0x1           addwf   Ones,F                                                           D:\PIC18_Project\p18demo.asm
000896   a0d8     BTFSS     0xd8,0x0,0x0           btfss   STATUS,C                                                         D:\PIC18_Project\p18demo.asm
000898   d7fc     BRA       0x892                   bra   Lb1                                                               D:\PIC18_Project\p18demo.asm
                                           Lb2:                                                                             D:\PIC18_Project\p18demo.asm
00089a   0791     DECF      0x91,0x1,0x1           decf    Hund,F                                                           D:\PIC18_Project\p18demo.asm
00089c   2792     ADDWF     0x92,0x1,0x1           addwf   Tens,F                                                           D:\PIC18_Project\p18demo.asm
00089e   a0d8     BTFSS     0xd8,0x0,0x0           btfss   STATUS,C                                                         D:\PIC18_Project\p18demo.asm
0008a0   d7fc     BRA       0x89a                   bra   Lb2                                                               D:\PIC18_Project\p18demo.asm
                                           Lb3:                                                                             D:\PIC18_Project\p18demo.asm
0008a2   0790     DECF      0x90,0x1,0x1           decf    Thou,F                                                           D:\PIC18_Project\p18demo.asm
0008a4   2791     ADDWF     0x91,0x1,0x1           addwf   Hund,F                                                           D:\PIC18_Project\p18demo.asm
0008a6   a0d8     BTFSS     0xd8,0x0,0x0           btfss   STATUS,C                                                         D:\PIC18_Project\p18demo.asm
0008a8   d7fc     BRA       0x8a2                   bra   Lb3                                                               D:\PIC18_Project\p18demo.asm
                                           Lb4:                                                                             D:\PIC18_Project\p18demo.asm
0008aa   078f     DECF      0x8f,0x1,0x1           decf    TenK,F                                                           D:\PIC18_Project\p18demo.asm
0008ac   2790     ADDWF     0x90,0x1,0x1           addwf   Thou,F                                                           D:\PIC18_Project\p18demo.asm
0008ae   a0d8     BTFSS     0xd8,0x0,0x0           btfss   STATUS,C                                                         D:\PIC18_Project\p18demo.asm
0008b0   d7fc     BRA       0x8aa                   bra   Lb4                                                               D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
0008b2   0c00     RETLW     0x0                    retlw   0                                                                D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;---------------------------- EEPROM WRITE -------------------------------       D:\PIC18_Project\p18demo.asm
                                           write_eeprom	                                                                    D:\PIC18_Project\p18demo.asm
0008b4   80c5     BSF       0xc5,0x0,0x0   	bsf	SSPCON2,SEN		;start bit                                                     D:\PIC18_Project\p18demo.asm
0008b6   b0c5     BTFSC     0xc5,0x0,0x0   	btfsc	SSPCON2,SEN                                                               D:\PIC18_Project\p18demo.asm
0008b8   ef5b     GOTO      0x8b6          	goto	$-2	                                                                       D:\PIC18_Project\p18demo.asm
0008ba   f004                                                                                                               
0008bc   0ea0     MOVLW     0xa0           	movlw	B'10100000'		;send control byte (write)                                   D:\PIC18_Project\p18demo.asm
0008be   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
0008c0   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
0008c2   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
0008c4   0800     SUBLW     0x0                                                                                             
0008c6   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
0008c8   d7fb     BRA       0x8c0                                                                                           
0008ca   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
0008cc   d7fe     BRA       0x8ca                                                                                           
0008ce   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
0008d0   ef67     GOTO      0x8ce          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
0008d2   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0008d4   0e00     MOVLW     0x0            	movlw	0x00			;send slave address HIGH byte                                      D:\PIC18_Project\p18demo.asm
0008d6   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
0008d8   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
0008da   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
0008dc   0800     SUBLW     0x0                                                                                             
0008de   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
0008e0   d7fb     BRA       0x8d8                                                                                           
0008e2   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
0008e4   d7fe     BRA       0x8e2                                                                                           
0008e6   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
0008e8   ef73     GOTO      0x8e6          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
0008ea   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
0008ec   0e05     MOVLW     0x5            	movlw	0x05			;send slave address LOW byte(0x0005)                               D:\PIC18_Project\p18demo.asm
0008ee   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
0008f0   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
0008f2   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
0008f4   0800     SUBLW     0x0                                                                                             
0008f6   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
0008f8   d7fb     BRA       0x8f0                                                                                           
0008fa   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
0008fc   d7fe     BRA       0x8fa                                                                                           
0008fe   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
000900   ef7f     GOTO      0x8fe          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
000902   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
000904   5186     MOVF      0x86,0x0,0x1   	movf	temperature,w		;send slave DATA = temperature                              D:\PIC18_Project\p18demo.asm
000906   6ec9     MOVWF     0xc9,0x0       	movwf	SSPBUF                                                                    D:\PIC18_Project\p18demo.asm
000908   0e00     MOVLW     0x0            	ssprw                                                                           D:\PIC18_Project\p18demo.asm
00090a   14c5     ANDWF     0xc5,0x0,0x0                                                                                    
00090c   0800     SUBLW     0x0                                                                                             
00090e   a4d8     BTFSS     0xd8,0x2,0x0                                                                                    
000910   d7fb     BRA       0x908                                                                                           
000912   b4c7     BTFSC     0xc7,0x2,0x0                                                                                    
000914   d7fe     BRA       0x912                                                                                           
000916   bcc5     BTFSC     0xc5,0x6,0x0   	btfsc	SSPCON2,ACKSTAT		;ack?                                                    D:\PIC18_Project\p18demo.asm
000918   ef8b     GOTO      0x916          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
00091a   f004                                                                                                               
                                                                                                                            D:\PIC18_Project\p18demo.asm
00091c   84c5     BSF       0xc5,0x2,0x0   	bsf	SSPCON2,PEN		;stop bit                                                      D:\PIC18_Project\p18demo.asm
00091e   b4c5     BTFSC     0xc5,0x2,0x0   	btfsc	SSPCON2,PEN                                                               D:\PIC18_Project\p18demo.asm
000920   ef8f     GOTO      0x91e          	goto	$-2                                                                        D:\PIC18_Project\p18demo.asm
000922   f004                                                                                                               
                                           		                                                                               D:\PIC18_Project\p18demo.asm
000924   909e     BCF       0x9e,0x0,0x0   	bcf	PIR1,TMR1IF		;clear TIMER1 overflow flag                                    D:\PIC18_Project\p18demo.asm
000926   6ace     CLRF      0xce,0x0       	clrf	TMR1L			;clear registers for next overflow                                 D:\PIC18_Project\p18demo.asm
000928   6acf     CLRF      0xcf,0x0       	clrf	TMR1H                                                                      D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
00092a   0012     RETURN    0x0            	return                                                                          D:\PIC18_Project\p18demo.asm
                                                                                                                            D:\PIC18_Project\p18demo.asm
                                           ;*********************************************************************           D:\PIC18_Project\p18demo.asm
                                           	end	                                                                            D:\PIC18_Project\p18demo.asm
