MP2COD 4.12, COFF to COD File Converter Copyright (c) 2007 Microchip Technology Inc. Listing File Generated: Tue Aug 28 22:40:25 2007 Address Value Disassembly Source File ------- ------- ----------------------- ------------------------------------------------------------------------------- ----- /********************************************************************* C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c ********************************************************************* C:\Projects\UBW\FW\D_143\main.c * FileName: main.c C:\Projects\UBW\FW\D_143\main.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\main.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\main.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\main.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Software License Agreement C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\main.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\main.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\main.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\main.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\main.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\main.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\main.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\main.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\main.c * license. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\main.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\main.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\main.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\main.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\main.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Author Date Comment C:\Projects\UBW\FW\D_143\main.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\main.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\main.c ********************************************************************/ C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\main.c #include C:\Projects\UBW\FW\D_143\main.c #include "system\typedefs.h" // Required C:\Projects\UBW\FW\D_143\main.c #include "system\usb\usb.h" // Required C:\Projects\UBW\FW\D_143\main.c #include "io_cfg.h" // Required C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c #include "system\usb\usb_compile_time_validation.h" // Optional C:\Projects\UBW\FW\D_143\main.c #include "user\user.h" // Modifiable C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\main.c #pragma udata C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\main.c static void InitializeSystem(void); C:\Projects\UBW\FW\D_143\main.c void USBTasks(void); C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c #pragma code high_vector_section = 0x000808 C:\Projects\UBW\FW\D_143\main.c void high_vector (void) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c 000808 efbb GOTO 0xb76 _asm goto high_ISR _endasm C:\Projects\UBW\FW\D_143\main.c 00080a f005 00080c 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\main.c #pragma code low_vector_section = 0x000818 C:\Projects\UBW\FW\D_143\main.c void low_vector (void) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c 000818 ef22 GOTO 0x844 _asm goto low_ISR _endasm C:\Projects\UBW\FW\D_143\main.c 00081a f004 00081c 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\main.c #pragma code C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\main.c #pragma code C:\Projects\UBW\FW\D_143\main.c /****************************************************************************** C:\Projects\UBW\FW\D_143\main.c * Function: void main(void) C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * PreCondition: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Input: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Output: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Side Effects: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Overview: Main program entry point. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Note: None C:\Projects\UBW\FW\D_143\main.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\main.c void main(void) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c 004544 d805 RCALL 0x4550 InitializeSystem(); C:\Projects\UBW\FW\D_143\main.c 00454c d7fc BRA 0x4546 while(1) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c 004546 d811 RCALL 0x456a USBTasks(); // USB Tasks C:\Projects\UBW\FW\D_143\main.c 004548 ec8f CALL 0xd1e,0x0 ProcessIO(); // See user\user.c & .h C:\Projects\UBW\FW\D_143\main.c 00454a f006 }//end while C:\Projects\UBW\FW\D_143\main.c 00454e 0012 RETURN 0x0 }//end main C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /****************************************************************************** C:\Projects\UBW\FW\D_143\main.c * Function: static void InitializeSystem(void) C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * PreCondition: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Input: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Output: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Side Effects: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Overview: InitializeSystem is a centralize initialization routine. C:\Projects\UBW\FW\D_143\main.c * All required USB initialization routines are called from C:\Projects\UBW\FW\D_143\main.c * here. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * User application initialization routine should also be C:\Projects\UBW\FW\D_143\main.c * called from here. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Note: None C:\Projects\UBW\FW\D_143\main.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\main.c static void InitializeSystem(void) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c 004550 0e0f MOVLW 0xf ADCON1 |= 0x0F; // Default all pins to digital C:\Projects\UBW\FW\D_143\main.c 004552 12c1 IORWF 0xc1,0x1,0x0 C:\Projects\UBW\FW\D_143\main.c 004554 0e14 MOVLW 0x14 mInitializeUSBDriver(); // See usbdrv.h C:\Projects\UBW\FW\D_143\main.c 004556 6e6f MOVWF 0x6f,0x0 004558 0101 MOVLB 0x1 00455a 6bd2 CLRF 0xd2,0x1 00455c 0101 MOVLB 0x1 00455e 6bd3 CLRF 0xd3,0x1 004560 0101 MOVLB 0x1 004562 6bd4 CLRF 0xd4,0x1 C:\Projects\UBW\FW\D_143\main.c 004564 ecc4 CALL 0xb88,0x0 UserInit(); // See user.c & .h C:\Projects\UBW\FW\D_143\main.c 004566 f005 C:\Projects\UBW\FW\D_143\main.c 004568 0012 RETURN 0x0 }//end InitializeSystem C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /****************************************************************************** C:\Projects\UBW\FW\D_143\main.c * Function: void USBTasks(void) C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * PreCondition: InitializeSystem has been called. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Input: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Output: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Side Effects: None C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Overview: Service loop for USB tasks. C:\Projects\UBW\FW\D_143\main.c * C:\Projects\UBW\FW\D_143\main.c * Note: None C:\Projects\UBW\FW\D_143\main.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\main.c void USBTasks(void) C:\Projects\UBW\FW\D_143\main.c { C:\Projects\UBW\FW\D_143\main.c /* C:\Projects\UBW\FW\D_143\main.c * Servicing Hardware C:\Projects\UBW\FW\D_143\main.c */ C:\Projects\UBW\FW\D_143\main.c 00456a eccd CALL 0x3d9a,0x0 USBCheckBusStatus(); // Must use polling method C:\Projects\UBW\FW\D_143\main.c 00456c f01e 00456e be6f BTFSC 0x6f,0x7,0x0 if(UCFGbits.UTEYE!=1) C:\Projects\UBW\FW\D_143\main.c 004570 d002 BRA 0x4576 004572 eced CALL 0x3dda,0x0 USBDriverService(); // Interrupt or polling method C:\Projects\UBW\FW\D_143\main.c 004574 f01e C:\Projects\UBW\FW\D_143\main.c #if defined(USB_USE_CDC) C:\Projects\UBW\FW\D_143\main.c 004576 ec17 CALL 0x362e,0x0 CDCTxService(); C:\Projects\UBW\FW\D_143\main.c 004578 f01b #endif C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c 00457a 0012 RETURN 0x0 }// end USBTasks C:\Projects\UBW\FW\D_143\main.c C:\Projects\UBW\FW\D_143\main.c /** EOF main.c ***************************************************************/ C:\Projects\UBW\FW\D_143\main.c /********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c ********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * FileName: usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Software License Agreement C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * license. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Author Date Comment C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c ********************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * -usbmmap.c- C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * USB Memory Map C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * This file is the USB memory manager; it serves as a compile-time memory C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * allocator for the USB endpoints. It uses the compile time options passed C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * from usbcfg.h to instantiate endpoints and endpoint buffer. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Each endpoint requires to have a set of Buffer Descriptor registers(BDT). C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * A BDT is 4-byte long and has a specific RAM location for each endpoint. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The BDT for endpoint 0 out is located at address 0x400 to 0x403. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The BDT for endpoint 0 in is located at address 0x404 to 0x407. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The BDT for endpoint 1 out is located at address 0x408 to 0x40B. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * and so on... The above allocation assumes the Ping-Pong Buffer Mode 0 is C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * used. These locations are already hard-wired in the silicon. The point C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * of doing instantiation, i.e. volatile far BDT ep0Bo;, is to provide the C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C compiler a way to address each variable directly. This is very important C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * because when a register can be accessed directly, it saves execution time C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * and reduces program size. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Endpoints are defined using the endpoint number and the direction C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * of transfer. For simplicity, usbmmap.c only uses the endpoint number C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * in the BDT register allocation scheme. This means if the usbcfg.h states C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * that the MAX_EP_NUMBER is number 1, then four BDTs will be C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * instantiated: one each for endpoint0 in and endpoint0 out, which must C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * always be instantiated for control transfer by default, and one each sets C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * for endpoint1 in and endpoint1 out. The naming convention for instantiating C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * BDT is C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * ep<#>B C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * where # is the endpoint number, and d is the direction of C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * transfer, which could be either or . C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The USB memory manager uses MAX_EP_NUMBER, as defined in usbcfg.h, to define C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * the endpoints to be instantiated. This represents the highest endpoint C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * number to be allocated, not how many endpoints are used. Since the BDTs for C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * endpoints have hardware-assigned addresses in Bank 4, setting this value too C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * high may lead to inefficient use of data RAM. For example, if an application C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * uses only endpoints EP0 and EP4, then the MAX_EP_NUMBER is 4, and not 2. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The in-between endpoint BDTs in this example (EP1, EP2, and EP3) go unused, C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * and the 24 bytes of memory associated with them are wasted. It does not make C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * much sense to skip endpoints, but the final decision lies with the user. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The next step is to assign the instantiated BDTs to different C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * USB functions. The firmware framework fundamentally assumes that every USB C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * function should know which endpoint it is using, i.e., the default control C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * transfer should know that it is using endpoint 0 in and endpoint 0 out. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * A HID class can choose which endpoint it wants to use, but once chosen, it C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * should always know the number of the endpoint. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The assignment of endpoints to USB functions is managed centrally C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * in usbcfg.h. This helps prevent the mistake of having more C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * than one USB function using the same endpoint. The "Endpoint Allocation" C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * section in usbcfg.h provides examples for how to map USB endpoints to USB C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * functions. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Quite a few things can be mapped in that section. There is no C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * one correct way to do the mapping and the user has the choice to C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * choose a method that is most suitable to the application. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Typically, however, a user will want to map the following for a given C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * USB interface function: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * 1. The USB interface ID C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * 2. The endpoint control registers (UEPn) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * 3. The BDT registers (ep<#>B) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * 4. The endpoint size C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Example: Assume a USB device class "foo", which uses one out endpoint C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * of size 64-byte and one in endpoint of size 64-byte, then: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * #define FOO_INTF_ID 0x00 C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * #define FOO_UEP UEP1 C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * #define FOO_BD_OUT ep1Bo C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * #define FOO_BD_IN ep1Bi C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * #define FOO_EP_SIZE 64 C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The mapping above has chosen class "foo" to use endpoint 1. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The names are arbitrary and can be anything other than FOO_??????. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * For abstraction, the code for class "foo" should use the abstract C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * definitions of FOO_BD_OUT,FOO_BD_IN, and not ep1Bo or ep1Bi. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Note that the endpoint size defined in the usbcfg.h file is again C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * used in the usbmmap.c file. This shows that the relationship between C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * the two files are tightly related. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The endpoint buffer for each USB function must be located in the C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * dual-port RAM area and has to come after all the BDTs have been C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * instantiated. An example declaration is: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * volatile far unsigned char[FOO_EP_SIZE] data; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * The 'volatile' keyword tells the compiler not to perform any code C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * optimization on this variable because its content could be modified C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * by the hardware. The 'far' keyword tells the compiler that this variable C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * is not located in the Access RAM area (0x000 - 0x05F). C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * For the variable to be globally accessible by other files, it should be C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * declared in the header file usbmmap.h as an extern definition, such as C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * extern volatile far unsigned char[FOO_EP_SIZE] data; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Conclusion: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * In a short summary, the dependencies between usbcfg and usbmmap can C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * be shown as: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * usbcfg[MAX_EP_NUMBER] -> usbmmap C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * usbmmap[ep<#>B] -> usbcfg C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * usbcfg[EP size] -> usbmmap C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * usbcfg[abstract ep definitions] -> usb9/hid/cdc/etc class code C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * usbmmap[endpoint buffer variable] -> usb9/hid/cdc/etc class code C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Data mapping provides a means for direct addressing of BDT and endpoint C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * buffer. This means less usage of pointers, which equates to a faster and C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * smaller program code. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /** U S B G L O B A L V A R I A B L E S ************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c byte usb_device_state; // Device States: DETACHED, ATTACHED, ... C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c USB_DEVICE_STATUS usb_stat; // Global USB flags C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c byte usb_active_cfg; // Value of current configuration C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c byte usb_alt_intf[MAX_NUM_INT]; // Array to keep track of the current alternate C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c // setting for each interface ID C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /** U S B F I X E D L O C A T I O N V A R I A B L E S *********************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #pragma udata usbram4=0x400 //See Linker Script,usb4:0x400-0x4FF(256-byte) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Section A: Buffer Descriptor Table C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - 0x400 - 0x4FF(max) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - MAX_EP_NUMBER is defined in autofiles\usbcfg.h C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - BDT data type is defined in system\usb\usbmmap.h C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(0 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep0Bo; //Endpoint #0 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep0Bi; //Endpoint #0 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(1 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep1Bo; //Endpoint #1 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep1Bi; //Endpoint #1 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(2 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep2Bo; //Endpoint #2 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep2Bi; //Endpoint #2 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(3 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep3Bo; //Endpoint #3 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep3Bi; //Endpoint #3 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(4 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep4Bo; //Endpoint #4 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep4Bi; //Endpoint #4 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(5 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep5Bo; //Endpoint #5 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep5Bi; //Endpoint #5 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(6 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep6Bo; //Endpoint #6 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep6Bi; //Endpoint #6 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(7 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep7Bo; //Endpoint #7 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep7Bi; //Endpoint #7 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(8 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep8Bo; //Endpoint #8 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep8Bi; //Endpoint #8 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(9 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep9Bo; //Endpoint #9 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep9Bi; //Endpoint #9 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(10 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep10Bo; //Endpoint #10 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep10Bi; //Endpoint #10 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(11 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep11Bo; //Endpoint #11 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep11Bi; //Endpoint #11 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(12 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep12Bo; //Endpoint #12 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep12Bi; //Endpoint #12 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(13 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep13Bo; //Endpoint #13 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep13Bi; //Endpoint #13 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(14 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep14Bo; //Endpoint #14 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep14Bi; //Endpoint #14 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if(15 <= MAX_EP_NUMBER) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep15Bo; //Endpoint #15 BD Out C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far BDT ep15Bi; //Endpoint #15 BD In C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Section B: EP0 Buffer Space C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c ****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Two buffer areas are defined: C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * A. CTRL_TRF_SETUP C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Size = EP0_BUFF_SIZE as defined in autofiles\usbcfg.h C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Detailed data structure allows direct adddressing of bits and bytes. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * B. CTRL_TRF_DATA C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Size = EP0_BUFF_SIZE as defined in autofiles\usbcfg.h C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Data structure allows direct adddressing of the first 8 bytes. C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * - Both data types are defined in system\usb\usbdefs\usbdefs_ep0_buff.h C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far CTRL_TRF_SETUP SetupPkt; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far CTRL_TRF_DATA CtrlTrfData; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * Section C: CDC Buffer C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c ****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c * C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #pragma udata usbram5a=0x500 //See Linker Script,usb5:0x500-... C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #if defined(USB_USE_CDC) C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far unsigned char cdc_notice[CDC_INT_EP_SIZE]; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far unsigned char cdc_data_rx[CDC_BULK_OUT_EP_SIZE]; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c volatile far unsigned char cdc_data_tx[CDC_BULK_IN_EP_SIZE]; C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #endif C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /** EOF usbmmap.c ************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbmmap.c /********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c ********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * FileName: usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Software License Agreement C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * license. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Author Date Comment C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c ********************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #include C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #include "io_cfg.h" // Required for USBCheckBusStatus() C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBModuleEnable(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBModuleDisable(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBSuspend(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBWakeFromSuspend(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBProtocolResetHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USB_SOF_Handler(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBStallHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBErrorHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #pragma code C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBCheckBusStatus(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: This routine enables/disables the USB module by monitoring C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the USB power signal. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBCheckBusStatus(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Bus Attachment & Detachment Detection C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * usb_bus_sense is an i/o pin defined in io_cfg.h C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #define USB_BUS_ATTACHED 1 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c #define USB_BUS_DETACHED 0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c if(usb_bus_sense == USB_BUS_ATTACHED) // Is USB bus attached? C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003d9a a66d BTFSS 0x6d,0x3,0x0 if(UCONbits.USBEN == 0) // Is the module off? C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003d9c d810 RCALL 0x3dbe USBModuleEnable(); // Is off, enable it C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c } C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003d9e d002 BRA 0x3da4 else C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003da0 b66d BTFSC 0x6d,0x3,0x0 if(UCONbits.USBEN == 1) // Is the module on? C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003da2 d814 RCALL 0x3dcc USBModuleDisable(); // Is on, disable it C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c }//end if(usb_bus_sense...) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * After enabling the USB module, it takes some time for the voltage C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * on the D+ or D- line to rise high enough to get out of the SE0 condition. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * The USB Reset interrupt should not be unmasked until the SE0 condition is C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * cleared. This helps preventing the firmware from misinterpreting this C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * unique event as a USB bus reset from the USB host. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003da4 0101 MOVLB 0x1 if(usb_device_state == ATTACHED_STATE) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003da6 05d2 DECF 0xd2,0x0,0x1 003da8 e109 BNZ 0x3dbc { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003daa ba6d BTFSC 0x6d,0x5,0x0 if(!UCONbits.SE0) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dac d007 BRA 0x3dbc { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dae 6a68 CLRF 0x68,0x0 UIR = 0; // Clear all USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003db0 6a69 CLRF 0x69,0x0 UIE = 0; // Mask all USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003db2 8069 BSF 0x69,0x0,0x0 UIEbits.URSTIE = 1; // Unmask RESET interrupt C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003db4 8869 BSF 0x69,0x4,0x0 UIEbits.IDLEIE = 1; // Unmask IDLE interrupt C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003db6 0101 MOVLB 0x1 usb_device_state = POWERED_STATE; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003db8 0e02 MOVLW 0x2 003dba 6fd2 MOVWF 0xd2,0x1 }//end if // else wait until SE0 is cleared C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c }//end if(usb_device_state == ATTACHED_STATE) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dbc 0012 RETURN 0x0 }//end USBCheckBusStatus C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBModuleEnable(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: This routine enables the USB module. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * An end designer should never have to call this routine C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * manually. This routine should only be called from C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * USBCheckBusStatus(). C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: See USBCheckBusStatus() for more information. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBModuleEnable(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dbe 6a6d CLRF 0x6d,0x0 UCON = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dc0 6a69 CLRF 0x69,0x0 UIE = 0; // Mask all USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dc2 866d BSF 0x6d,0x3,0x0 UCONbits.USBEN = 1; // Enable module & attach to bus C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dc4 0101 MOVLB 0x1 usb_device_state = ATTACHED_STATE; // Defined in usbmmap.c & .h C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dc6 0e01 MOVLW 0x1 003dc8 6fd2 MOVWF 0xd2,0x1 003dca 0012 RETURN 0x0 }//end USBModuleEnable C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBModuleDisable(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: This routine disables the USB module. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * An end designer should never have to call this routine C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * manually. This routine should only be called from C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * USBCheckBusStatus(). C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: See USBCheckBusStatus() for more information. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBModuleDisable(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dcc 6a6d CLRF 0x6d,0x0 UCON = 0; // Disable module & detach from bus C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dce 6a69 CLRF 0x69,0x0 UIE = 0; // Mask all USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dd0 0101 MOVLB 0x1 usb_device_state = DETACHED_STATE; // Defined in usbmmap.c & .h C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dd2 6bd2 CLRF 0xd2,0x1 003dd4 0012 RETURN 0x0 }//end USBModuleDisable C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBSoftDetach(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: The device will have to be re-enumerated to function again. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: USBSoftDetach electrically disconnects the device from C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the bus. This is done by stop supplying Vusb voltage to C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * pull-up resistor. The pull-down resistors on the host C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * side will pull both differential signal lines low and C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the host registers the event as a disconnect. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Since the USB cable is not physically disconnected, the C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * power supply through the cable can still be sensed by C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the device. The next time USBCheckBusStatus() function C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * is called, it will reconnect the device back to the bus. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBSoftDetach(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dd6 dffa RCALL 0x3dcc USBModuleDisable(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dd8 0012 RETURN 0x0 }//end USBSoftDetach C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBDriverService(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: This routine is the heart of this firmware. It manages C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * all USB interrupts. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: Device state transitions through the following stages: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * DETACHED -> ATTACHED -> POWERED -> DEFAULT -> C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ADDRESS_PENDING -> ADDRESSED -> CONFIGURED -> READY C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBDriverService(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Pointless to continue servicing if USB cable is not even attached. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003dda 0101 MOVLB 0x1 if(usb_device_state == DETACHED_STATE) return; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ddc 51d2 MOVF 0xd2,0x0,0x1 003dde e101 BNZ 0x3de2 003de0 d03a BRA 0x3e56 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Task A: Service USB Activity Interrupt C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003de2 5068 MOVF 0x68,0x0,0x0 if(UIRbits.ACTVIF && UIEbits.ACTVIE) USBWakeFromSuspend(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003de4 0b04 ANDLW 0x4 003de6 e004 BZ 0x3df0 003de8 5069 MOVF 0x69,0x0,0x0 003dea 0b04 ANDLW 0x4 003dec e001 BZ 0x3df0 003dee d83c RCALL 0x3e68 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Pointless to continue servicing if the device is in suspend mode. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003df0 b26d BTFSC 0x6d,0x1,0x0 if(UCONbits.SUSPND==1) return; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003df2 d031 BRA 0x3e56 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Task B: Service USB Bus Reset Interrupt. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * When bus reset is received during suspend, ACTVIF will be set first, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * once the UCONbits.SUSPND is clear, then the URSTIF bit will be asserted. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * This is why URSTIF is checked after ACTVIF. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003df4 5068 MOVF 0x68,0x0,0x0 if(UIRbits.URSTIF && UIEbits.URSTIE) USBProtocolResetHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003df6 0b01 ANDLW 0x1 003df8 e004 BZ 0x3e02 003dfa 5069 MOVF 0x69,0x0,0x0 003dfc 0b01 ANDLW 0x1 003dfe e001 BZ 0x3e02 003e00 d856 RCALL 0x3eae C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Task C: Service other USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e02 5068 MOVF 0x68,0x0,0x0 if(UIRbits.IDLEIF && UIEbits.IDLEIE) USBSuspend(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e04 0b10 ANDLW 0x10 003e06 e004 BZ 0x3e10 003e08 5069 MOVF 0x69,0x0,0x0 003e0a 0b10 ANDLW 0x10 003e0c e001 BZ 0x3e10 003e0e d824 RCALL 0x3e58 003e10 5068 MOVF 0x68,0x0,0x0 if(UIRbits.SOFIF && UIEbits.SOFIE) USB_SOF_Handler(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e12 0b40 ANDLW 0x40 003e14 e004 BZ 0x3e1e 003e16 5069 MOVF 0x69,0x0,0x0 003e18 0b40 ANDLW 0x40 003e1a e001 BZ 0x3e1e 003e1c d83d RCALL 0x3e98 003e1e 5068 MOVF 0x68,0x0,0x0 if(UIRbits.STALLIF && UIEbits.STALLIE) USBStallHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e20 0b20 ANDLW 0x20 003e22 e004 BZ 0x3e2c 003e24 5069 MOVF 0x69,0x0,0x0 003e26 0b20 ANDLW 0x20 003e28 e001 BZ 0x3e2c 003e2a d838 RCALL 0x3e9c 003e2c 5068 MOVF 0x68,0x0,0x0 if(UIRbits.UERRIF && UIEbits.UERRIE) USBErrorHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e2e 0b02 ANDLW 0x2 003e30 e004 BZ 0x3e3a 003e32 5069 MOVF 0x69,0x0,0x0 003e34 0b02 ANDLW 0x2 003e36 e001 BZ 0x3e3a 003e38 d838 RCALL 0x3eaa C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Pointless to continue servicing if the host has not sent a bus reset. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Once bus reset is received, the device transitions into the DEFAULT C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * state and is ready for communication. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e3a 0e03 MOVLW 0x3 if(usb_device_state < DEFAULT_STATE) return; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e3c 0101 MOVLB 0x1 003e3e 5dd2 SUBWF 0xd2,0x0,0x1 003e40 e201 BC 0x3e44 003e42 d009 BRA 0x3e56 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Task D: Servicing USB Transaction Complete Interrupt C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e44 5068 MOVF 0x68,0x0,0x0 if(UIRbits.TRNIF && UIEbits.TRNIE) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e46 0b08 ANDLW 0x8 003e48 e006 BZ 0x3e56 003e4a 5069 MOVF 0x69,0x0,0x0 003e4c 0b08 ANDLW 0x8 003e4e e003 BZ 0x3e56 { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * USBCtrlEPService only services transactions over EP0. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * It ignores all other EP transactions. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e50 eca1 CALL 0x3742,0x0 USBCtrlEPService(); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e52 f01b C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Other EP can be serviced later by responsible device class firmware. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Each device driver knows when an OUT or IN transaction is ready by C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * checking the buffer ownership bit. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * An OUT EP should always be owned by SIE until the data is ready. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * An IN EP should always be owned by CPU until the data is ready. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Because of this logic, it is not necessary to save the USTAT value C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * of non-EP0 transactions. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e54 9668 BCF 0x68,0x3,0x0 UIRbits.TRNIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c }//end if(UIRbits.TRNIF && UIEbits.TRNIE) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e56 0012 RETURN 0x0 }//end USBDriverService C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBSuspend(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBSuspend(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * NOTE: Do not clear UIRbits.ACTVIF here! C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Reason: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ACTVIF is only generated once an IDLEIF has been generated. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * This is a 1:1 ratio interrupt generation. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * For every IDLEIF, there will be only one ACTVIF regardless of C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the number of subsequent bus transitions. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * If the ACTIF is cleared here, a problem could occur when: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * [ IDLE ][bus activity -> C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * <--- 3 ms -----> ^ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ^ ACTVIF=1 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * IDLEIF=1 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * # # # # (#=Program polling flags) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ^ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * This polling loop will see both C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * IDLEIF=1 and ACTVIF=1. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * However, the program services IDLEIF first C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * because ACTIVIE=0. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * If this routine clears the only ACTIVIF, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * then it can never get out of the suspend C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * mode. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e58 8469 BSF 0x69,0x2,0x0 UIEbits.ACTVIE = 1; // Enable bus activity interrupt C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e5a 9868 BCF 0x68,0x4,0x0 UIRbits.IDLEIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e5c 826d BSF 0x6d,0x1,0x0 UCONbits.SUSPND = 1; // Put USB module in power conserve C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c // mode, SIE clock inactive C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * At this point the PIC can go into sleep,idle, or C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * switch to a slower clock, etc. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* Modifiable Section */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e5e 9aa1 BCF 0xa1,0x5,0x0 PIR2bits.USBIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e60 8aa0 BSF 0xa0,0x5,0x0 PIE2bits.USBIE = 1; // Set USB wakeup source C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e62 0003 SLEEP Sleep(); // Goto sleep C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e64 9aa0 BCF 0xa0,0x5,0x0 PIE2bits.USBIE = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* End Modifiable Section */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e66 0012 RETURN 0x0 }//end USBSuspend C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBWakeFromSuspend(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBWakeFromSuspend(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * If using clock switching, this is the place to restore the C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * original clock frequency. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e68 926d BCF 0x6d,0x1,0x0 UCONbits.SUSPND = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e6a 9469 BCF 0x69,0x2,0x0 UIEbits.ACTVIE = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e6c 9468 BCF 0x68,0x2,0x0 UIRbits.ACTVIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e6e 0012 RETURN 0x0 }//end USBWakeFromSuspend C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBRemoteWakeup(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: This function should be called by user when the device C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * is waken up by an external stimulus other than ACTIVIF. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Please read the note below to understand the limitations. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: The modifiable section in this routine should be changed C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * to meet the application needs. Current implementation C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * temporary blocks other functions from executing for a C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * period of 1-13 ms depending on the core frequency. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * According to USB 2.0 specification section 7.1.7.7, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * "The remote wakeup device must hold the resume signaling C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * for at lest 1 ms but for no more than 15 ms." C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * The idea here is to use a delay counter loop, using a C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * common value that would work over a wide range of core C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * frequencies. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * That value selected is 1800. See table below: C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ========================================================== C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Core Freq(MHz) MIP RESUME Signal Period (ms) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ========================================================== C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * 48 12 1.05 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * 4 1 12.6 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * ========================================================== C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * * These timing could be incorrect when using code C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * optimization or extended instruction mode, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * or when having other interrupts enabled. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Make sure to verify using the MPLAB SIM's Stopwatch C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBRemoteWakeup(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c static word delay_count; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e70 0101 MOVLB 0x1 if(usb_stat.RemoteWakeup == 1) // Check if RemoteWakeup function C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e72 a1d3 BTFSS 0xd3,0x0,0x1 003e74 d010 BRA 0x3e96 { // has been enabled by the host. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e76 dff8 RCALL 0x3e68 USBWakeFromSuspend(); // Unsuspend USB modue C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e78 846d BSF 0x6d,0x2,0x0 UCONbits.RESUME = 1; // Start RESUME signaling C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* Modifiable Section */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e7a 0101 MOVLB 0x1 delay_count = 1800U; // Set RESUME line for 1-13 ms C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e7c 0e08 MOVLW 0x8 003e7e 6fda MOVWF 0xda,0x1 003e80 0e07 MOVLW 0x7 003e82 6fdb MOVWF 0xdb,0x1 do C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e84 0101 MOVLB 0x1 delay_count--; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e86 07da DECF 0xda,0x1,0x1 003e88 0e00 MOVLW 0x0 003e8a 5bdb SUBWFB 0xdb,0x1,0x1 003e8c 0101 MOVLB 0x1 }while(delay_count); C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e8e 51da MOVF 0xda,0x0,0x1 003e90 11db IORWF 0xdb,0x0,0x1 003e92 e1f8 BNZ 0x3e84 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* End Modifiable Section */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e94 946d BCF 0x6d,0x2,0x0 UCONbits.RESUME = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c }//endif C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e96 0012 RETURN 0x0 }//end USBRemoteWakeup C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USB_SOF_Handler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: The USB host sends out a SOF packet to full-speed devices C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * every 1 ms. This interrupt may be useful for isochronous C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * pipes. End designers should implement callback routine C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * as necessary. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USB_SOF_Handler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* Callback routine here */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e98 9c68 BCF 0x68,0x6,0x0 UIRbits.SOFIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e9a 0012 RETURN 0x0 }//end USB_SOF_Handler C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBStallHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: A STALL packet is sent to the host by the SIE. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: The STALLIF is set anytime the SIE sends out a STALL C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * packet regardless of which endpoint causes it. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * A Setup transaction overrides the STALL function. A stalled C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * endpoint stops stalling once it receives a setup packet. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * In this case, the SIE will accepts the Setup packet and C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * set the TRNIF flag to notify the firmware. STALL function C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * for that particular endpoint pipe will be automatically C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * disabled (direction specific). C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * There are a few reasons for an endpoint to be stalled. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * 1. When a non-supported USB request is received. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Example: GET_DESCRIPTOR(DEVICE_QUALIFIER) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * 2. When an endpoint is currently halted. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * 3. When the device class specifies that an endpoint must C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * stall in response to a specific event. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Example: Mass Storage Device Class C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * If the CBW is not valid, the device shall C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * STALL the Bulk-In pipe. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * See USB Mass Storage Class Bulk-only Transport C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Specification for more details. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: UEPn.EPSTALL can be scanned to see which endpoint causes C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the stall event. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * If C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBStallHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Does not really have to do anything here, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * even for the control endpoint. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * All BDs of Endpoint 0 are owned by SIE right now, C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * but once a Setup Transaction is received, the ownership C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * for EP0_OUT will be returned to CPU. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * When the Setup Transaction is serviced, the ownership C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * for EP0_IN will then be forced back to CPU by firmware. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e9c a070 BTFSS 0x70,0x0,0x0 if(UEP0bits.EPSTALL == 1) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003e9e d003 BRA 0x3ea6 { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ea0 ec2e CALL 0x3a5c,0x0 USBPrepareForNextSetupTrf(); // Firmware work-around C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ea2 f01d 003ea4 9070 BCF 0x70,0x0,0x0 UEP0bits.EPSTALL = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c } C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ea6 9a68 BCF 0x68,0x5,0x0 UIRbits.STALLIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ea8 0012 RETURN 0x0 }//end USBStallHandler C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBErrorHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: The purpose of this interrupt is mainly for debugging C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * during development. Check UEIR to see which error causes C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * the interrupt. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBErrorHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eaa 9268 BCF 0x68,0x1,0x0 UIRbits.UERRIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eac 0012 RETURN 0x0 }//end USBErrorHandler C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Function: void USBProtocolResetHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * PreCondition: A USB bus reset is received from the host. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Side Effects: Currently, this routine flushes any pending USB C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * transactions. It empties out the USTAT FIFO. This action C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * might not be desirable in some applications. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Overview: Once a USB bus reset is received from the host, this C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * routine should be called. It resets the device address to C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * zero, disables all non-EP0 endpoints, initializes EP0 to C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * be ready for default communication, clears all USB C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * interrupt flags, unmasks applicable USB interrupts, and C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * reinitializes internal state-machine variables. C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c void USBProtocolResetHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eae 6a6a CLRF 0x6a,0x0 UEIR = 0; // Clear all USB error flags C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eb0 6a68 CLRF 0x68,0x0 UIR = 0; // Clears all USB interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eb2 0e9f MOVLW 0x9f UEIE = 0b10011111; // Unmask all USB error interrupts C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eb4 6e6b MOVWF 0x6b,0x0 003eb6 0e7b MOVLW 0x7b UIE = 0b01111011; // Enable all interrupts except ACTVIE C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eb8 6e69 MOVWF 0x69,0x0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eba 6a6e CLRF 0x6e,0x0 UADDR = 0x00; // Reset to default address C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ebc 0e0f MOVLW 0xf mDisableEP1to15(); // Reset all non-EP0 UEPn registers C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ebe 6ee6 MOVWF 0xe6,0x0 003ec0 0e71 MOVLW 0x71 003ec2 6ee6 MOVWF 0xe6,0x0 003ec4 0e0f MOVLW 0xf 003ec6 6ee6 MOVWF 0xe6,0x0 003ec8 d814 RCALL 0x3ef2 003eca 52e5 MOVF 0xe5,0x1,0x0 003ecc 52e5 MOVF 0xe5,0x1,0x0 003ece 52e5 MOVF 0xe5,0x1,0x0 003ed0 0e16 MOVLW 0x16 UEP0 = EP_CTRL|HSHK_EN; // Init EP0 as a Ctrl EP, see usbdrv.h C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ed2 6e70 MOVWF 0x70,0x0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ed4 a668 BTFSS 0x68,0x3,0x0 while(UIRbits.TRNIF == 1) // Flush any pending transactions C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ed6 d002 BRA 0x3edc 003eda d7fc BRA 0x3ed4 003ed8 9668 BCF 0x68,0x3,0x0 UIRbits.TRNIF = 0; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003edc 986d BCF 0x6d,0x4,0x0 UCONbits.PKTDIS = 0; // Make sure packet processing is enabled C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ede ec2e CALL 0x3a5c,0x0 USBPrepareForNextSetupTrf(); // Declared in usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ee0 f01d C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ee2 0101 MOVLB 0x1 usb_stat.RemoteWakeup = 0; // Default status flag to disable C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ee4 91d3 BCF 0xd3,0x0,0x1 003ee6 0101 MOVLB 0x1 usb_active_cfg = 0; // Clear active configuration C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ee8 6bd4 CLRF 0xd4,0x1 003eea 0101 MOVLB 0x1 usb_device_state = DEFAULT_STATE; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003eec 0e03 MOVLW 0x3 003eee 6fd2 MOVWF 0xd2,0x1 003ef0 0012 RETURN 0x0 }//end USBProtocolResetHandler C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /* Auxiliary Function */ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ef2 cfd9 MOVFF 0xfd9,0xfe6 void ClearArray(byte* startAdr,byte count) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003ef4 ffe6 003ef6 cfe1 MOVFF 0xfe1,0xfd9 003ef8 ffd9 { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003efa 0efd MOVLW 0xfd *startAdr; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003efc cfdb MOVFF 0xfdb,0xfe9 003efe ffe9 003f00 0efe MOVLW 0xfe 003f02 cfdb MOVFF 0xfdb,0xfea 003f04 ffea 003f06 0efc MOVLW 0xfc while(count) C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f08 50db MOVF 0xdb,0x0,0x0 003f0a e004 BZ 0x3f14 003f12 d7f9 BRA 0x3f06 { C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c _asm C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f0c 6aee CLRF 0xee,0x0 clrf POSTINC0,0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c _endasm C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f0e 0efc MOVLW 0xfc count--; C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f10 06db DECF 0xdb,0x1,0x0 }//end while C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f14 52e5 MOVF 0xe5,0x1,0x0 }//end ClearArray C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c 003f16 cfe7 MOVFF 0xfe7,0xfd9 003f18 ffd9 003f1a 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /** EOF usbdrv.c *************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbdrv\usbdrv.c /********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c ********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * FileName: usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Software License Agreement C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * license. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Author Date Comment C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c ********************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #include C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #include "io_cfg.h" // Required for self_power status C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdGetDscHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdSetCfgHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdGetStatusHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdFeatureReqHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #pragma code C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Function: void USBCheckStdRequest(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Overview: This routine checks the setup data packet to see if it C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * knows how to handle it C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBCheckStdRequest(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003a7c 0104 MOVLB 0x4 if(SetupPkt.RequestType != STANDARD) return; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003a7e 5120 MOVF 0x20,0x0,0x1 003a80 0b60 ANDLW 0x60 003a82 42e8 RRNCF 0xe8,0x1,0x0 003a84 42e8 RRNCF 0xe8,0x1,0x0 003a86 42e8 RRNCF 0xe8,0x1,0x0 003a88 42e8 RRNCF 0xe8,0x1,0x0 003a8a 42e8 RRNCF 0xe8,0x1,0x0 003a8c 0900 IORLW 0x0 003a8e e001 BZ 0x3a92 003a90 d058 BRA 0x3b42 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003a92 0104 MOVLB 0x4 switch(SetupPkt.bRequest) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003a94 5121 MOVF 0x21,0x0,0x1 003a96 0a07 XORLW 0x7 003a98 e053 BZ 0x3b40 003a9a 0a0b XORLW 0xb 003a9c e051 BZ 0x3b40 003a9e 0a07 XORLW 0x7 003aa0 e042 BZ 0x3b26 003aa2 0a01 XORLW 0x1 003aa4 e02c BZ 0x3afe 003aa6 0a0b XORLW 0xb 003aa8 e028 BZ 0x3afa 003aaa 0a02 XORLW 0x2 003aac e026 BZ 0x3afa 003aae 0a03 XORLW 0x3 003ab0 e022 BZ 0x3af6 003ab2 0a08 XORLW 0x8 003ab4 e012 BZ 0x3ada 003ab6 0a01 XORLW 0x1 003ab8 e00e BZ 0x3ad6 003aba 0a0f XORLW 0xf 003abc e00a BZ 0x3ad2 003abe 0a03 XORLW 0x3 003ac0 e001 BZ 0x3ac4 003ac2 d03e BRA 0x3b40 { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SET_ADR: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ac4 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ac6 0e01 MOVLW 0x1 003ac8 6fcb MOVWF 0xcb,0x1 003aca 0101 MOVLB 0x1 usb_device_state = ADR_PENDING_STATE; // Update state only C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003acc 0e04 MOVLW 0x4 003ace 6fd2 MOVWF 0xd2,0x1 /* See USBCtrlTrfInHandler() in usbctrltrf.c for the next step */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ad0 d038 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case GET_DSC: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ad2 d838 RCALL 0x3b44 USBStdGetDscHandler(); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ad4 d036 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SET_CFG: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ad6 d893 RCALL 0x3bfe USBStdSetCfgHandler(); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ad8 d034 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case GET_CFG: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ada 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003adc 0e01 MOVLW 0x1 003ade 6fcb MOVWF 0xcb,0x1 003ae0 0101 MOVLB 0x1 pSrc.bRam = (byte*)&usb_active_cfg; // Set Source C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ae2 0ed4 MOVLW 0xd4 003ae4 6fcc MOVWF 0xcc,0x1 003ae6 0e01 MOVLW 0x1 003ae8 6fcd MOVWF 0xcd,0x1 003aea 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _RAM; // Set memory type C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003aec 93d3 BCF 0xd3,0x1,0x1 003aee 0101 MOVLB 0x1 LSB(wCount) = 1; // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003af0 0e01 MOVLW 0x1 003af2 6fd0 MOVWF 0xd0,0x1 003af4 d026 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case GET_STATUS: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003af6 d8ab RCALL 0x3c4e USBStdGetStatusHandler(); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003af8 d024 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case CLR_FEATURE: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SET_FEATURE: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003afa d8f9 RCALL 0x3cee USBStdFeatureReqHandler(); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003afc d022 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case GET_INTF: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003afe 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b00 0e01 MOVLW 0x1 003b02 6fcb MOVWF 0xcb,0x1 003b04 0104 MOVLB 0x4 pSrc.bRam = (byte*)&usb_alt_intf+SetupPkt.bIntfID; // Set source C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b06 5124 MOVF 0x24,0x0,0x1 003b08 0101 MOVLB 0x1 003b0a 6fcc MOVWF 0xcc,0x1 003b0c 6bcd CLRF 0xcd,0x1 003b0e 0ed5 MOVLW 0xd5 003b10 0101 MOVLB 0x1 003b12 27cc ADDWF 0xcc,0x1,0x1 003b14 0e01 MOVLW 0x1 003b16 0101 MOVLB 0x1 003b18 23cd ADDWFC 0xcd,0x1,0x1 003b1a 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _RAM; // Set memory type C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b1c 93d3 BCF 0xd3,0x1,0x1 003b1e 0101 MOVLB 0x1 LSB(wCount) = 1; // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b20 0e01 MOVLW 0x1 003b22 6fd0 MOVWF 0xd0,0x1 003b24 d00e BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SET_INTF: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b26 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b28 0e01 MOVLW 0x1 003b2a 6fcb MOVWF 0xcb,0x1 003b2c 0104 MOVLB 0x4 usb_alt_intf[SetupPkt.bIntfID] = SetupPkt.bAltID; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b2e 5124 MOVF 0x24,0x0,0x1 003b30 6aea CLRF 0xea,0x0 003b32 0fd5 ADDLW 0xd5 003b34 6ee9 MOVWF 0xe9,0x0 003b36 0e01 MOVLW 0x1 003b38 22ea ADDWFC 0xea,0x1,0x0 003b3a c422 MOVFF 0x422,0xfef 003b3c ffef 003b3e d001 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SET_DSC: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case SYNCH_FRAME: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c default: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b40 d000 BRA 0x3b42 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c }//end switch C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b42 0012 RETURN 0x0 }//end USBCheckStdRequest C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Function: void USBStdGetDscHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Overview: This routine handles the standard GET_DESCRIPTOR request. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * It utilizes tables dynamically looks up descriptor size. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * This routine should never have to be modified if the tables C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * in usbdsc.c are declared correctly. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdGetDscHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b44 0e80 MOVLW 0x80 if(SetupPkt.bmRequestType == 0x80) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b46 0104 MOVLB 0x4 003b48 5d20 SUBWF 0x20,0x0,0x1 003b4a e158 BNZ 0x3bfc { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b4c 0104 MOVLB 0x4 switch(SetupPkt.bDscType) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b4e 5123 MOVF 0x23,0x0,0x1 003b50 0a03 XORLW 0x3 003b52 e034 BZ 0x3bbc 003b54 0a01 XORLW 0x1 003b56 e010 BZ 0x3b78 003b58 0a03 XORLW 0x3 003b5a e001 BZ 0x3b5e 003b5c d04d BRA 0x3bf8 { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case DSC_DEV: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b5e 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b60 0e01 MOVLW 0x1 003b62 6fcb MOVWF 0xcb,0x1 003b64 0101 MOVLB 0x1 pSrc.bRom = (rom byte*)&device_dsc; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b66 0e52 MOVLW 0x52 003b68 6fcc MOVWF 0xcc,0x1 003b6a 0e41 MOVLW 0x41 003b6c 6fcd MOVWF 0xcd,0x1 003b6e 0e12 MOVLW 0x12 wCount._word = sizeof(device_dsc); // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b70 0101 MOVLB 0x1 003b72 6fd0 MOVWF 0xd0,0x1 003b74 6bd1 CLRF 0xd1,0x1 003b76 d040 BRA 0x3bf8 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case DSC_CFG: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b78 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b7a 0e01 MOVLW 0x1 003b7c 6fcb MOVWF 0xcb,0x1 003b7e 0104 MOVLB 0x4 pSrc.bRom = *(USB_CD_Ptr+SetupPkt.bDscIndex); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003b80 5122 MOVF 0x22,0x0,0x1 003b82 6ef6 MOVWF 0xf6,0x0 003b84 6af7 CLRF 0xf7,0x0 003b86 90d8 BCF 0xd8,0x0,0x0 003b88 36f6 RLCF 0xf6,0x1,0x0 003b8a 36f7 RLCF 0xf7,0x1,0x0 003b8c 0e13 MOVLW 0x13 003b8e 26f6 ADDWF 0xf6,0x1,0x0 003b90 0e42 MOVLW 0x42 003b92 22f7 ADDWFC 0xf7,0x1,0x0 003b94 0009 TBLRDPOSTINC 003b96 cff5 MOVFF 0xff5,0x1cc 003b98 f1cc 003b9a 000a TBLRDPOSTDEC 003b9c cff5 MOVFF 0xff5,0x1cd 003b9e f1cd 003ba0 0e02 MOVLW 0x2 wCount._word = *(pSrc.wRom+1); // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ba2 0101 MOVLB 0x1 003ba4 6af7 CLRF 0xf7,0x0 003ba6 25cc ADDWF 0xcc,0x0,0x1 003ba8 6ef6 MOVWF 0xf6,0x0 003baa 51cd MOVF 0xcd,0x0,0x1 003bac 22f7 ADDWFC 0xf7,0x1,0x0 003bae 0009 TBLRDPOSTINC 003bb0 cff5 MOVFF 0xff5,0x1d0 003bb2 f1d0 003bb4 000a TBLRDPOSTDEC 003bb6 cff5 MOVFF 0xff5,0x1d1 003bb8 f1d1 003bba d01e BRA 0x3bf8 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case DSC_STR: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bbc 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bbe 0e01 MOVLW 0x1 003bc0 6fcb MOVWF 0xcb,0x1 003bc2 0104 MOVLB 0x4 pSrc.bRom = *(USB_SD_Ptr+SetupPkt.bDscIndex); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bc4 5122 MOVF 0x22,0x0,0x1 003bc6 6ef6 MOVWF 0xf6,0x0 003bc8 6af7 CLRF 0xf7,0x0 003bca 90d8 BCF 0xd8,0x0,0x0 003bcc 36f6 RLCF 0xf6,0x1,0x0 003bce 36f7 RLCF 0xf7,0x1,0x0 003bd0 0e17 MOVLW 0x17 003bd2 26f6 ADDWF 0xf6,0x1,0x0 003bd4 0e42 MOVLW 0x42 003bd6 22f7 ADDWFC 0xf7,0x1,0x0 003bd8 0009 TBLRDPOSTINC 003bda cff5 MOVFF 0xff5,0x1cc 003bdc f1cc 003bde 000a TBLRDPOSTDEC 003be0 cff5 MOVFF 0xff5,0x1cd 003be2 f1cd 003be4 c1cc MOVFF 0x1cc,0xff6 wCount._word = *pSrc.bRom; // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003be6 fff6 003be8 c1cd MOVFF 0x1cd,0xff7 003bea fff7 003bec 0008 TBLRD 003bee 50f5 MOVF 0xf5,0x0,0x0 003bf0 0101 MOVLB 0x1 003bf2 6fd0 MOVWF 0xd0,0x1 003bf4 6bd1 CLRF 0xd1,0x1 003bf6 d000 BRA 0x3bf8 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c }//end switch C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bf8 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _ROM; // Set memory type C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bfa 83d3 BSF 0xd3,0x1,0x1 }//end if C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bfc 0012 RETURN 0x0 }//end USBStdGetDscHandler C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Function: void USBStdSetCfgHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Overview: This routine first disables all endpoints by clearing C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * UEP registers. It then configures (initializes) endpoints C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * specified in the modifiable section. C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdSetCfgHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003bfe 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c00 0e01 MOVLW 0x1 003c02 6fcb MOVWF 0xcb,0x1 003c04 0e0f MOVLW 0xf mDisableEP1to15(); // See usbdrv.h C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c06 6ee6 MOVWF 0xe6,0x0 003c08 0e71 MOVLW 0x71 003c0a 6ee6 MOVWF 0xe6,0x0 003c0c 0e0f MOVLW 0xf 003c0e 6ee6 MOVWF 0xe6,0x0 003c10 ec79 CALL 0x3ef2,0x0 003c12 f01f 003c14 52e5 MOVF 0xe5,0x1,0x0 003c16 52e5 MOVF 0xe5,0x1,0x0 003c18 52e5 MOVF 0xe5,0x1,0x0 003c1a 0e01 MOVLW 0x1 ClearArray((byte*)&usb_alt_intf,MAX_NUM_INT); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c1c 6ee6 MOVWF 0xe6,0x0 003c1e 0ed5 MOVLW 0xd5 003c20 6ee6 MOVWF 0xe6,0x0 003c22 0e01 MOVLW 0x1 003c24 6ee6 MOVWF 0xe6,0x0 003c26 ec79 CALL 0x3ef2,0x0 003c28 f01f 003c2a 52e5 MOVF 0xe5,0x1,0x0 003c2c 52e5 MOVF 0xe5,0x1,0x0 003c2e 52e5 MOVF 0xe5,0x1,0x0 003c30 c422 MOVFF 0x422,0x1d4 usb_active_cfg = SetupPkt.bCfgValue; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c32 f1d4 003c34 0104 MOVLB 0x4 if(SetupPkt.bCfgValue == 0) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c36 5122 MOVF 0x22,0x0,0x1 003c38 e104 BNZ 0x3c42 003c3a 0101 MOVLB 0x1 usb_device_state = ADDRESS_STATE; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c3c 0e05 MOVLW 0x5 003c3e 6fd2 MOVWF 0xd2,0x1 003c40 d005 BRA 0x3c4c else C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c42 0101 MOVLB 0x1 usb_device_state = CONFIGURED_STATE; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c44 0e06 MOVLW 0x6 003c46 6fd2 MOVWF 0xd2,0x1 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /* Modifiable Section */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c #if defined(USB_USE_CDC) // See autofiles\usbcfg.h C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c48 ec1c CALL 0x3438,0x0 CDCInitEP(); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c4a f01a #endif C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /* End modifiable section */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c }//end if(SetupPkt.bcfgValue == 0) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c4c 0012 RETURN 0x0 }//end USBStdSetCfgHandler C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Function: void USBStdGetStatusHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Overview: This routine handles the standard GET_STATUS request C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdGetStatusHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c4e 0104 MOVLB 0x4 CtrlTrfData._byte0 = 0; // Initialize content C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c50 6b28 CLRF 0x28,0x1 003c52 0104 MOVLB 0x4 CtrlTrfData._byte1 = 0; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c54 6b29 CLRF 0x29,0x1 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c56 0104 MOVLB 0x4 switch(SetupPkt.Recipient) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c58 5120 MOVF 0x20,0x0,0x1 003c5a 0b1f ANDLW 0x1f 003c5c 0a02 XORLW 0x2 003c5e e014 BZ 0x3c88 003c60 0a03 XORLW 0x3 003c62 e00e BZ 0x3c80 003c64 0a01 XORLW 0x1 003c66 e001 BZ 0x3c6a 003c68 d034 BRA 0x3cd2 { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case RCPT_DEV: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c6a 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c6c 0e01 MOVLW 0x1 003c6e 6fcb MOVWF 0xcb,0x1 /* C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * _byte0: bit0: Self-Powered Status [0] Bus-Powered [1] Self-Powered C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * bit1: RemoteWakeup [0] Disabled [1] Enabled C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c if(self_power == 1) // self_power defined in io_cfg.h C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c70 0104 MOVLB 0x4 CtrlTrfData._byte0|=0b000000001; // Set bit0 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c72 8128 BSF 0x28,0x0,0x1 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c74 0101 MOVLB 0x1 if(usb_stat.RemoteWakeup == 1) // usb_stat defined in usbmmap.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c76 a1d3 BTFSS 0xd3,0x0,0x1 003c78 d002 BRA 0x3c7e 003c7a 0104 MOVLB 0x4 CtrlTrfData._byte0|=0b00000010; // Set bit1 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c7c 8328 BSF 0x28,0x1,0x1 003c7e d029 BRA 0x3cd2 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case RCPT_INTF: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c80 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; // No data to update C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c82 0e01 MOVLW 0x1 003c84 6fcb MOVWF 0xcb,0x1 003c86 d025 BRA 0x3cd2 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c case RCPT_EP: C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c88 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c8a 0e01 MOVLW 0x1 003c8c 6fcb MOVWF 0xcb,0x1 /* C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * _byte0: bit0: Halt Status [0] Not Halted [1] Halted C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c8e 0104 MOVLB 0x4 pDst.bRam = (byte*)&ep0Bo+(SetupPkt.EPNum*8)+(SetupPkt.EPDir*4); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003c90 5124 MOVF 0x24,0x0,0x1 003c92 0b0f ANDLW 0xf 003c94 0d08 MULLW 0x8 003c96 50f3 MOVF 0xf3,0x0,0x0 003c98 6a2b CLRF 0x2b,0x0 003c9a 0f00 ADDLW 0x0 003c9c 6e2a MOVWF 0x2a,0x0 003c9e 0e04 MOVLW 0x4 003ca0 222b ADDWFC 0x2b,0x1,0x0 003ca2 0104 MOVLB 0x4 003ca4 5124 MOVF 0x24,0x0,0x1 003ca6 0b80 ANDLW 0x80 003ca8 e001 BZ 0x3cac 003caa 0e01 MOVLW 0x1 003cac 0d04 MULLW 0x4 003cae 50f3 MOVF 0xf3,0x0,0x0 003cb0 0101 MOVLB 0x1 003cb2 242a ADDWF 0x2a,0x0,0x0 003cb4 6fce MOVWF 0xce,0x1 003cb6 0e00 MOVLW 0x0 003cb8 202b ADDWFC 0x2b,0x0,0x0 003cba 6fcf MOVWF 0xcf,0x1 003cbc c1ce MOVFF 0x1ce,0xfe9 if(*pDst.bRam & _BSTALL) // Use _BSTALL as a bit mask C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cbe ffe9 003cc0 c1cf MOVFF 0x1cf,0xfea 003cc2 ffea 003cc4 50ef MOVF 0xef,0x0,0x0 003cc6 0b04 ANDLW 0x4 003cc8 e003 BZ 0x3cd0 003cca 0104 MOVLB 0x4 CtrlTrfData._byte0=0x01;// Set bit0 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ccc 0e01 MOVLW 0x1 003cce 6f28 MOVWF 0x28,0x1 003cd0 d000 BRA 0x3cd2 break; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c }//end switch C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cd2 0101 MOVLB 0x1 if(ctrl_trf_session_owner == MUID_USB9) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cd4 05cb DECF 0xcb,0x0,0x1 003cd6 e10a BNZ 0x3cec { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cd8 0101 MOVLB 0x1 pSrc.bRam = (byte*)&CtrlTrfData; // Set Source C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cda 0e28 MOVLW 0x28 003cdc 6fcc MOVWF 0xcc,0x1 003cde 0e04 MOVLW 0x4 003ce0 6fcd MOVWF 0xcd,0x1 003ce2 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _RAM; // Set memory type C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ce4 93d3 BCF 0xd3,0x1,0x1 003ce6 0101 MOVLB 0x1 LSB(wCount) = 2; // Set data count C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003ce8 0e02 MOVLW 0x2 003cea 6fd0 MOVWF 0xd0,0x1 }//end if(...) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cec 0012 RETURN 0x0 }//end USBStdGetStatusHandler C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Function: void USBStdFeatureReqHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Overview: This routine handles the standard SET & CLEAR FEATURES C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * requests C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c void USBStdFeatureReqHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cee 0104 MOVLB 0x4 if((SetupPkt.bFeature == DEVICE_REMOTE_WAKEUP)&& C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cf0 0522 DECF 0x22,0x0,0x1 003cf2 e111 BNZ 0x3d16 (SetupPkt.Recipient == RCPT_DEV)) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cf4 0104 MOVLB 0x4 003cf6 5120 MOVF 0x20,0x0,0x1 003cf8 0b1f ANDLW 0x1f 003cfa 0900 IORLW 0x0 003cfc e10c BNZ 0x3d16 { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003cfe 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d00 0e01 MOVLW 0x1 003d02 6fcb MOVWF 0xcb,0x1 003d04 0e03 MOVLW 0x3 if(SetupPkt.bRequest == SET_FEATURE) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d06 0104 MOVLB 0x4 003d08 5d21 SUBWF 0x21,0x0,0x1 003d0a e103 BNZ 0x3d12 003d0c 0101 MOVLB 0x1 usb_stat.RemoteWakeup = 1; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d0e 81d3 BSF 0xd3,0x0,0x1 003d10 d002 BRA 0x3d16 else C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d12 0101 MOVLB 0x1 usb_stat.RemoteWakeup = 0; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d14 91d3 BCF 0xd3,0x0,0x1 }//end if C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d16 0104 MOVLB 0x4 if((SetupPkt.bFeature == ENDPOINT_HALT)&& C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d18 5122 MOVF 0x22,0x0,0x1 003d1a e13e BNZ 0x3d98 (SetupPkt.Recipient == RCPT_EP)&& C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d1c 0104 MOVLB 0x4 003d1e 5120 MOVF 0x20,0x0,0x1 003d20 0b1f ANDLW 0x1f 003d22 0802 SUBLW 0x2 003d24 e139 BNZ 0x3d98 003d26 0104 MOVLB 0x4 (SetupPkt.EPNum != 0)) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d28 5124 MOVF 0x24,0x0,0x1 003d2a 0b0f ANDLW 0xf 003d2c 0900 IORLW 0x0 003d2e e034 BZ 0x3d98 { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d30 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_USB9; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d32 0e01 MOVLW 0x1 003d34 6fcb MOVWF 0xcb,0x1 /* Must do address calculation here */ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d36 0104 MOVLB 0x4 pDst.bRam = (byte*)&ep0Bo+(SetupPkt.EPNum*8)+(SetupPkt.EPDir*4); C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d38 5124 MOVF 0x24,0x0,0x1 003d3a 0b0f ANDLW 0xf 003d3c 0d08 MULLW 0x8 003d3e 50f3 MOVF 0xf3,0x0,0x0 003d40 6a2b CLRF 0x2b,0x0 003d42 0f00 ADDLW 0x0 003d44 6e2a MOVWF 0x2a,0x0 003d46 0e04 MOVLW 0x4 003d48 222b ADDWFC 0x2b,0x1,0x0 003d4a 0104 MOVLB 0x4 003d4c 5124 MOVF 0x24,0x0,0x1 003d4e 0b80 ANDLW 0x80 003d50 e001 BZ 0x3d54 003d52 0e01 MOVLW 0x1 003d54 0d04 MULLW 0x4 003d56 50f3 MOVF 0xf3,0x0,0x0 003d58 0101 MOVLB 0x1 003d5a 242a ADDWF 0x2a,0x0,0x0 003d5c 6fce MOVWF 0xce,0x1 003d5e 0e00 MOVLW 0x0 003d60 202b ADDWFC 0x2b,0x0,0x0 003d62 6fcf MOVWF 0xcf,0x1 C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d64 0e03 MOVLW 0x3 if(SetupPkt.bRequest == SET_FEATURE) C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d66 0104 MOVLB 0x4 003d68 5d21 SUBWF 0x21,0x0,0x1 003d6a e107 BNZ 0x3d7a 003d6c 0e84 MOVLW 0x84 *pDst.bRam = _USIE|_BSTALL; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d6e c1ce MOVFF 0x1ce,0xfe9 003d70 ffe9 003d72 c1cf MOVFF 0x1cf,0xfea 003d74 ffea 003d76 6eef MOVWF 0xef,0x0 003d78 d00f BRA 0x3d98 else C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c { C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d7a 0104 MOVLB 0x4 if(SetupPkt.EPDir == 1) // IN C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d7c af24 BTFSS 0x24,0x7,0x1 003d7e d006 BRA 0x3d8c 003d80 c1ce MOVFF 0x1ce,0xfe9 *pDst.bRam = _UCPU; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d82 ffe9 003d84 c1cf MOVFF 0x1cf,0xfea 003d86 ffea 003d88 6aef CLRF 0xef,0x0 003d8a d006 BRA 0x3d98 else C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d8c 0e88 MOVLW 0x88 *pDst.bRam = _USIE|_DAT0|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d8e c1ce MOVFF 0x1ce,0xfe9 003d90 ffe9 003d92 c1cf MOVFF 0x1cf,0xfea 003d94 ffea 003d96 6eef MOVWF 0xef,0x0 }//end if C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c }//end if C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c 003d98 0012 RETURN 0x0 }//end USBStdFeatureReqHandler C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /** EOF usb9.c ***************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usb9\usb9.c /********************************************************************* C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c ********************************************************************* C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * FileName: usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Software License Agreement C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * license. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c ********************************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /********************************************************************* C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * -usbdsc.c- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * This file contains the USB descriptor information. It is used C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * in conjunction with the usbdsc.h file. When a descriptor is added C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * or removed from the main configuration descriptor, i.e. CFG01, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * the user must also change the descriptor structure defined in C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * the usbdsc.h file. The structure is used to calculate the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * descriptor size, i.e. sizeof(CFG01). C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * A typical configuration descriptor consists of: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * At least one configuration descriptor (USB_CFG_DSC) C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * One or more interface descriptors (USB_INTF_DSC) C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * One or more endpoint descriptors (USB_EP_DSC) C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Naming Convention: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * To resolve ambiguity, the naming convention are as followed: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * - USB_CFG_DSC type should be named cdxx, where xx is the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * configuration number. This number should match the actual C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * index value of this configuration. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * - USB_INTF_DSC type should be named ia, where yy is the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * interface number and zz is the alternate interface number. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * - USB_EP_DSC type should be named ep<##>_ia, where C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ## is the endpoint number and d is the direction of transfer. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The interface name should also be listed as a suffix to identify C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * which interface does the endpoint belong to. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Example: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * If a device has one configuration, two interfaces; interface 0 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * has two endpoints (in and out), and interface 1 has one endpoint(in). C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Then the CFG01 structure in the usbdsc.h should be: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * #define CFG01 rom struct \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * { USB_CFG_DSC cd01; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_INTF_DSC i00a00; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_EP_DSC ep01o_i00a00; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_EP_DSC ep01i_i00a00; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_INTF_DSC i01a00; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_EP_DSC ep02i_i01a00; \ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * } cfg01 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Note the hierarchy of the descriptors above, it follows the USB C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * specification requirement. All endpoints belonging to an interface C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * should be listed immediately after that interface. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ------------------------------------------------------------------- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Filling in the descriptor values in the usbdsc.c file: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ------------------------------------------------------------------- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Most items should be self-explanatory, however, a few will be C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * explained for clarification. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * [Configuration Descriptor(USB_CFG_DSC)] C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The configuration attribute must always have the _DEFAULT C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * definition at the minimum. Additional options can be ORed C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * to the _DEFAULT attribute. Available options are _SELF and _RWU. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * These definitions are defined in the usbdefs_std_dsc.h file. The C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * _SELF tells the USB host that this device is self-powered. The C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * _RWU tells the USB host that this device supports Remote Wakeup. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * [Endpoint Descriptor(USB_EP_DSC)] C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Assume the following example: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * sizeof(USB_EP_DSC),DSC_EP,_EP01_OUT,_BULK,64,0x00 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The first two parameters are self-explanatory. They specify the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * length of this endpoint descriptor (7) and the descriptor type. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The next parameter identifies the endpoint, the definitions are C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * defined in usbdefs_std_dsc.h and has the following naming C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * convention: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * _EP<##>_ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * where ## is the endpoint number and dir is the direction of C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * transfer. The dir has the value of either 'OUT' or 'IN'. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The next parameter identifies the type of the endpoint. Available C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * options are _BULK, _INT, _ISO, and _CTRL. The _CTRL is not C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * typically used because the default control transfer endpoint is C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * not defined in the USB descriptors. When _ISO option is used, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * addition options can be ORed to _ISO. Example: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * _ISO|_AD|_FE C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * This describes the endpoint as an isochronous pipe with adaptive C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * and feedback attributes. See usbdefs_std_dsc.h and the USB C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * specification for details. The next parameter defines the size of C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * the endpoint. The last parameter in the polling interval. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ------------------------------------------------------------------- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Adding a USB String C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ------------------------------------------------------------------- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * A string descriptor array should have the following format: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * rom struct{byte bLength;byte bDscType;word string[size];}sdxxx={ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * sizeof(sdxxx),DSC_STR,}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The above structure provides a means for the C compiler to C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * calculate the length of string descriptor sdxxx, where xxx is the C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * index number. The first two bytes of the descriptor are descriptor C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * length and type. The rest are string texts which must be C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * in the unicode format. The unicode format is achieved by declaring C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * each character as a word type. The whole text string is declared C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * as a word array with the number of characters equals to . C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * has to be manually counted and entered into the array C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * declaration. Let's study this through an example: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * if the string is "USB" , then the string descriptor should be: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * (Using index 02) C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * rom struct{byte bLength;byte bDscType;word string[3];}sd002={ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * sizeof(sd002),DSC_STR,'U','S','B'}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * A USB project may have multiple strings and the firmware supports C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * the management of multiple strings through a look-up table. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The look-up table is defined as: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * rom const unsigned char *rom USB_SD_Ptr[]={&sd000,&sd001,&sd002}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The above declaration has 3 strings, sd000, sd001, and sd002. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Strings can be removed or added. sd000 is a specialized string C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * descriptor. It defines the language code, usually this is C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * US English (0x0409). The index of the string must match the index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * position of the USB_SD_Ptr array, &sd000 must be in position C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * USB_SD_Ptr[0], &sd001 must be in position USB_SD_Ptr[1] and so on. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The look-up table USB_SD_Ptr is used by the get string handler C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * function in usb9.c. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * ------------------------------------------------------------------- C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The look-up table scheme also applies to the configuration C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * descriptor. A USB device may have multiple configuration C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * descriptors, i.e. CFG01, CFG02, etc. To add a configuration C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * descriptor, user must implement a structure similar to CFG01. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * The next step is to add the configuration descriptor name, i.e. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * cfg01, cfg02,.., to the look-up table USB_CD_Ptr. USB_CD_Ptr[0] C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * is a dummy place holder since configuration 0 is the un-configured C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * state according to the definition in the USB specification. C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c ********************************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /********************************************************************* C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Descriptor specific type definitions are defined in: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * system\usb\usbdefs\usbdefs_std_dsc.h C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * Configuration information is defined in: C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c * autofiles\usbcfg.h C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c ********************************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /** I N C L U D E S *************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /** C O N S T A N T S ************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c #pragma romdata C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Device Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom USB_DEV_DSC device_dsc= C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c { C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_DEV_DSC), // Size of this descriptor in bytes C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c DSC_DEV, // DEVICE descriptor type C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x0200, // USB Spec Release Number in BCD format C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c CDC_DEVICE, // Class Code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x00, // Subclass code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x00, // Protocol code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c EP0_BUFF_SIZE, // Max packet size for EP0, see usbcfg.h C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x04D8, // Vendor ID C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x000A, // Product ID: CDC RS-232 Emulation Demo C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x0000, // Device release number in BCD format C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x01, // Manufacturer string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x02, // Product string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x00, // Device serial number string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0x01 // Number of possible configurations C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c }; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Configuration 1 Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c CFG01= C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c { C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Configuration Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_CFG_DSC), // Size of this descriptor in bytes C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c DSC_CFG, // CONFIGURATION descriptor type C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(cfg01), // Total length of data for this cfg C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 2, // Number of interfaces in this cfg C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 1, // Index value of this configuration C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Configuration string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c _DEFAULT, // Attributes, see usbdefs_std_dsc.h C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 50, // Max power consumption (2X mA) C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Interface Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_INTF_DSC), // Size of this descriptor in bytes C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c DSC_INTF, // INTERFACE descriptor type C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Interface Number C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Alternate Setting Number C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 1, // Number of endpoints in this intf C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c COMM_INTF, // Class code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c ABSTRACT_CONTROL_MODEL, // Subclass code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c V25TER, // Protocol code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Interface string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* CDC Class-Specific Descriptors */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_CDC_HEADER_FN_DSC),CS_INTERFACE,DSC_FN_HEADER,0x0110, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_CDC_ACM_FN_DSC),CS_INTERFACE,DSC_FN_ACM,0x02, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_CDC_UNION_FN_DSC),CS_INTERFACE,DSC_FN_UNION,CDC_COMM_INTF_ID,CDC_DATA_INTF_ID, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_CDC_CALL_MGT_FN_DSC),CS_INTERFACE,DSC_FN_CALL_MGT,0x00,CDC_DATA_INTF_ID, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Endpoint Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_EP_DSC),DSC_EP,_EP02_IN,_INT,CDC_INT_EP_SIZE,0x02, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Interface Descriptor */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_INTF_DSC), // Size of this descriptor in bytes C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c DSC_INTF, // INTERFACE descriptor type C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 1, // Interface Number C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Alternate Setting Number C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 2, // Number of endpoints in this intf C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c DATA_INTF, // Class code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Subclass code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c NO_PROTOCOL, // Protocol code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 0, // Interface string index C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /* Endpoint Descriptors */ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_EP_DSC),DSC_EP,_EP03_OUT,_BULK,CDC_BULK_OUT_EP_SIZE,0x00, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(USB_EP_DSC),DSC_EP,_EP03_IN,_BULK,CDC_BULK_IN_EP_SIZE,0x00 C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c }; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom struct{byte bLength;byte bDscType;word string[1];}sd000={ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(sd000),DSC_STR,0x0409}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom struct{byte bLength;byte bDscType;word string[25];}sd001={ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(sd001),DSC_STR, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 'M','i','c','r','o','c','h','i','p',' ', C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 'T','e','c','h','n','o','l','o','g','y',' ','I','n','c','.'}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom struct{byte bLength;byte bDscType;word string[25];}sd002={ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c sizeof(sd002),DSC_STR, C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 'C','D','C',' ','R','S','-','2','3','2',' ', C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c 'E','m','u','l','a','t','i','o','n',' ','D','e','m','o'}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom const unsigned char *rom USB_CD_Ptr[]={&cfg01,&cfg01}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom const unsigned char *rom USB_SD_Ptr[]={&sd000,&sd001,&sd002}; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c rom pFunc ClassReqHandler[1]= C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c { C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c &USBCheckCDCRequest C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c }; C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c #pragma code C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /** EOF usbdsc.c ****************************************************/ C:\Projects\UBW\FW\D_143\autofiles\usbdsc.c /********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c ********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * FileName: usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Software License Agreement C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * license. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Author Date Comment C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c ********************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c #include C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c byte ctrl_trf_state; // Control Transfer State C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c byte ctrl_trf_session_owner; // Current transfer session owner C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c POINTER pSrc; // Data source pointer C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c POINTER pDst; // Data destination pointer C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c WORD wCount; // Data counter C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlTrfSetupHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlTrfOutHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlTrfInHandler(void); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c #pragma code C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlEPService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: USTAT is loaded with a valid endpoint address. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: USBCtrlEPService checks for three transaction types that C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * it knows how to service and services them: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 1. EP0 SETUP C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 2. EP0 OUT C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 3. EP0 IN C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * It ignores all other types (i.e. EP1, EP2, etc.) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlEPService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003742 506c MOVF 0x6c,0x0,0x0 if(USTAT == EP00_OUT) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003744 e002 BZ 0x374a 003746 0e00 MOVLW 0x0 003748 d001 BRA 0x374c 00374a 0e01 MOVLW 0x1 00374c 0900 IORLW 0x0 00374e e00b BZ 0x3766 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003750 0104 MOVLB 0x4 if(ep0Bo.Stat.PID == SETUP_TOKEN) // EP0 SETUP C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003752 5100 MOVF 0x0,0x0,0x1 003754 0b3c ANDLW 0x3c 003756 42e8 RRNCF 0xe8,0x1,0x0 003758 42e8 RRNCF 0xe8,0x1,0x0 00375a 080d SUBLW 0xd 00375c e102 BNZ 0x3762 00375e d80c RCALL 0x3778 USBCtrlTrfSetupHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003760 d001 BRA 0x3764 else // EP0 OUT C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003762 d842 RCALL 0x37e8 USBCtrlTrfOutHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003764 d008 BRA 0x3776 else if(USTAT == EP00_IN) // EP0 IN C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003766 506c MOVF 0x6c,0x0,0x0 003768 e002 BZ 0x376e 00376a 0e00 MOVLW 0x0 00376c d001 BRA 0x3770 00376e 0e01 MOVLW 0x1 003770 0904 IORLW 0x4 003772 e001 BZ 0x3776 003774 d84b RCALL 0x380c USBCtrlTrfInHandler(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003776 0012 RETURN 0x0 }//end USBCtrlEPService C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlTrfSetupHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: SetupPkt buffer is loaded with valid USB Setup Data C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: This routine is a task dispatcher and has 3 stages. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 1. It initializes the control transfer state machine. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 2. It calls on each of the module that may know how to C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * service the Setup Request from the host. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Module Example: USB9, HID, CDC, MSD, ... C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * As new classes are added, ClassReqHandler table in C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * usbdsc.c should be updated to call all available C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * class handlers. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 3. Once each of the modules has had a chance to check if C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * it is responsible for servicing the request, stage 3 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * then checks direction of the transfer to determine how C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * to prepare EP0 for the control transfer. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Refer to USBCtrlEPServiceComplete() for more details. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: Microchip USB Firmware has three different states for C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * the control transfer state machine: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 1. WAIT_SETUP C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 2. CTRL_TRF_TX C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 3. CTRL_TRF_RX C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Refer to firmware manual to find out how one state C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * is transitioned to another. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * A Control Transfer is composed of many USB transactions. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * When transferring data over multiple transactions, C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * it is important to keep track of data source, data C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * destination, and data count. These three parameters are C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * stored in pSrc,pDst, and wCount. A flag is used to C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * note if the data source is from ROM or RAM. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003778 cfd9 MOVFF 0xfd9,0xfe6 void USBCtrlTrfSetupHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00377a ffe6 00377c cfe1 MOVFF 0xfe1,0xfd9 00377e ffd9 003780 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c byte i; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* Stage 1 */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003782 0101 MOVLB 0x1 ctrl_trf_state = WAIT_SETUP; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003784 6bca CLRF 0xca,0x1 003786 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_NULL; // Set owner to NULL C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003788 6bcb CLRF 0xcb,0x1 00378a 0101 MOVLB 0x1 wCount._word = 0; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00378c 6bd0 CLRF 0xd0,0x1 00378e 6bd1 CLRF 0xd1,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* Stage 2 */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003790 ec3e CALL 0x3a7c,0x0 USBCheckStdRequest(); // See system\usb9\usb9.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003792 f01d C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003794 6adf CLRF 0xdf,0x0 for(i=0;i < (sizeof(ClassReqHandler)/sizeof(pFunc));i++) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003796 50df MOVF 0xdf,0x0,0x0 003798 6e2a MOVWF 0x2a,0x0 00379a 6a2b CLRF 0x2b,0x0 00379c 0e01 MOVLW 0x1 00379e 5c2a SUBWF 0x2a,0x0,0x0 0037a0 0e00 MOVLW 0x0 0037a2 582b SUBWFB 0x2b,0x0,0x0 0037a4 e21b BC 0x37dc 0037d8 2adf INCF 0xdf,0x1,0x0 0037da d7dd BRA 0x3796 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037a6 0101 MOVLB 0x1 if(ctrl_trf_session_owner != MUID_NULL)break; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037a8 51cb MOVF 0xcb,0x0,0x1 0037aa e001 BZ 0x37ae 0037ac d017 BRA 0x37dc 0037ae 6af7 CLRF 0xf7,0x0 ClassReqHandler[i](); // See autofiles\usbdsc.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037b0 34df RLCF 0xdf,0x0,0x0 0037b2 0bfe ANDLW 0xfe 0037b4 36f7 RLCF 0xf7,0x1,0x0 0037b6 6ef6 MOVWF 0xf6,0x0 0037b8 0e1d MOVLW 0x1d 0037ba 26f6 ADDWF 0xf6,0x1,0x0 0037bc 0e42 MOVLW 0x42 0037be 22f7 ADDWFC 0xf7,0x1,0x0 0037c0 0009 TBLRDPOSTINC 0037c2 cff5 MOVFF 0xff5,0x2a 0037c4 f02a 0037c6 0008 TBLRD 0037c8 cff5 MOVFF 0xff5,0x2b 0037ca f02b 0037cc d004 BRA 0x37d6 0037ce c02b MOVFF 0x2b,0xffa 0037d0 fffa 0037d2 502a MOVF 0x2a,0x0,0x0 0037d4 6ef9 MOVWF 0xf9,0x0 0037d6 dffb RCALL 0x37ce }//end while C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* Stage 3 */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037dc d8f0 RCALL 0x39be USBCtrlEPServiceComplete(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037de 52e5 MOVF 0xe5,0x1,0x0 }//end USBCtrlTrfSetupHandler C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037e0 52e5 MOVF 0xe5,0x1,0x0 0037e2 cfe7 MOVFF 0xfe7,0xfd9 0037e4 ffd9 0037e6 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlTrfOutHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: This routine handles an OUT transaction according to C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * which control transfer state is currently active. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: Note that if the the control transfer was from C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * host to device, the session owner should be notified C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * at the end of each OUT transaction to service the C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * received data. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlTrfOutHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037e8 0e02 MOVLW 0x2 if(ctrl_trf_state == CTRL_TRF_RX) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037ea 0101 MOVLB 0x1 0037ec 5dca SUBWF 0xca,0x0,0x1 0037ee e10c BNZ 0x3808 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037f0 d8a4 RCALL 0x393a USBCtrlTrfRxService(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Don't have to worry about overwriting _KEEP bit C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * because if _KEEP was set, TRNIF would not have been C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * generated in the first place. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037f2 0104 MOVLB 0x4 if(ep0Bo.Stat.DTS == 0) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037f4 bd00 BTFSC 0x0,0x6,0x1 0037f6 d004 BRA 0x3800 0037f8 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE|_DAT1|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0037fa 0ec8 MOVLW 0xc8 0037fc 6f00 MOVWF 0x0,0x1 0037fe d003 BRA 0x3806 else C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003800 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE|_DAT0|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003802 0e88 MOVLW 0x88 003804 6f00 MOVWF 0x0,0x1 } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003806 d001 BRA 0x380a else // CTRL_TRF_TX C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003808 d929 RCALL 0x3a5c USBPrepareForNextSetupTrf(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00380a 0012 RETURN 0x0 }//end USBCtrlTrfOutHandler C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlTrfInHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: This routine handles an IN transaction according to C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * which control transfer state is currently active. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: A Set Address Request must not change the acutal address C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * of the device until the completion of the control C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * transfer. The end of the control transfer for Set Address C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Request is an IN transaction. Therefore it is necessary C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * to service this unique situation when the condition is C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * right. Macro mUSBCheckAdrPendingState is defined in C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * usb9.h and its function is to specifically service this C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * event. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlTrfInHandler(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00380c 0e04 MOVLW 0x4 mUSBCheckAdrPendingState(); // Must check if in ADR_PENDING_STATE C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00380e 0101 MOVLB 0x1 003810 5dd2 SUBWF 0xd2,0x0,0x1 003812 e10c BNZ 0x382c 003814 c422 MOVFF 0x422,0xf6e 003816 ff6e 003818 506e MOVF 0x6e,0x0,0x0 00381a 0800 SUBLW 0x0 00381c e204 BC 0x3826 00381e 0101 MOVLB 0x1 003820 0e05 MOVLW 0x5 003822 6fd2 MOVWF 0xd2,0x1 003824 d003 BRA 0x382c 003826 0101 MOVLB 0x1 003828 0e03 MOVLW 0x3 00382a 6fd2 MOVWF 0xd2,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00382c 0101 MOVLB 0x1 if(ctrl_trf_state == CTRL_TRF_TX) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00382e 05ca DECF 0xca,0x0,0x1 003830 e10c BNZ 0x384a { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003832 d80d RCALL 0x384e USBCtrlTrfTxService(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003834 0104 MOVLB 0x4 if(ep0Bi.Stat.DTS == 0) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003836 bd04 BTFSC 0x4,0x6,0x1 003838 d004 BRA 0x3842 00383a 0104 MOVLB 0x4 ep0Bi.Stat._byte = _USIE|_DAT1|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00383c 0ec8 MOVLW 0xc8 00383e 6f04 MOVWF 0x4,0x1 003840 d003 BRA 0x3848 else C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003842 0104 MOVLB 0x4 ep0Bi.Stat._byte = _USIE|_DAT0|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003844 0e88 MOVLW 0x88 003846 6f04 MOVWF 0x4,0x1 } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003848 d001 BRA 0x384c else // CTRL_TRF_RX C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00384a d908 RCALL 0x3a5c USBPrepareForNextSetupTrf(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00384c 0012 RETURN 0x0 }//end USBCtrlTrfInHandler C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlTrfTxService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: pSrc, wCount, and usb_stat.ctrl_trf_mem are setup properly. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: This routine should be called from only two places. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * One from USBCtrlEPServiceComplete() and one from C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * USBCtrlTrfInHandler(). It takes care of managing a C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * transfer over multiple USB transactions. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: This routine works with isochronous endpoint larger than C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 256 bytes and is shown here as an example of how to deal C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * with BC9 and BC8. In reality, a control endpoint can never C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * be larger than 64 bytes. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00384e cfd9 MOVFF 0xfd9,0xfe6 void USBCtrlTrfTxService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003850 ffe6 003852 cfe1 MOVFF 0xfe1,0xfd9 003854 ffd9 003856 0e02 MOVLW 0x2 003858 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c WORD byte_to_send; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * First, have to figure out how many byte of data to send. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00385a 0101 MOVLB 0x1 if(wCount._word < EP0_BUFF_SIZE) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00385c 0e08 MOVLW 0x8 00385e 5dd0 SUBWF 0xd0,0x0,0x1 003860 0e00 MOVLW 0x0 003862 59d1 SUBWFB 0xd1,0x0,0x1 003864 e205 BC 0x3870 003866 c1d0 MOVFF 0x1d0,0xfde byte_to_send._word = wCount._word; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003868 ffde 00386a c1d1 MOVFF 0x1d1,0xfdd 00386c ffdd 00386e d003 BRA 0x3876 else C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003870 0e08 MOVLW 0x8 byte_to_send._word = EP0_BUFF_SIZE; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003872 6ede MOVWF 0xde,0x0 003874 6add CLRF 0xdd,0x0 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Next, load the number of bytes to send to BC9..0 in buffer descriptor C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003876 0104 MOVLB 0x4 ep0Bi.Stat.BC9 = 0; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003878 9304 BCF 0x4,0x1,0x1 00387a 0104 MOVLB 0x4 ep0Bi.Stat.BC8 = 0; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00387c 9104 BCF 0x4,0x0,0x1 00387e 0e01 MOVLW 0x1 ep0Bi.Stat._byte |= MSB(byte_to_send); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003880 50db MOVF 0xdb,0x0,0x0 003882 0104 MOVLB 0x4 003884 1304 IORWF 0x4,0x1,0x1 003886 cfdf MOVFF 0xfdf,0x405 ep0Bi.Cnt = LSB(byte_to_send); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003888 f405 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Subtract the number of bytes just about to be sent from the total. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00388a 0e00 MOVLW 0x0 wCount._word = wCount._word - byte_to_send._word; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00388c 50db MOVF 0xdb,0x0,0x0 00388e 0101 MOVLB 0x1 003890 5fd0 SUBWF 0xd0,0x1,0x1 003892 0e01 MOVLW 0x1 003894 50db MOVF 0xdb,0x0,0x0 003896 0101 MOVLB 0x1 003898 5bd1 SUBWFB 0xd1,0x1,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00389a 0101 MOVLB 0x1 pDst.bRam = (byte*)&CtrlTrfData; // Set destination pointer C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00389c 0e28 MOVLW 0x28 00389e 6fce MOVWF 0xce,0x1 0038a0 0e04 MOVLW 0x4 0038a2 6fcf MOVWF 0xcf,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038a4 0101 MOVLB 0x1 if(usb_stat.ctrl_trf_mem == _ROM) // Determine type of memory source C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038a6 a3d3 BTFSS 0xd3,0x1,0x1 0038a8 d020 BRA 0x38ea { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038aa cfd9 MOVFF 0xfd9,0xfe9 while(byte_to_send._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038ac ffe9 0038ae cfda MOVFF 0xfda,0xfea 0038b0 ffea 0038b2 50ee MOVF 0xee,0x0,0x0 0038b4 10ed IORWF 0xed,0x0,0x0 0038b6 e018 BZ 0x38e8 0038e6 d7e1 BRA 0x38aa { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038b8 c1cc MOVFF 0x1cc,0xff6 *pDst.bRam = *pSrc.bRom; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038ba fff6 0038bc c1cd MOVFF 0x1cd,0xff7 0038be fff7 0038c0 0008 TBLRD 0038c2 50f5 MOVF 0xf5,0x0,0x0 0038c4 c1ce MOVFF 0x1ce,0xfe9 0038c6 ffe9 0038c8 c1cf MOVFF 0x1cf,0xfea 0038ca ffea 0038cc 6eef MOVWF 0xef,0x0 0038ce 0101 MOVLB 0x1 pDst.bRam++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038d0 2bce INCF 0xce,0x1,0x1 0038d2 0e00 MOVLW 0x0 0038d4 23cf ADDWFC 0xcf,0x1,0x1 0038d6 0101 MOVLB 0x1 pSrc.bRom++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038d8 2bcc INCF 0xcc,0x1,0x1 0038da 0e00 MOVLW 0x0 0038dc 23cd ADDWFC 0xcd,0x1,0x1 0038de 06df DECF 0xdf,0x1,0x0 byte_to_send._word--; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038e0 0e01 MOVLW 0x1 0038e2 e201 BC 0x38e6 0038e4 06db DECF 0xdb,0x1,0x0 }//end while(byte_to_send._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038e8 d01e BRA 0x3926 else // RAM C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038ea cfd9 MOVFF 0xfd9,0xfe9 while(byte_to_send._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038ec ffe9 0038ee cfda MOVFF 0xfda,0xfea 0038f0 ffea 0038f2 50ee MOVF 0xee,0x0,0x0 0038f4 10ed IORWF 0xed,0x0,0x0 0038f6 e017 BZ 0x3926 003924 d7e2 BRA 0x38ea { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038f8 c1cc MOVFF 0x1cc,0xfe9 *pDst.bRam = *pSrc.bRam; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0038fa ffe9 0038fc c1cd MOVFF 0x1cd,0xfea 0038fe ffea 003900 50ef MOVF 0xef,0x0,0x0 003902 c1ce MOVFF 0x1ce,0xfe9 003904 ffe9 003906 c1cf MOVFF 0x1cf,0xfea 003908 ffea 00390a 6eef MOVWF 0xef,0x0 00390c 0101 MOVLB 0x1 pDst.bRam++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00390e 2bce INCF 0xce,0x1,0x1 003910 0e00 MOVLW 0x0 003912 23cf ADDWFC 0xcf,0x1,0x1 003914 0101 MOVLB 0x1 pSrc.bRam++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003916 2bcc INCF 0xcc,0x1,0x1 003918 0e00 MOVLW 0x0 00391a 23cd ADDWFC 0xcd,0x1,0x1 00391c 06df DECF 0xdf,0x1,0x0 byte_to_send._word--; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00391e 0e01 MOVLW 0x1 003920 e201 BC 0x3924 003922 06db DECF 0xdb,0x1,0x0 }//end while(byte_to_send._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c }//end if(usb_stat.ctrl_trf_mem == _ROM) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003926 0e02 MOVLW 0x2 }//end USBCtrlTrfTxService C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003928 5ce1 SUBWF 0xe1,0x0,0x0 00392a e202 BC 0x3930 00392c 6ae1 CLRF 0xe1,0x0 00392e 52e5 MOVF 0xe5,0x1,0x0 003930 6ee1 MOVWF 0xe1,0x0 003932 52e5 MOVF 0xe5,0x1,0x0 003934 cfe7 MOVFF 0xfe7,0xfd9 003936 ffd9 003938 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlTrfRxService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: pDst and wCount are setup properly. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * pSrc is always &CtrlTrfData C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * usb_stat.ctrl_trf_mem is always _RAM. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * wCount should be set to 0 at the start of each control C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * transfer. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: *** This routine is only partially complete. Check for C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * new version of the firmware. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00393a cfd9 MOVFF 0xfd9,0xfe6 void USBCtrlTrfRxService(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00393c ffe6 00393e cfe1 MOVFF 0xfe1,0xfd9 003940 ffd9 003942 0e02 MOVLW 0x2 003944 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c WORD byte_to_read; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003946 0e03 MOVLW 0x3 MSB(byte_to_read) = 0x03 & ep0Bo.Stat._byte; // Filter out last 2 bits C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003948 0104 MOVLB 0x4 00394a 1500 ANDWF 0x0,0x0,0x1 00394c 6ee7 MOVWF 0xe7,0x0 00394e 0e01 MOVLW 0x1 003950 cfe7 MOVFF 0xfe7,0xfdb 003952 ffdb 003954 c401 MOVFF 0x401,0xfdf LSB(byte_to_read) = ep0Bo.Cnt; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003956 ffdf C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Accumulate total number of bytes read C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003958 50de MOVF 0xde,0x0,0x0 wCount._word = wCount._word + byte_to_read._word; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00395a 0101 MOVLB 0x1 00395c 27d0 ADDWF 0xd0,0x1,0x1 00395e 50dd MOVF 0xdd,0x0,0x0 003960 0101 MOVLB 0x1 003962 23d1 ADDWFC 0xd1,0x1,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003964 0101 MOVLB 0x1 pSrc.bRam = (byte*)&CtrlTrfData; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003966 0e28 MOVLW 0x28 003968 6fcc MOVWF 0xcc,0x1 00396a 0e04 MOVLW 0x4 00396c 6fcd MOVWF 0xcd,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00396e cfd9 MOVFF 0xfd9,0xfe9 while(byte_to_read._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003970 ffe9 003972 cfda MOVFF 0xfda,0xfea 003974 ffea 003976 50ee MOVF 0xee,0x0,0x0 003978 10ed IORWF 0xed,0x0,0x0 00397a e017 BZ 0x39aa 0039a8 d7e2 BRA 0x396e { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00397c c1cc MOVFF 0x1cc,0xfe9 *pDst.bRam = *pSrc.bRam; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00397e ffe9 003980 c1cd MOVFF 0x1cd,0xfea 003982 ffea 003984 50ef MOVF 0xef,0x0,0x0 003986 c1ce MOVFF 0x1ce,0xfe9 003988 ffe9 00398a c1cf MOVFF 0x1cf,0xfea 00398c ffea 00398e 6eef MOVWF 0xef,0x0 003990 0101 MOVLB 0x1 pDst.bRam++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003992 2bce INCF 0xce,0x1,0x1 003994 0e00 MOVLW 0x0 003996 23cf ADDWFC 0xcf,0x1,0x1 003998 0101 MOVLB 0x1 pSrc.bRam++; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 00399a 2bcc INCF 0xcc,0x1,0x1 00399c 0e00 MOVLW 0x0 00399e 23cd ADDWFC 0xcd,0x1,0x1 0039a0 06df DECF 0xdf,0x1,0x0 byte_to_read._word--; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039a2 0e01 MOVLW 0x1 0039a4 e201 BC 0x39a8 0039a6 06db DECF 0xdb,0x1,0x0 }//end while(byte_to_read._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039aa 0e02 MOVLW 0x2 }//end USBCtrlTrfRxService C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039ac 5ce1 SUBWF 0xe1,0x0,0x0 0039ae e202 BC 0x39b4 0039b0 6ae1 CLRF 0xe1,0x0 0039b2 52e5 MOVF 0xe5,0x1,0x0 0039b4 6ee1 MOVWF 0xe1,0x0 0039b6 52e5 MOVF 0xe5,0x1,0x0 0039b8 cfe7 MOVFF 0xfe7,0xfd9 0039ba ffd9 0039bc 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBCtrlEPServiceComplete(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: This routine wrap up the ramaining tasks in servicing C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * a Setup Request. Its main task is to set the endpoint C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * controls appropriately for a given situation. See code C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * below. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * There are three main scenarios: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * a) There was no handler for the Request, in this case C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * a STALL should be sent out. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * b) The host has requested a read control transfer, C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * endpoints are required to be setup in a specific way. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * c) The host has requested a write control transfer, or C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * a control data stage is not required, endpoints are C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * required to be setup in a specific way. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Packet processing is resumed by clearing PKTDIS bit. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBCtrlEPServiceComplete(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PKTDIS bit is set when a Setup Transaction is received. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Clear to resume packet processing. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039be 986d BCF 0x6d,0x4,0x0 UCONbits.PKTDIS = 0; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039c0 0101 MOVLB 0x1 if(ctrl_trf_session_owner == MUID_NULL) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039c2 51cb MOVF 0xcb,0x0,0x1 0039c4 e10f BNZ 0x39e4 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * If no one knows how to service this request then stall. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Must also prepare EP0 to receive the next SETUP transaction. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039c6 0104 MOVLB 0x4 ep0Bo.Cnt = EP0_BUFF_SIZE; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039c8 0e08 MOVLW 0x8 0039ca 6f01 MOVWF 0x1,0x1 0039cc 0104 MOVLB 0x4 ep0Bo.ADR = (byte*)&SetupPkt; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039ce 0e20 MOVLW 0x20 0039d0 6f02 MOVWF 0x2,0x1 0039d2 0e04 MOVLW 0x4 0039d4 6f03 MOVWF 0x3,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039d6 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE|_BSTALL; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039d8 0e84 MOVLW 0x84 0039da 6f00 MOVWF 0x0,0x1 0039dc 0104 MOVLB 0x4 ep0Bi.Stat._byte = _USIE|_BSTALL; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039de 0e84 MOVLW 0x84 0039e0 6f04 MOVWF 0x4,0x1 } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039e2 d03b BRA 0x3a5a else // A module has claimed ownership of the control transfer session. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039e4 0104 MOVLB 0x4 if(SetupPkt.DataDir == DEV_TO_HOST) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039e6 af20 BTFSS 0x20,0x7,0x1 0039e8 d025 BRA 0x3a34 { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039ea 0101 MOVLB 0x1 if(SetupPkt.wLength < wCount._word) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039ec 51d0 MOVF 0xd0,0x0,0x1 0039ee 0104 MOVLB 0x4 0039f0 5d26 SUBWF 0x26,0x0,0x1 0039f2 0101 MOVLB 0x1 0039f4 51d1 MOVF 0xd1,0x0,0x1 0039f6 0104 MOVLB 0x4 0039f8 5927 SUBWFB 0x27,0x0,0x1 0039fa e204 BC 0x3a04 0039fc c426 MOVFF 0x426,0x1d0 wCount._word = SetupPkt.wLength; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 0039fe f1d0 003a00 c427 MOVFF 0x427,0x1d1 003a02 f1d1 003a04 df24 RCALL 0x384e USBCtrlTrfTxService(); C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a06 0101 MOVLB 0x1 ctrl_trf_state = CTRL_TRF_TX; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a08 0e01 MOVLW 0x1 003a0a 6fca MOVWF 0xca,0x1 /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Control Read: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * ... | C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 1. Prepare OUT EP to respond to early termination C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * NOTE: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * If something went wrong during the control transfer, C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * the last status stage may not be sent by the host. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * When this happens, two different things could happen C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * depending on the host. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * a) The host could send out a RESET. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * b) The host could send out a new SETUP transaction C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * without sending a RESET first. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * To properly handle case (b), the OUT EP must be setup C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * to receive either a zero length OUT transaction, or a C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * new SETUP transaction. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Since the SETUP transaction requires the DTS bit to be C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * DAT0 while the zero length OUT status requires the DTS C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * bit to be DAT1, the DTS bit check by the hardware should C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * be disabled. This way the SIE could accept either of C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * the two transactions. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Furthermore, the Cnt byte should be set to prepare for C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * the SETUP data (8-byte or more), and the buffer address C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * should be pointed to SetupPkt. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a0c 0104 MOVLB 0x4 ep0Bo.Cnt = EP0_BUFF_SIZE; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a0e 0e08 MOVLW 0x8 003a10 6f01 MOVWF 0x1,0x1 003a12 0104 MOVLB 0x4 ep0Bo.ADR = (byte*)&SetupPkt; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a14 0e20 MOVLW 0x20 003a16 6f02 MOVWF 0x2,0x1 003a18 0e04 MOVLW 0x4 003a1a 6f03 MOVWF 0x3,0x1 003a1c 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE; // Note: DTSEN is 0! C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a1e 0e80 MOVLW 0x80 003a20 6f00 MOVWF 0x0,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 2. Prepare IN EP to transfer data, Cnt should have C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * been initialized by responsible request owner. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a22 0104 MOVLB 0x4 ep0Bi.ADR = (byte*)&CtrlTrfData; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a24 0e28 MOVLW 0x28 003a26 6f06 MOVWF 0x6,0x1 003a28 0e04 MOVLW 0x4 003a2a 6f07 MOVWF 0x7,0x1 003a2c 0104 MOVLB 0x4 ep0Bi.Stat._byte = _USIE|_DAT1|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a2e 0ec8 MOVLW 0xc8 003a30 6f04 MOVWF 0x4,0x1 } C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a32 d013 BRA 0x3a5a else // (SetupPkt.DataDir == HOST_TO_DEV) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a34 0101 MOVLB 0x1 ctrl_trf_state = CTRL_TRF_RX; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a36 0e02 MOVLW 0x2 003a38 6fca MOVWF 0xca,0x1 /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Control Write: C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * ... | C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 1. Prepare IN EP to respond to early termination C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * This is the same as a Zero Length Packet Response C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * for control transfer without a data stage C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a3a 0104 MOVLB 0x4 ep0Bi.Cnt = 0; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a3c 6b05 CLRF 0x5,0x1 003a3e 0104 MOVLB 0x4 ep0Bi.Stat._byte = _USIE|_DAT1|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a40 0ec8 MOVLW 0xc8 003a42 6f04 MOVWF 0x4,0x1 C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /* C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * 2. Prepare OUT EP to receive data. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c */ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a44 0104 MOVLB 0x4 ep0Bo.Cnt = EP0_BUFF_SIZE; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a46 0e08 MOVLW 0x8 003a48 6f01 MOVWF 0x1,0x1 003a4a 0104 MOVLB 0x4 ep0Bo.ADR = (byte*)&CtrlTrfData; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a4c 0e28 MOVLW 0x28 003a4e 6f02 MOVWF 0x2,0x1 003a50 0e04 MOVLW 0x4 003a52 6f03 MOVWF 0x3,0x1 003a54 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE|_DAT1|_DTSEN; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a56 0ec8 MOVLW 0xc8 003a58 6f00 MOVWF 0x0,0x1 }//end if(SetupPkt.DataDir == DEV_TO_HOST) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c }//end if(ctrl_trf_session_owner == MUID_NULL) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a5a 0012 RETURN 0x0 }//end USBCtrlEPServiceComplete C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Function: void USBPrepareForNextSetupTrf(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Overview: The routine forces EP0 OUT to be ready for a new Setup C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * transaction, and forces EP0 IN to be owned by CPU. C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c void USBPrepareForNextSetupTrf(void) C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c { C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a5c 0101 MOVLB 0x1 ctrl_trf_state = WAIT_SETUP; // See usbctrltrf.h C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a5e 6bca CLRF 0xca,0x1 003a60 0104 MOVLB 0x4 ep0Bo.Cnt = EP0_BUFF_SIZE; // Defined in usbcfg.h C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a62 0e08 MOVLW 0x8 003a64 6f01 MOVWF 0x1,0x1 003a66 0104 MOVLB 0x4 ep0Bo.ADR = (byte*)&SetupPkt; C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a68 0e20 MOVLW 0x20 003a6a 6f02 MOVWF 0x2,0x1 003a6c 0e04 MOVLW 0x4 003a6e 6f03 MOVWF 0x3,0x1 003a70 0104 MOVLB 0x4 ep0Bo.Stat._byte = _USIE|_DAT0|_DTSEN; // EP0 buff dsc init, see usbmmap.h C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a72 0e88 MOVLW 0x88 003a74 6f00 MOVWF 0x0,0x1 003a76 0104 MOVLB 0x4 ep0Bi.Stat._byte = _UCPU; // EP0 IN buffer initialization C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c 003a78 6b04 CLRF 0x4,0x1 003a7a 0012 RETURN 0x0 }//end USBPrepareForNextSetupTrf C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /** EOF usbctrltrf.c *********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\usbctrltrf\usbctrltrf.c /********************************************************************* C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Microchip USB C18 Firmware Version 1.0 C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c ********************************************************************* C:\Projects\UBW\FW\D_143\user\user.c * FileName: user.c C:\Projects\UBW\FW\D_143\user\user.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\user\user.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\user\user.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\user\user.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Software License Agreement C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\user\user.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\user\user.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\user\user.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\user\user.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\user\user.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\user\user.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\user\user.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\user\user.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\user\user.c * license. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\user\user.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\user\user.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\user\user.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\user\user.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\user\user.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Author Date Comment C:\Projects\UBW\FW\D_143\user\user.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\user\user.c * Rawin Rojvanit 11/19/04 Original. C:\Projects\UBW\FW\D_143\user\user.c * Brian Schmalz 03/15/06 Added user code to impliment C:\Projects\UBW\FW\D_143\user\user.c * firmware version D v1.0 for UBW C:\Projects\UBW\FW\D_143\user\user.c * project. See www.greta.dhs.org/UBW C:\Projects\UBW\FW\D_143\user\user.c * Brian Schmalz 05/04/06 Starting version 1.1, which will C:\Projects\UBW\FW\D_143\user\user.c * include several fixes. See website. C:\Projects\UBW\FW\D_143\user\user.c * BPS 06/21/06 Starting v1.2 - C:\Projects\UBW\FW\D_143\user\user.c * - Fixed problem with I packets (from T command) filling up TX buffer C:\Projects\UBW\FW\D_143\user\user.c * and not letting any incoming commands be received. (strange) C:\Projects\UBW\FW\D_143\user\user.c * - Adding several commands - Analog inputs being the biggest set. C:\Projects\UBW\FW\D_143\user\user.c * - Also Byte read/Byte write (PEEK/POKE) anywhere in memory C:\Projects\UBW\FW\D_143\user\user.c * - Individual pin I/O and direction C:\Projects\UBW\FW\D_143\user\user.c * BPS 08/16/06 v1.3 - Fixed bug with USB startup C:\Projects\UBW\FW\D_143\user\user.c * BPS 09/09/06 v1.4 - Starting 1.4 C:\Projects\UBW\FW\D_143\user\user.c * - Fixed Microchip bug with early silicon - UCONbits.PKTDIS = 0; C:\Projects\UBW\FW\D_143\user\user.c * - Adding BO and BC commands for parallel output to graphics pannels C:\Projects\UBW\FW\D_143\user\user.c * BPS 12/06/06 v1.4 - More work on 1.4 C:\Projects\UBW\FW\D_143\user\user.c * - Re-wrote all I/O buffering code for increased speed and functionality C:\Projects\UBW\FW\D_143\user\user.c * - Re-wrote error handling code C:\Projects\UBW\FW\D_143\user\user.c * - Added delays to BC/BO commands to help Corey C:\Projects\UBW\FW\D_143\user\user.c * BPS 01/06/07 v1.4 - Added RC command for servos C:\Projects\UBW\FW\D_143\user\user.c * BPS 03/07/07 v1.4.1 - Changed blink rate for SFE C:\Projects\UBW\FW\D_143\user\user.c * BPS 05/24/07 v1.4.2 - Fixed RC command bug - it C:\Projects\UBW\FW\D_143\user\user.c * wouldn't shut off. C:\Projects\UBW\FW\D_143\user\user.c * BPS 08/28/07 v1.4.3 - Allowed UBW to run without C:\Projects\UBW\FW\D_143\user\user.c * usb connected. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c ********************************************************************/ C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\user\user.c #include C:\Projects\UBW\FW\D_143\user\user.c #include C:\Projects\UBW\FW\D_143\user\user.c #include C:\Projects\UBW\FW\D_143\user\user.c #include C:\Projects\UBW\FW\D_143\user\user.c #include C:\Projects\UBW\FW\D_143\user\user.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\user\user.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\user\user.c #include "io_cfg.h" // I/O pin mapping C:\Projects\UBW\FW\D_143\user\user.c #include "user\user.h" C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** D E F I N E S ********************************************************/ C:\Projects\UBW\FW\D_143\user\user.c #define bitset(var,bitno) ((var) |= (1 << (bitno))) C:\Projects\UBW\FW\D_143\user\user.c #define bitclr(var,bitno) ((var) &= ~(1 << (bitno))) C:\Projects\UBW\FW\D_143\user\user.c #define bittst(var,bitno) (var& (1 << (bitno))) C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // For the RC command, we define a little data structure that holds the C:\Projects\UBW\FW\D_143\user\user.c // values assoicated with a particular servo connection C:\Projects\UBW\FW\D_143\user\user.c // It's port, pin, value (position) and state (INACTIVE, PRIMED or TIMING) C:\Projects\UBW\FW\D_143\user\user.c // Later on we make an array of these (19 elements long - 19 pins) to track C:\Projects\UBW\FW\D_143\user\user.c // the values of all of the servos. C:\Projects\UBW\FW\D_143\user\user.c typedef enum { C:\Projects\UBW\FW\D_143\user\user.c kOFF = 1 C:\Projects\UBW\FW\D_143\user\user.c ,kWAITING C:\Projects\UBW\FW\D_143\user\user.c ,kPRIMED C:\Projects\UBW\FW\D_143\user\user.c ,kTIMING C:\Projects\UBW\FW\D_143\user\user.c } tRC_state; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #define kRC_DATA_SIZE 24 // In structs, since there are 3 ports of 8 bits each C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #define kTX_BUF_SIZE 64 // In bytes C:\Projects\UBW\FW\D_143\user\user.c #define kRX_BUF_SIZE 64 // In bytes C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #define kUSART_TX_BUF_SIZE 64 // In bytes C:\Projects\UBW\FW\D_143\user\user.c #define kUSART_RX_BUF_SIZE 64 // In bytes C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Enum for extract_num() function parameter C:\Projects\UBW\FW\D_143\user\user.c typedef enum { C:\Projects\UBW\FW\D_143\user\user.c kCHAR C:\Projects\UBW\FW\D_143\user\user.c ,kUCHAR C:\Projects\UBW\FW\D_143\user\user.c ,kINT C:\Projects\UBW\FW\D_143\user\user.c ,kUINT C:\Projects\UBW\FW\D_143\user\user.c ,kASCII_CHAR C:\Projects\UBW\FW\D_143\user\user.c ,kUCASE_ASCII_CHAR C:\Projects\UBW\FW\D_143\user\user.c } tExtractType; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #define advance_RX_buf_out() \ C:\Projects\UBW\FW\D_143\user\user.c { \ C:\Projects\UBW\FW\D_143\user\user.c g_RX_buf_out++; \ C:\Projects\UBW\FW\D_143\user\user.c if (kRX_BUF_SIZE == g_RX_buf_out) \ C:\Projects\UBW\FW\D_143\user\user.c { \ C:\Projects\UBW\FW\D_143\user\user.c g_RX_buf_out = 0; \ C:\Projects\UBW\FW\D_143\user\user.c } \ C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #define kISR_FIFO_A_DEPTH 3 C:\Projects\UBW\FW\D_143\user\user.c #define kISR_FIFO_D_DEPTH 3 C:\Projects\UBW\FW\D_143\user\user.c #define kPR2_RELOAD 250 // For 1ms TMR2 tick C:\Projects\UBW\FW\D_143\user\user.c #define kCR 0x0D C:\Projects\UBW\FW\D_143\user\user.c #define kLF 0x0A C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // defines for the error_byte byte - each bit has a meaning C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_TX_BUF_OVERRUN 2 C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_RX_BUFFER_OVERRUN 3 C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_MISSING_PARAMETER 4 C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_PRINTED_ERROR 5 // We've already printed out an error C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT 6 C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_EXTRA_CHARACTERS 7 C:\Projects\UBW\FW\D_143\user\user.c #define kERROR_BYTE_UNKNOWN_COMMAND 8 // Part of command parser, not error handler C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\user\user.c #pragma udata access fast_vars C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Rate variable - how fast does interrupt fire to capture inputs? C:\Projects\UBW\FW\D_143\user\user.c near unsigned int time_between_updates; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned int ISR_D_RepeatRate; // How many 1ms ticks between Digital updates C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_D_FIFO_in; // In pointer C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_D_FIFO_out; // Out pointer C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_D_FIFO_length; // Current FIFO depth C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned int ISR_A_RepeatRate; // How many 1ms ticks between Analog updates C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_A_FIFO_in; // In pointer C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_A_FIFO_out; // Out pointer C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char ISR_A_FIFO_length; // Current FIFO depth C:\Projects\UBW\FW\D_143\user\user.c near volatile unsigned char AnalogEnable; // Maximum ADC channel to convert C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // This byte has each of its bits used as a seperate error flag C:\Projects\UBW\FW\D_143\user\user.c near unsigned char error_byte; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // RC servo variables C:\Projects\UBW\FW\D_143\user\user.c // First the main array of data for each servo C:\Projects\UBW\FW\D_143\user\user.c near unsigned char g_RC_primed_ptr; C:\Projects\UBW\FW\D_143\user\user.c near unsigned char g_RC_next_ptr; C:\Projects\UBW\FW\D_143\user\user.c near unsigned char g_RC_timing_ptr; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Used only in LowISR C:\Projects\UBW\FW\D_143\user\user.c near unsigned int D_tick_counter; C:\Projects\UBW\FW\D_143\user\user.c near unsigned int A_tick_counter; C:\Projects\UBW\FW\D_143\user\user.c near unsigned char A_cur_channel; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // ROM strings C:\Projects\UBW\FW\D_143\user\user.c const rom char st_OK[] = {"OK\r\n"}; C:\Projects\UBW\FW\D_143\user\user.c const rom char st_LFCR[] = {"\r\n"}; C:\Projects\UBW\FW\D_143\user\user.c const rom char st_version[] = {"UBW FW D Version 1.4.3\r\n"}; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #pragma udata ISR_buf=0x100 C:\Projects\UBW\FW\D_143\user\user.c volatile unsigned int ISR_A_FIFO[12][kISR_FIFO_A_DEPTH]; // Stores the most recent analog conversions C:\Projects\UBW\FW\D_143\user\user.c volatile unsigned char ISR_D_FIFO[3][kISR_FIFO_D_DEPTH]; // FIFO of actual data C:\Projects\UBW\FW\D_143\user\user.c volatile tRC_state g_RC_state[kRC_DATA_SIZE]; // Stores states for each pin for RC command C:\Projects\UBW\FW\D_143\user\user.c volatile unsigned int g_RC_value[kRC_DATA_SIZE]; // Stores reload values for TMR0 C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #pragma udata com_buf=0x200 C:\Projects\UBW\FW\D_143\user\user.c // USB Transmit buffer for packets (back to PC) C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_TX_buf[kTX_BUF_SIZE]; C:\Projects\UBW\FW\D_143\user\user.c // USB Receiving buffer for commands as they come from PC C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_RX_buf[kRX_BUF_SIZE]; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // USART Receiving buffer for data coming from the USART C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_RX_buf[kUSART_RX_BUF_SIZE]; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // USART Transmit buffer for data going to the USART C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_TX_buf[kUSART_TX_BUF_SIZE]; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // These variables are in normal storage space C:\Projects\UBW\FW\D_143\user\user.c #pragma udata C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // These are used for the Fast Parallel Output routines C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_BO_strobe_mask; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_BO_wait_mask; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_BO_strobe_delay; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Pointers to USB transmit (back to PC) buffer C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_TX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_TX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Pointers to USB receive (from PC) buffer C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_RX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_RX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // In and out pointers to our USART input buffer C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_RX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_RX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // In and out pointers to our USART output buffer C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_TX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c unsigned char g_USART_TX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Normally set to TRUE. Able to set FALSE to not send "OK" message after packet recepetion C:\Projects\UBW\FW\D_143\user\user.c BOOL g_ack_enable; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\user\user.c void BlinkUSBStatus (void); // Handles blinking the USB status LED C:\Projects\UBW\FW\D_143\user\user.c BOOL SwitchIsPressed (void); // Check to see if the user (PRG) switch is pressed C:\Projects\UBW\FW\D_143\user\user.c void parse_packet (void); // Take a full packet and dispatch it to the right function C:\Projects\UBW\FW\D_143\user\user.c signed short long extract_number (tExtractType type); // Pull a number paramter out of the packet C:\Projects\UBW\FW\D_143\user\user.c signed char extract_digit (signed short long * acc, unsigned char digits); // Pull a character out of the packet C:\Projects\UBW\FW\D_143\user\user.c void parse_R_packet (void); // R for resetting UBW C:\Projects\UBW\FW\D_143\user\user.c void parse_C_packet (void); // C for configuring I/O and analog pins C:\Projects\UBW\FW\D_143\user\user.c void parse_CX_packet (void); // CX For configuring serial port C:\Projects\UBW\FW\D_143\user\user.c void parse_O_packet (void); // O for output digital to pins C:\Projects\UBW\FW\D_143\user\user.c void parse_I_packet (void); // I for input digital from pins C:\Projects\UBW\FW\D_143\user\user.c void parse_V_packet (void); // V for printing version C:\Projects\UBW\FW\D_143\user\user.c void parse_A_packet (void); // A for requesting analog inputs C:\Projects\UBW\FW\D_143\user\user.c void parse_T_packet (void); // T for setting up timed I/O (digital or analog) C:\Projects\UBW\FW\D_143\user\user.c void parse_PI_packet (void); // PI for reading a single pin C:\Projects\UBW\FW\D_143\user\user.c void parse_PO_packet (void); // PO for setting a single pin state C:\Projects\UBW\FW\D_143\user\user.c void parse_PD_packet (void); // PD for setting a pin's direction C:\Projects\UBW\FW\D_143\user\user.c void parse_MR_packet (void); // MR for Memory Read C:\Projects\UBW\FW\D_143\user\user.c void parse_MW_packet (void); // MW for Memory Write C:\Projects\UBW\FW\D_143\user\user.c void parse_TX_packet (void); // TX for transmitting serial C:\Projects\UBW\FW\D_143\user\user.c void parse_RX_packet (void); // RX for receiving serial C:\Projects\UBW\FW\D_143\user\user.c void parse_RC_packet (void); // RC is for outputing RC servo pulses C:\Projects\UBW\FW\D_143\user\user.c void parse_BO_packet (void); // BO sends data to fast parallel output C:\Projects\UBW\FW\D_143\user\user.c void parse_BC_packet (void); // BC configures fast parallel outputs C:\Projects\UBW\FW\D_143\user\user.c void parse_BS_packet (void); // BS sends binary data to fast parallel output C:\Projects\UBW\FW\D_143\user\user.c void parse_CU_packet (void); // CU configures UBW (system wide parameters) C:\Projects\UBW\FW\D_143\user\user.c void parse_SS_packet (void); // SS Send SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_RS_packet (void); // RS Receive SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_CS_packet (void); // CS Configure SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_SI_packet (void); // SI Send I2C C:\Projects\UBW\FW\D_143\user\user.c void parse_RI_packet (void); // RI Receive I2C C:\Projects\UBW\FW\D_143\user\user.c void parse_CI_packet (void); // CI Configure I2C C:\Projects\UBW\FW\D_143\user\user.c void check_and_send_TX_data (void); // See if there is any data to send to PC, and if so, do it C:\Projects\UBW\FW\D_143\user\user.c void print_ack (void); // Print "OK" after packet is parsed C:\Projects\UBW\FW\D_143\user\user.c int _user_putc (char c); // Our UBS based stream character printer C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\user\user.c #pragma code C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #pragma interruptlow low_ISR C:\Projects\UBW\FW\D_143\user\user.c 000844 cfd8 MOVFF 0xfd8,0xfe4 void low_ISR(void) C:\Projects\UBW\FW\D_143\user\user.c 000846 ffe4 000848 cfe0 MOVFF 0xfe0,0xfe4 00084a ffe4 00084c 6ee4 MOVWF 0xe4,0x0 00084e cfda MOVFF 0xfda,0xfe4 000850 ffe4 000852 cfe2 MOVFF 0xfe2,0xfda 000854 ffda 000856 cfe9 MOVFF 0xfe9,0xfe4 000858 ffe4 00085a cfea MOVFF 0xfea,0xfe4 00085c ffe4 00085e cff3 MOVFF 0xff3,0xfe4 000860 ffe4 000862 cff4 MOVFF 0xff4,0xfe4 000864 ffe4 000866 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c // Do we have a Timer2 interrupt? (1ms rate) C:\Projects\UBW\FW\D_143\user\user.c 000868 a29e BTFSS 0x9e,0x1,0x0 if (PIR1bits.TMR2IF) C:\Projects\UBW\FW\D_143\user\user.c 00086a d101 BRA 0xa6e { C:\Projects\UBW\FW\D_143\user\user.c // Clear the interrupt C:\Projects\UBW\FW\D_143\user\user.c 00086c 929e BCF 0x9e,0x1,0x0 PIR1bits.TMR2IF = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // The most time critical part of this interrupt service routine is the C:\Projects\UBW\FW\D_143\user\user.c // handling of the RC command's servo output pulses. C:\Projects\UBW\FW\D_143\user\user.c // Each time we get this interrupt, we look to see if the next pin on the C:\Projects\UBW\FW\D_143\user\user.c // list has a value greater than zero. If so, we arm set it high and set C:\Projects\UBW\FW\D_143\user\user.c // it's state to PRIMED. Then we advance the pointers to the next pair. C:\Projects\UBW\FW\D_143\user\user.c 00086e 0e03 MOVLW 0x3 if (kPRIMED == g_RC_state[g_RC_primed_ptr]) C:\Projects\UBW\FW\D_143\user\user.c 000870 6e38 MOVWF 0x38,0x0 000872 500e MOVF 0xe,0x0,0x0 000874 6aea CLRF 0xea,0x0 000876 0f51 ADDLW 0x51 000878 6ee9 MOVWF 0xe9,0x0 00087a 0e01 MOVLW 0x1 00087c 22ea ADDWFC 0xea,0x1,0x0 00087e 50ef MOVF 0xef,0x0,0x0 000880 5c38 SUBWF 0x38,0x0,0x0 000882 e130 BNZ 0x8e4 { C:\Projects\UBW\FW\D_143\user\user.c // This is easy, throw the value into the timer C:\Projects\UBW\FW\D_143\user\user.c 000884 500e MOVF 0xe,0x0,0x0 TMR0H = g_RC_value[g_RC_primed_ptr] >> 8; C:\Projects\UBW\FW\D_143\user\user.c 000886 6ee9 MOVWF 0xe9,0x0 000888 6aea CLRF 0xea,0x0 00088a 90d8 BCF 0xd8,0x0,0x0 00088c 36e9 RLCF 0xe9,0x1,0x0 00088e 36ea RLCF 0xea,0x1,0x0 000890 0e69 MOVLW 0x69 000892 26e9 ADDWF 0xe9,0x1,0x0 000894 0e01 MOVLW 0x1 000896 22ea ADDWFC 0xea,0x1,0x0 000898 cfee MOVFF 0xfee,0x38 00089a f038 00089c cfef MOVFF 0xfef,0x39 00089e f039 0008a0 c039 MOVFF 0x39,0x38 0008a2 f038 0008a4 6a39 CLRF 0x39,0x0 0008a6 5038 MOVF 0x38,0x0,0x0 0008a8 6ed7 MOVWF 0xd7,0x0 0008aa 500e MOVF 0xe,0x0,0x0 TMR0L = g_RC_value[g_RC_primed_ptr] & 0xFF; C:\Projects\UBW\FW\D_143\user\user.c 0008ac 6ee9 MOVWF 0xe9,0x0 0008ae 6aea CLRF 0xea,0x0 0008b0 90d8 BCF 0xd8,0x0,0x0 0008b2 36e9 RLCF 0xe9,0x1,0x0 0008b4 36ea RLCF 0xea,0x1,0x0 0008b6 0e69 MOVLW 0x69 0008b8 26e9 ADDWF 0xe9,0x1,0x0 0008ba 0e01 MOVLW 0x1 0008bc 22ea ADDWFC 0xea,0x1,0x0 0008be cfee MOVFF 0xfee,0x38 0008c0 f038 0008c2 cfef MOVFF 0xfef,0x39 0008c4 f039 0008c6 5038 MOVF 0x38,0x0,0x0 0008c8 6ed6 MOVWF 0xd6,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Then make sure the timer's interrupt enable is set C:\Projects\UBW\FW\D_143\user\user.c 0008ca 8af2 BSF 0xf2,0x5,0x0 INTCONbits.TMR0IE = 1; C:\Projects\UBW\FW\D_143\user\user.c // And be sure to clear the flag too C:\Projects\UBW\FW\D_143\user\user.c 0008cc 94f2 BCF 0xf2,0x2,0x0 INTCONbits.TMR0IF = 0; C:\Projects\UBW\FW\D_143\user\user.c // Turn on Timer0 C:\Projects\UBW\FW\D_143\user\user.c 0008ce 8ed5 BSF 0xd5,0x7,0x0 T0CONbits.TMR0ON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // And set this pin's state to timing C:\Projects\UBW\FW\D_143\user\user.c 0008d0 500e MOVF 0xe,0x0,0x0 g_RC_state[g_RC_primed_ptr] = kTIMING; C:\Projects\UBW\FW\D_143\user\user.c 0008d2 6aea CLRF 0xea,0x0 0008d4 0f51 ADDLW 0x51 0008d6 6ee9 MOVWF 0xe9,0x0 0008d8 0e01 MOVLW 0x1 0008da 22ea ADDWFC 0xea,0x1,0x0 0008dc 0e04 MOVLW 0x4 0008de 6eef MOVWF 0xef,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Remember which pin is now timing C:\Projects\UBW\FW\D_143\user\user.c 0008e0 500e MOVF 0xe,0x0,0x0 g_RC_timing_ptr = g_RC_primed_ptr; C:\Projects\UBW\FW\D_143\user\user.c 0008e2 6e10 MOVWF 0x10,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0008e4 0e02 MOVLW 0x2 if (kWAITING == g_RC_state[g_RC_next_ptr]) C:\Projects\UBW\FW\D_143\user\user.c 0008e6 6e38 MOVWF 0x38,0x0 0008e8 500f MOVF 0xf,0x0,0x0 0008ea 6aea CLRF 0xea,0x0 0008ec 0f51 ADDLW 0x51 0008ee 6ee9 MOVWF 0xe9,0x0 0008f0 0e01 MOVLW 0x1 0008f2 22ea ADDWFC 0xea,0x1,0x0 0008f4 50ef MOVF 0xef,0x0,0x0 0008f6 5c38 SUBWF 0x38,0x0,0x0 0008f8 e149 BNZ 0x98c { C:\Projects\UBW\FW\D_143\user\user.c // If the value is zero, then shut this pin off C:\Projects\UBW\FW\D_143\user\user.c // otherwise, prime it for sending a pulse C:\Projects\UBW\FW\D_143\user\user.c 0008fa 500f MOVF 0xf,0x0,0x0 if (0 == g_RC_value[g_RC_next_ptr]) C:\Projects\UBW\FW\D_143\user\user.c 0008fc 6ee9 MOVWF 0xe9,0x0 0008fe 6aea CLRF 0xea,0x0 000900 90d8 BCF 0xd8,0x0,0x0 000902 36e9 RLCF 0xe9,0x1,0x0 000904 36ea RLCF 0xea,0x1,0x0 000906 0e69 MOVLW 0x69 000908 26e9 ADDWF 0xe9,0x1,0x0 00090a 0e01 MOVLW 0x1 00090c 22ea ADDWFC 0xea,0x1,0x0 00090e 50ee MOVF 0xee,0x0,0x0 000910 10ed IORWF 0xed,0x0,0x0 000912 e109 BNZ 0x926 { C:\Projects\UBW\FW\D_143\user\user.c 000914 500f MOVF 0xf,0x0,0x0 g_RC_state[g_RC_next_ptr] = kOFF; C:\Projects\UBW\FW\D_143\user\user.c 000916 6aea CLRF 0xea,0x0 000918 0f51 ADDLW 0x51 00091a 6ee9 MOVWF 0xe9,0x0 00091c 0e01 MOVLW 0x1 00091e 22ea ADDWFC 0xea,0x1,0x0 000920 0e01 MOVLW 0x1 000922 6eef MOVWF 0xef,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000924 d033 BRA 0x98c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Set the bit high C:\Projects\UBW\FW\D_143\user\user.c 000926 0e08 MOVLW 0x8 if (g_RC_next_ptr < 8) C:\Projects\UBW\FW\D_143\user\user.c 000928 5c0f SUBWF 0xf,0x0,0x0 00092a e20c BC 0x944 { C:\Projects\UBW\FW\D_143\user\user.c 00092c 0e07 MOVLW 0x7 bitset (LATA, g_RC_next_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 00092e 140f ANDWF 0xf,0x0,0x0 000930 6e38 MOVWF 0x38,0x0 000932 0e01 MOVLW 0x1 000934 5238 MOVF 0x38,0x1,0x0 000936 e004 BZ 0x940 000938 46e8 RLNCF 0xe8,0x1,0x0 00093a 0bfe ANDLW 0xfe 00093c 0638 DECF 0x38,0x1,0x0 00093e e1fc BNZ 0x938 000940 1289 IORWF 0x89,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000942 d01a BRA 0x978 else if (g_RC_next_ptr < 16) C:\Projects\UBW\FW\D_143\user\user.c 000944 0e10 MOVLW 0x10 000946 5c0f SUBWF 0xf,0x0,0x0 000948 e20c BC 0x962 { C:\Projects\UBW\FW\D_143\user\user.c 00094a 0e07 MOVLW 0x7 bitset (LATB, g_RC_next_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 00094c 140f ANDWF 0xf,0x0,0x0 00094e 6e38 MOVWF 0x38,0x0 000950 0e01 MOVLW 0x1 000952 5238 MOVF 0x38,0x1,0x0 000954 e004 BZ 0x95e 000956 46e8 RLNCF 0xe8,0x1,0x0 000958 0bfe ANDLW 0xfe 00095a 0638 DECF 0x38,0x1,0x0 00095c e1fc BNZ 0x956 00095e 128a IORWF 0x8a,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000960 d00b BRA 0x978 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 000962 0e07 MOVLW 0x7 bitset (LATC, g_RC_next_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 000964 140f ANDWF 0xf,0x0,0x0 000966 6e38 MOVWF 0x38,0x0 000968 0e01 MOVLW 0x1 00096a 5238 MOVF 0x38,0x1,0x0 00096c e004 BZ 0x976 00096e 46e8 RLNCF 0xe8,0x1,0x0 000970 0bfe ANDLW 0xfe 000972 0638 DECF 0x38,0x1,0x0 000974 e1fc BNZ 0x96e 000976 128b IORWF 0x8b,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c // Set the state to primed so we know to do next C:\Projects\UBW\FW\D_143\user\user.c 000978 500f MOVF 0xf,0x0,0x0 g_RC_state[g_RC_next_ptr] = kPRIMED; C:\Projects\UBW\FW\D_143\user\user.c 00097a 6aea CLRF 0xea,0x0 00097c 0f51 ADDLW 0x51 00097e 6ee9 MOVWF 0xe9,0x0 000980 0e01 MOVLW 0x1 000982 22ea ADDWFC 0xea,0x1,0x0 000984 0e03 MOVLW 0x3 000986 6eef MOVWF 0xef,0x0 // And remember which pin is primed C:\Projects\UBW\FW\D_143\user\user.c 000988 500f MOVF 0xf,0x0,0x0 g_RC_primed_ptr = g_RC_next_ptr; C:\Projects\UBW\FW\D_143\user\user.c 00098a 6e0e MOVWF 0xe,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // And always advance the main pointer C:\Projects\UBW\FW\D_143\user\user.c // NOTE: we need to skip RA6, RA7, and RC3, RC4, and RC5 C:\Projects\UBW\FW\D_143\user\user.c // (Because UBW doesn't bring those pins out to headers) C:\Projects\UBW\FW\D_143\user\user.c 00098c 2a0f INCF 0xf,0x1,0x0 g_RC_next_ptr++; C:\Projects\UBW\FW\D_143\user\user.c 00098e 0e06 MOVLW 0x6 if (6 == g_RC_next_ptr) C:\Projects\UBW\FW\D_143\user\user.c 000990 5c0f SUBWF 0xf,0x0,0x0 000992 e103 BNZ 0x99a { C:\Projects\UBW\FW\D_143\user\user.c 000994 0e08 MOVLW 0x8 g_RC_next_ptr = 8; C:\Projects\UBW\FW\D_143\user\user.c 000996 6e0f MOVWF 0xf,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000998 d00a BRA 0x9ae else if (19 == g_RC_next_ptr) C:\Projects\UBW\FW\D_143\user\user.c 00099a 0e13 MOVLW 0x13 00099c 5c0f SUBWF 0xf,0x0,0x0 00099e e103 BNZ 0x9a6 { C:\Projects\UBW\FW\D_143\user\user.c 0009a0 0e16 MOVLW 0x16 g_RC_next_ptr = 22; C:\Projects\UBW\FW\D_143\user\user.c 0009a2 6e0f MOVWF 0xf,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0009a4 d004 BRA 0x9ae else if (kRC_DATA_SIZE == g_RC_next_ptr) C:\Projects\UBW\FW\D_143\user\user.c 0009a6 0e18 MOVLW 0x18 0009a8 5c0f SUBWF 0xf,0x0,0x0 0009aa e101 BNZ 0x9ae { C:\Projects\UBW\FW\D_143\user\user.c 0009ac 6a0f CLRF 0xf,0x0 g_RC_next_ptr = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // See if it's time to fire off an I packet C:\Projects\UBW\FW\D_143\user\user.c 0009ae 0e00 MOVLW 0x0 if (ISR_D_RepeatRate > 0) C:\Projects\UBW\FW\D_143\user\user.c 0009b0 80d8 BSF 0xd8,0x0,0x0 0009b2 5402 SUBFWB 0x2,0x0,0x0 0009b4 0e00 MOVLW 0x0 0009b6 5403 SUBFWB 0x3,0x0,0x0 0009b8 e22e BC 0xa16 { C:\Projects\UBW\FW\D_143\user\user.c 0009ba 2a11 INCF 0x11,0x1,0x0 D_tick_counter++; C:\Projects\UBW\FW\D_143\user\user.c 0009bc 0e00 MOVLW 0x0 0009be 2212 ADDWFC 0x12,0x1,0x0 0009c0 5002 MOVF 0x2,0x0,0x0 if (D_tick_counter >= ISR_D_RepeatRate) C:\Projects\UBW\FW\D_143\user\user.c 0009c2 5c11 SUBWF 0x11,0x0,0x0 0009c4 5003 MOVF 0x3,0x0,0x0 0009c6 5812 SUBWFB 0x12,0x0,0x0 0009c8 e326 BNC 0xa16 { C:\Projects\UBW\FW\D_143\user\user.c 0009ca 6a11 CLRF 0x11,0x0 D_tick_counter = 0; C:\Projects\UBW\FW\D_143\user\user.c 0009cc 6a12 CLRF 0x12,0x0 // Tell the main code to send an I packet C:\Projects\UBW\FW\D_143\user\user.c 0009ce 0e03 MOVLW 0x3 if (ISR_D_FIFO_length < kISR_FIFO_D_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 0009d0 5c06 SUBWF 0x6,0x0,0x0 0009d2 e21f BC 0xa12 { C:\Projects\UBW\FW\D_143\user\user.c // And copy over our port values C:\Projects\UBW\FW\D_143\user\user.c 0009d4 5004 MOVF 0x4,0x0,0x0 ISR_D_FIFO[0][ISR_D_FIFO_in] = PORTA; C:\Projects\UBW\FW\D_143\user\user.c 0009d6 6aea CLRF 0xea,0x0 0009d8 0f48 ADDLW 0x48 0009da 6ee9 MOVWF 0xe9,0x0 0009dc 0e01 MOVLW 0x1 0009de 22ea ADDWFC 0xea,0x1,0x0 0009e0 cf80 MOVFF 0xf80,0xfef 0009e2 ffef 0009e4 5004 MOVF 0x4,0x0,0x0 ISR_D_FIFO[1][ISR_D_FIFO_in] = PORTB; C:\Projects\UBW\FW\D_143\user\user.c 0009e6 6aea CLRF 0xea,0x0 0009e8 0f4b ADDLW 0x4b 0009ea 6ee9 MOVWF 0xe9,0x0 0009ec 0e01 MOVLW 0x1 0009ee 22ea ADDWFC 0xea,0x1,0x0 0009f0 cf81 MOVFF 0xf81,0xfef 0009f2 ffef 0009f4 5004 MOVF 0x4,0x0,0x0 ISR_D_FIFO[2][ISR_D_FIFO_in] = PORTC; C:\Projects\UBW\FW\D_143\user\user.c 0009f6 6aea CLRF 0xea,0x0 0009f8 0f4e ADDLW 0x4e 0009fa 6ee9 MOVWF 0xe9,0x0 0009fc 0e01 MOVLW 0x1 0009fe 22ea ADDWFC 0xea,0x1,0x0 000a00 cf82 MOVFF 0xf82,0xfef 000a02 ffef 000a04 2a04 INCF 0x4,0x1,0x0 ISR_D_FIFO_in++; C:\Projects\UBW\FW\D_143\user\user.c 000a06 0e03 MOVLW 0x3 if (ISR_D_FIFO_in >= kISR_FIFO_D_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 000a08 5c04 SUBWF 0x4,0x0,0x0 000a0a e301 BNC 0xa0e { C:\Projects\UBW\FW\D_143\user\user.c 000a0c 6a04 CLRF 0x4,0x0 ISR_D_FIFO_in = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000a0e 2a06 INCF 0x6,0x1,0x0 ISR_D_FIFO_length++; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000a10 d002 BRA 0xa16 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Stop the madness! Something is wrong, we're C:\Projects\UBW\FW\D_143\user\user.c // not getting our packets out. So kill the C:\Projects\UBW\FW\D_143\user\user.c // timer. C:\Projects\UBW\FW\D_143\user\user.c 000a12 6a02 CLRF 0x2,0x0 ISR_D_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 000a14 6a03 CLRF 0x3,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // See if it's time to fire off an A packet C:\Projects\UBW\FW\D_143\user\user.c 000a16 0e00 MOVLW 0x0 if ((ISR_A_RepeatRate > 0) && (AnalogEnable > 0)) C:\Projects\UBW\FW\D_143\user\user.c 000a18 80d8 BSF 0xd8,0x0,0x0 000a1a 5407 SUBFWB 0x7,0x0,0x0 000a1c 0e00 MOVLW 0x0 000a1e 5408 SUBFWB 0x8,0x0,0x0 000a20 e219 BC 0xa54 000a22 500c MOVF 0xc,0x0,0x0 000a24 0800 SUBLW 0x0 000a26 e216 BC 0xa54 { C:\Projects\UBW\FW\D_143\user\user.c 000a28 2a13 INCF 0x13,0x1,0x0 A_tick_counter++; C:\Projects\UBW\FW\D_143\user\user.c 000a2a 0e00 MOVLW 0x0 000a2c 2214 ADDWFC 0x14,0x1,0x0 000a2e 5007 MOVF 0x7,0x0,0x0 if (A_tick_counter >= ISR_A_RepeatRate) C:\Projects\UBW\FW\D_143\user\user.c 000a30 5c13 SUBWF 0x13,0x0,0x0 000a32 5008 MOVF 0x8,0x0,0x0 000a34 5814 SUBWFB 0x14,0x0,0x0 000a36 e30e BNC 0xa54 { C:\Projects\UBW\FW\D_143\user\user.c 000a38 6a13 CLRF 0x13,0x0 A_tick_counter = 0; C:\Projects\UBW\FW\D_143\user\user.c 000a3a 6a14 CLRF 0x14,0x0 // Tell the main code to send an A packet C:\Projects\UBW\FW\D_143\user\user.c 000a3c 0e03 MOVLW 0x3 if (ISR_A_FIFO_length < kISR_FIFO_A_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 000a3e 5c0b SUBWF 0xb,0x0,0x0 000a40 e207 BC 0xa50 { C:\Projects\UBW\FW\D_143\user\user.c 000a42 2a09 INCF 0x9,0x1,0x0 ISR_A_FIFO_in++; C:\Projects\UBW\FW\D_143\user\user.c 000a44 0e03 MOVLW 0x3 if (ISR_A_FIFO_in >= kISR_FIFO_A_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 000a46 5c09 SUBWF 0x9,0x0,0x0 000a48 e301 BNC 0xa4c { C:\Projects\UBW\FW\D_143\user\user.c 000a4a 6a09 CLRF 0x9,0x0 ISR_A_FIFO_in = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000a4c 2a0b INCF 0xb,0x1,0x0 ISR_A_FIFO_length++; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000a4e d002 BRA 0xa54 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Stop the madness! Something is wrong, we're C:\Projects\UBW\FW\D_143\user\user.c // not getting our packets out. So kill the A C:\Projects\UBW\FW\D_143\user\user.c // packets. C:\Projects\UBW\FW\D_143\user\user.c 000a50 6a07 CLRF 0x7,0x0 ISR_A_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 000a52 6a08 CLRF 0x8,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // See if it's time to start analog conversions C:\Projects\UBW\FW\D_143\user\user.c 000a54 500c MOVF 0xc,0x0,0x0 if (AnalogEnable > 0) C:\Projects\UBW\FW\D_143\user\user.c 000a56 0800 SUBLW 0x0 000a58 e20a BC 0xa6e { C:\Projects\UBW\FW\D_143\user\user.c // Set the channel to zero to start off with C:\Projects\UBW\FW\D_143\user\user.c 000a5a 6a15 CLRF 0x15,0x0 A_cur_channel = 0; C:\Projects\UBW\FW\D_143\user\user.c 000a5c 5015 MOVF 0x15,0x0,0x0 ADCON0 = (A_cur_channel << 2) + 1; C:\Projects\UBW\FW\D_143\user\user.c 000a5e 0d04 MULLW 0x4 000a60 28f3 INCF 0xf3,0x0,0x0 000a62 6ec2 MOVWF 0xc2,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Clear the interrupt C:\Projects\UBW\FW\D_143\user\user.c 000a64 9c9e BCF 0x9e,0x6,0x0 PIR1bits.ADIF = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // And make sure to always use low priority. C:\Projects\UBW\FW\D_143\user\user.c 000a66 9c9f BCF 0x9f,0x6,0x0 IPR1bits.ADIP = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Set the interrupt enable C:\Projects\UBW\FW\D_143\user\user.c 000a68 8c9d BSF 0x9d,0x6,0x0 PIE1bits.ADIE = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Make sure it's on! C:\Projects\UBW\FW\D_143\user\user.c 000a6a 80c2 BSF 0xc2,0x0,0x0 ADCON0bits.ADON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // And tell the A/D to GO! C:\Projects\UBW\FW\D_143\user\user.c 000a6c 82c2 BSF 0xc2,0x1,0x0 ADCON0bits.GO_DONE = 1; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Do we have an analog interrupt? C:\Projects\UBW\FW\D_143\user\user.c 000a6e ac9e BTFSS 0x9e,0x6,0x0 if (PIR1bits.ADIF) C:\Projects\UBW\FW\D_143\user\user.c 000a70 d02d BRA 0xacc { C:\Projects\UBW\FW\D_143\user\user.c // Clear the interrupt C:\Projects\UBW\FW\D_143\user\user.c 000a72 9c9e BCF 0x9e,0x6,0x0 PIR1bits.ADIF = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Read out the value that we just converted, and store it. C:\Projects\UBW\FW\D_143\user\user.c 000a8a 5015 MOVF 0x15,0x0,0x0 ISR_A_FIFO[A_cur_channel][ISR_A_FIFO_in] = C:\Projects\UBW\FW\D_143\user\user.c 000a8c 0d06 MULLW 0x6 000a8e cff3 MOVFF 0xff3,0x38 000a90 f038 000a92 cff4 MOVFF 0xff4,0x39 000a94 f039 000a96 0e00 MOVLW 0x0 000a98 2638 ADDWF 0x38,0x1,0x0 000a9a 0e01 MOVLW 0x1 000a9c 2239 ADDWFC 0x39,0x1,0x0 000a9e 5009 MOVF 0x9,0x0,0x0 000aa0 0d02 MULLW 0x2 000aa2 5038 MOVF 0x38,0x0,0x0 000aa4 24f3 ADDWF 0xf3,0x0,0x0 000aa6 6ee9 MOVWF 0xe9,0x0 000aa8 5039 MOVF 0x39,0x0,0x0 000aaa 20f4 ADDWFC 0xf4,0x0,0x0 000aac 6eea MOVWF 0xea,0x0 000a7e 50c3 MOVF 0xc3,0x0,0x0 (unsigned int)ADRESL C:\Projects\UBW\FW\D_143\user\user.c | C:\Projects\UBW\FW\D_143\user\user.c 000a74 50c4 MOVF 0xc4,0x0,0x0 ((unsigned int)ADRESH << 8); C:\Projects\UBW\FW\D_143\user\user.c 000a76 6e3c MOVWF 0x3c,0x0 000a78 c03c MOVFF 0x3c,0x3d 000a7a f03d 000a7c 6a3c CLRF 0x3c,0x0 000a80 0100 MOVLB 0x0 000a82 103c IORWF 0x3c,0x0,0x0 000a84 6e3a MOVWF 0x3a,0x0 000a86 c03d MOVFF 0x3d,0x3b 000a88 f03b 000aae c03a MOVFF 0x3a,0xfee 000ab0 ffee 000ab2 c03b MOVFF 0x3b,0xfed 000ab4 ffed C:\Projects\UBW\FW\D_143\user\user.c // Incriment the channel and write the new one in C:\Projects\UBW\FW\D_143\user\user.c 000ab6 2a15 INCF 0x15,0x1,0x0 A_cur_channel++; C:\Projects\UBW\FW\D_143\user\user.c 000ab8 500c MOVF 0xc,0x0,0x0 if (A_cur_channel >= AnalogEnable) C:\Projects\UBW\FW\D_143\user\user.c 000aba 5c15 SUBWF 0x15,0x0,0x0 000abc e302 BNC 0xac2 { C:\Projects\UBW\FW\D_143\user\user.c // We're done, so just sit and wait C:\Projects\UBW\FW\D_143\user\user.c // Turn off our interrupts though. C:\Projects\UBW\FW\D_143\user\user.c 000abe 9c9d BCF 0x9d,0x6,0x0 PIE1bits.ADIE = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000ac0 d005 BRA 0xacc else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Update the channel number C:\Projects\UBW\FW\D_143\user\user.c 000ac2 5015 MOVF 0x15,0x0,0x0 ADCON0 = (A_cur_channel << 2) + 1; C:\Projects\UBW\FW\D_143\user\user.c 000ac4 0d04 MULLW 0x4 000ac6 28f3 INCF 0xf3,0x0,0x0 000ac8 6ec2 MOVWF 0xc2,0x0 // And start the next conversion C:\Projects\UBW\FW\D_143\user\user.c 000aca 82c2 BSF 0xc2,0x1,0x0 ADCON0bits.GO_DONE = 1; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Do we have a TMR0 interrupt? (RC command) C:\Projects\UBW\FW\D_143\user\user.c // TMR0 is in 16 bit mode, and counts up to FFFF and overflows, generating C:\Projects\UBW\FW\D_143\user\user.c // this interrupt. C:\Projects\UBW\FW\D_143\user\user.c 000acc a4f2 BTFSS 0xf2,0x2,0x0 if (INTCONbits.TMR0IF) C:\Projects\UBW\FW\D_143\user\user.c 000ace d042 BRA 0xb54 { C:\Projects\UBW\FW\D_143\user\user.c // Turn off Timer0 C:\Projects\UBW\FW\D_143\user\user.c 000ad0 9ed5 BCF 0xd5,0x7,0x0 T0CONbits.TMR0ON = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Clear the interrupt C:\Projects\UBW\FW\D_143\user\user.c 000ad2 94f2 BCF 0xf2,0x2,0x0 INTCONbits.TMR0IF = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // And disable it C:\Projects\UBW\FW\D_143\user\user.c 000ad4 9af2 BCF 0xf2,0x5,0x0 INTCONbits.TMR0IE = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Only do our stuff if the pin is in the proper state C:\Projects\UBW\FW\D_143\user\user.c 000ad6 0e04 MOVLW 0x4 if (kTIMING == g_RC_state[g_RC_timing_ptr]) C:\Projects\UBW\FW\D_143\user\user.c 000ad8 6e38 MOVWF 0x38,0x0 000ada 5010 MOVF 0x10,0x0,0x0 000adc 6aea CLRF 0xea,0x0 000ade 0f51 ADDLW 0x51 000ae0 6ee9 MOVWF 0xe9,0x0 000ae2 0e01 MOVLW 0x1 000ae4 22ea ADDWFC 0xea,0x1,0x0 000ae6 50ef MOVF 0xef,0x0,0x0 000ae8 5c38 SUBWF 0x38,0x0,0x0 000aea e134 BNZ 0xb54 { C:\Projects\UBW\FW\D_143\user\user.c // All we need to do is clear the pin and change its state to kWAITING C:\Projects\UBW\FW\D_143\user\user.c 000aec 0e08 MOVLW 0x8 if (g_RC_timing_ptr < 8) C:\Projects\UBW\FW\D_143\user\user.c 000aee 5c10 SUBWF 0x10,0x0,0x0 000af0 e20d BC 0xb0c { C:\Projects\UBW\FW\D_143\user\user.c 000af2 0e07 MOVLW 0x7 bitclr (LATA, g_RC_timing_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 000af4 1410 ANDWF 0x10,0x0,0x0 000af6 6e38 MOVWF 0x38,0x0 000af8 0e01 MOVLW 0x1 000afa 5238 MOVF 0x38,0x1,0x0 000afc e004 BZ 0xb06 000afe 46e8 RLNCF 0xe8,0x1,0x0 000b00 0bfe ANDLW 0xfe 000b02 0638 DECF 0x38,0x1,0x0 000b04 e1fc BNZ 0xafe 000b06 1ce8 COMF 0xe8,0x0,0x0 000b08 1689 ANDWF 0x89,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000b0a d01c BRA 0xb44 else if (g_RC_timing_ptr < 16) C:\Projects\UBW\FW\D_143\user\user.c 000b0c 0e10 MOVLW 0x10 000b0e 5c10 SUBWF 0x10,0x0,0x0 000b10 e20d BC 0xb2c { C:\Projects\UBW\FW\D_143\user\user.c 000b12 0e07 MOVLW 0x7 bitclr (LATB, g_RC_timing_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 000b14 1410 ANDWF 0x10,0x0,0x0 000b16 6e38 MOVWF 0x38,0x0 000b18 0e01 MOVLW 0x1 000b1a 5238 MOVF 0x38,0x1,0x0 000b1c e004 BZ 0xb26 000b1e 46e8 RLNCF 0xe8,0x1,0x0 000b20 0bfe ANDLW 0xfe 000b22 0638 DECF 0x38,0x1,0x0 000b24 e1fc BNZ 0xb1e 000b26 1ce8 COMF 0xe8,0x0,0x0 000b28 168a ANDWF 0x8a,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000b2a d00c BRA 0xb44 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 000b2c 0e07 MOVLW 0x7 bitclr (LATC, g_RC_timing_ptr & 0x7); C:\Projects\UBW\FW\D_143\user\user.c 000b2e 1410 ANDWF 0x10,0x0,0x0 000b30 6e38 MOVWF 0x38,0x0 000b32 0e01 MOVLW 0x1 000b34 5238 MOVF 0x38,0x1,0x0 000b36 e004 BZ 0xb40 000b38 46e8 RLNCF 0xe8,0x1,0x0 000b3a 0bfe ANDLW 0xfe 000b3c 0638 DECF 0x38,0x1,0x0 000b3e e1fc BNZ 0xb38 000b40 1ce8 COMF 0xe8,0x0,0x0 000b42 168b ANDWF 0x8b,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000b44 5010 MOVF 0x10,0x0,0x0 g_RC_state[g_RC_timing_ptr] = kWAITING; C:\Projects\UBW\FW\D_143\user\user.c 000b46 6aea CLRF 0xea,0x0 000b48 0f51 ADDLW 0x51 000b4a 6ee9 MOVWF 0xe9,0x0 000b4c 0e01 MOVLW 0x1 000b4e 22ea ADDWFC 0xea,0x1,0x0 000b50 0e02 MOVLW 0x2 000b52 6eef MOVWF 0xef,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000b54 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000b56 cfe5 MOVFF 0xfe5,0xff4 000b58 fff4 000b5a cfe5 MOVFF 0xfe5,0xff3 000b5c fff3 000b5e cfe5 MOVFF 0xfe5,0xfea 000b60 ffea 000b62 cfe5 MOVFF 0xfe5,0xfe9 000b64 ffe9 000b66 cfe5 MOVFF 0xfe5,0xfda 000b68 ffda 000b6a 50e5 MOVF 0xe5,0x0,0x0 000b6c cfe5 MOVFF 0xfe5,0xfe0 000b6e ffe0 000b70 cfe5 MOVFF 0xfe5,0xfd8 000b72 ffd8 000b74 0010 RETFIE 0x0 C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c #pragma interrupt high_ISR C:\Projects\UBW\FW\D_143\user\user.c 000b76 cfda MOVFF 0xfda,0xfe4 void high_ISR(void) C:\Projects\UBW\FW\D_143\user\user.c 000b78 ffe4 000b7a cfe2 MOVFF 0xfe2,0xfda 000b7c ffda 000b7e 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c 000b80 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000b82 cfe5 MOVFF 0xfe5,0xfda 000b84 ffda 000b86 0011 RETFIE 0x1 C:\Projects\UBW\FW\D_143\user\user.c 000b88 cfd9 MOVFF 0xfd9,0xfe6 void UserInit(void) C:\Projects\UBW\FW\D_143\user\user.c 000b8a ffe6 000b8c cfe1 MOVFF 0xfe1,0xfd9 000b8e ffd9 000b90 0e02 MOVLW 0x2 000b92 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c char i, j; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Make all of 3 digital inputs C:\Projects\UBW\FW\D_143\user\user.c 000b94 6a89 CLRF 0x89,0x0 LATA = 0x00; C:\Projects\UBW\FW\D_143\user\user.c 000b96 6892 SETF 0x92,0x0 TRISA = 0xFF; C:\Projects\UBW\FW\D_143\user\user.c // Turn all analog inputs into digital inputs C:\Projects\UBW\FW\D_143\user\user.c 000b98 0e0f MOVLW 0xf ADCON1 = 0x0F; C:\Projects\UBW\FW\D_143\user\user.c 000b9a 6ec1 MOVWF 0xc1,0x0 // Turn off the ADC C:\Projects\UBW\FW\D_143\user\user.c 000b9c 90c2 BCF 0xc2,0x0,0x0 ADCON0bits.ADON = 0; C:\Projects\UBW\FW\D_143\user\user.c // Turn off our own idea of how many analog channels to convert C:\Projects\UBW\FW\D_143\user\user.c 000b9e 6a0c CLRF 0xc,0x0 AnalogEnable = 0; C:\Projects\UBW\FW\D_143\user\user.c 000ba0 0e07 MOVLW 0x7 CMCON = 0x07; // Comparators as digital inputs C:\Projects\UBW\FW\D_143\user\user.c 000ba2 6eb4 MOVWF 0xb4,0x0 // Make all of PORTB inputs C:\Projects\UBW\FW\D_143\user\user.c 000ba4 6a8a CLRF 0x8a,0x0 LATB = 0x00; C:\Projects\UBW\FW\D_143\user\user.c 000ba6 6893 SETF 0x93,0x0 TRISB = 0xFF; C:\Projects\UBW\FW\D_143\user\user.c // Make all of PORTC inputs C:\Projects\UBW\FW\D_143\user\user.c 000ba8 6a8b CLRF 0x8b,0x0 LATC = 0x00; C:\Projects\UBW\FW\D_143\user\user.c 000baa 6894 SETF 0x94,0x0 TRISC = 0xFF; C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c // Make all of PORTD and PORTE inputs too C:\Projects\UBW\FW\D_143\user\user.c LATD = 0x00; C:\Projects\UBW\FW\D_143\user\user.c TRISD = 0xFF; C:\Projects\UBW\FW\D_143\user\user.c LATE = 0x00; C:\Projects\UBW\FW\D_143\user\user.c TRISE = 0xFF; C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Initalize LED I/Os to outputs C:\Projects\UBW\FW\D_143\user\user.c 000bac 0efc MOVLW 0xfc mInitAllLEDs(); C:\Projects\UBW\FW\D_143\user\user.c 000bae 168b ANDWF 0x8b,0x1,0x0 000bb0 0efc MOVLW 0xfc 000bb2 1694 ANDWF 0x94,0x1,0x0 // Initalize switch as an input C:\Projects\UBW\FW\D_143\user\user.c 000bb4 8494 BSF 0x94,0x2,0x0 mInitSwitch(); C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Start off always using "OK" acknoledge. C:\Projects\UBW\FW\D_143\user\user.c 000bb6 0101 MOVLB 0x1 g_ack_enable = TRUE; C:\Projects\UBW\FW\D_143\user\user.c 000bb8 0e01 MOVLW 0x1 000bba 6fbe MOVWF 0xbe,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Use our own special output function for STDOUT C:\Projects\UBW\FW\D_143\user\user.c 000bbc 0101 MOVLB 0x1 stdout = _H_USER; C:\Projects\UBW\FW\D_143\user\user.c 000bbe 69dc SETF 0xdc,0x1 000bc0 69dd SETF 0xdd,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Initalize all of the ISR FIFOs C:\Projects\UBW\FW\D_143\user\user.c 000bc2 6a0a CLRF 0xa,0x0 ISR_A_FIFO_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bc4 6a09 CLRF 0x9,0x0 ISR_A_FIFO_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bc6 6a0b CLRF 0xb,0x0 ISR_A_FIFO_length = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bc8 6a05 CLRF 0x5,0x0 ISR_D_FIFO_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bca 6a04 CLRF 0x4,0x0 ISR_D_FIFO_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bcc 6a06 CLRF 0x6,0x0 ISR_D_FIFO_length = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Make sure that our timer stuff starts out disabled C:\Projects\UBW\FW\D_143\user\user.c 000bce 6a02 CLRF 0x2,0x0 ISR_D_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bd0 6a03 CLRF 0x3,0x0 000bd2 6a07 CLRF 0x7,0x0 ISR_A_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bd4 6a08 CLRF 0x8,0x0 000bd6 6a11 CLRF 0x11,0x0 D_tick_counter = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bd8 6a12 CLRF 0x12,0x0 000bda 6a13 CLRF 0x13,0x0 A_tick_counter = 0; C:\Projects\UBW\FW\D_143\user\user.c 000bdc 6a14 CLRF 0x14,0x0 000bde 6a15 CLRF 0x15,0x0 A_cur_channel = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now init our registers C:\Projects\UBW\FW\D_143\user\user.c // The prescaler will be at 16 C:\Projects\UBW\FW\D_143\user\user.c 000be0 82ca BSF 0xca,0x1,0x0 T2CONbits.T2CKPS1 = 1; C:\Projects\UBW\FW\D_143\user\user.c 000be2 80ca BSF 0xca,0x0,0x0 T2CONbits.T2CKPS0 = 1; C:\Projects\UBW\FW\D_143\user\user.c // We want the TMR2 post scaler to be a 3 C:\Projects\UBW\FW\D_143\user\user.c 000be4 9cca BCF 0xca,0x6,0x0 T2CONbits.T2OUTPS3 = 0; C:\Projects\UBW\FW\D_143\user\user.c 000be6 9aca BCF 0xca,0x5,0x0 T2CONbits.T2OUTPS2 = 0; C:\Projects\UBW\FW\D_143\user\user.c 000be8 88ca BSF 0xca,0x4,0x0 T2CONbits.T2OUTPS1 = 1; C:\Projects\UBW\FW\D_143\user\user.c 000bea 96ca BCF 0xca,0x3,0x0 T2CONbits.T2OUTPS0 = 0; C:\Projects\UBW\FW\D_143\user\user.c // Set our reload value C:\Projects\UBW\FW\D_143\user\user.c 000bec 0efa MOVLW 0xfa PR2 = kPR2_RELOAD; C:\Projects\UBW\FW\D_143\user\user.c 000bee 6ecb MOVWF 0xcb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Set up the Analog to Digital converter C:\Projects\UBW\FW\D_143\user\user.c // Clear out the FIFO data C:\Projects\UBW\FW\D_143\user\user.c 000bf0 6adf CLRF 0xdf,0x0 for (i = 0; i < 12; i++) C:\Projects\UBW\FW\D_143\user\user.c 000bf2 cfdf MOVFF 0xfdf,0x2a 000bf4 f02a 000bf6 0e0c MOVLW 0xc 000bf8 6ee7 MOVWF 0xe7,0x0 000bfa 182a XORWF 0x2a,0x0,0x0 000bfc aee8 BTFSS 0xe8,0x7,0x0 000bfe d002 BRA 0xc04 000c00 34e7 RLCF 0xe7,0x0,0x0 000c02 d002 BRA 0xc08 000c04 50e7 MOVF 0xe7,0x0,0x0 000c06 5c2a SUBWF 0x2a,0x0,0x0 000c08 e238 BC 0xc7a 000c76 2adf INCF 0xdf,0x1,0x0 000c78 d7bc BRA 0xbf2 { C:\Projects\UBW\FW\D_143\user\user.c 000c0a 0e01 MOVLW 0x1 for (j = 0; j < kISR_FIFO_A_DEPTH; j++) C:\Projects\UBW\FW\D_143\user\user.c 000c0c 6adb CLRF 0xdb,0x0 000c0e 0e01 MOVLW 0x1 000c10 cfdb MOVFF 0xfdb,0x2a 000c12 f02a 000c14 0e03 MOVLW 0x3 000c16 6ee7 MOVWF 0xe7,0x0 000c18 182a XORWF 0x2a,0x0,0x0 000c1a aee8 BTFSS 0xe8,0x7,0x0 000c1c d002 BRA 0xc22 000c1e 34e7 RLCF 0xe7,0x0,0x0 000c20 d002 BRA 0xc26 000c22 50e7 MOVF 0xe7,0x0,0x0 000c24 5c2a SUBWF 0x2a,0x0,0x0 000c26 e227 BC 0xc76 000c70 0e01 MOVLW 0x1 000c72 2adb INCF 0xdb,0x1,0x0 000c74 d7cc BRA 0xc0e { C:\Projects\UBW\FW\D_143\user\user.c 000c28 cfdf MOVFF 0xfdf,0x2a ISR_A_FIFO[i][j] = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c2a f02a 000c2c 6a2b CLRF 0x2b,0x0 000c2e be2a BTFSC 0x2a,0x7,0x0 000c30 682b SETF 0x2b,0x0 000c32 0e06 MOVLW 0x6 000c34 022b MULWF 0x2b,0x0 000c36 cff3 MOVFF 0xff3,0x2b 000c38 f02b 000c3a 0e06 MOVLW 0x6 000c3c 022a MULWF 0x2a,0x0 000c3e cff3 MOVFF 0xff3,0x2a 000c40 f02a 000c42 50f4 MOVF 0xf4,0x0,0x0 000c44 262b ADDWF 0x2b,0x1,0x0 000c46 0e00 MOVLW 0x0 000c48 262a ADDWF 0x2a,0x1,0x0 000c4a 0e01 MOVLW 0x1 000c4c 222b ADDWFC 0x2b,0x1,0x0 000c4e 0e01 MOVLW 0x1 000c50 cfdb MOVFF 0xfdb,0x2c 000c52 f02c 000c54 6a2d CLRF 0x2d,0x0 000c56 be2c BTFSC 0x2c,0x7,0x0 000c58 682d SETF 0x2d,0x0 000c5a 90d8 BCF 0xd8,0x0,0x0 000c5c 362c RLCF 0x2c,0x1,0x0 000c5e 362d RLCF 0x2d,0x1,0x0 000c60 502a MOVF 0x2a,0x0,0x0 000c62 242c ADDWF 0x2c,0x0,0x0 000c64 6ee9 MOVWF 0xe9,0x0 000c66 502b MOVF 0x2b,0x0,0x0 000c68 202d ADDWFC 0x2d,0x0,0x0 000c6a 6eea MOVWF 0xea,0x0 000c6c 6aee CLRF 0xee,0x0 000c6e 6aed CLRF 0xed,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Inialize USB TX and RX buffer management C:\Projects\UBW\FW\D_143\user\user.c 000c7a 0101 MOVLB 0x1 g_RX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c7c 6bb8 CLRF 0xb8,0x1 000c7e 0101 MOVLB 0x1 g_RX_buf_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c80 6bb9 CLRF 0xb9,0x1 000c82 0101 MOVLB 0x1 g_TX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c84 6bb6 CLRF 0xb6,0x1 000c86 0101 MOVLB 0x1 g_TX_buf_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c88 6bb7 CLRF 0xb7,0x1 C:\Projects\UBW\FW\D_143\user\user.c // And the USART TX and RX buffer management C:\Projects\UBW\FW\D_143\user\user.c 000c8a 0101 MOVLB 0x1 g_USART_RX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c8c 6bba CLRF 0xba,0x1 000c8e 0101 MOVLB 0x1 g_USART_RX_buf_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c90 6bbb CLRF 0xbb,0x1 000c92 0101 MOVLB 0x1 g_USART_TX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c94 6bbc CLRF 0xbc,0x1 000c96 0101 MOVLB 0x1 g_USART_TX_buf_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c98 6bbd CLRF 0xbd,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Clear out the RC servo output pointer values C:\Projects\UBW\FW\D_143\user\user.c 000c9a 6a0e CLRF 0xe,0x0 g_RC_primed_ptr = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c9c 6a0f CLRF 0xf,0x0 g_RC_next_ptr = 0; C:\Projects\UBW\FW\D_143\user\user.c 000c9e 6a10 CLRF 0x10,0x0 g_RC_timing_ptr = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Clear the RC data structure C:\Projects\UBW\FW\D_143\user\user.c 000ca0 6adf CLRF 0xdf,0x0 for (i = 0; i < kRC_DATA_SIZE; i++) C:\Projects\UBW\FW\D_143\user\user.c 000ca2 cfdf MOVFF 0xfdf,0x2a 000ca4 f02a 000ca6 0e18 MOVLW 0x18 000ca8 6ee7 MOVWF 0xe7,0x0 000caa 182a XORWF 0x2a,0x0,0x0 000cac aee8 BTFSS 0xe8,0x7,0x0 000cae d002 BRA 0xcb4 000cb0 34e7 RLCF 0xe7,0x0,0x0 000cb2 d002 BRA 0xcb8 000cb4 50e7 MOVF 0xe7,0x0,0x0 000cb6 5c2a SUBWF 0x2a,0x0,0x0 000cb8 e21b BC 0xcf0 000cec 2adf INCF 0xdf,0x1,0x0 000cee d7d9 BRA 0xca2 { C:\Projects\UBW\FW\D_143\user\user.c 000cba cfdf MOVFF 0xfdf,0xfe9 g_RC_value[i] = 0; C:\Projects\UBW\FW\D_143\user\user.c 000cbc ffe9 000cbe 6aea CLRF 0xea,0x0 000cc0 bee9 BTFSC 0xe9,0x7,0x0 000cc2 68ea SETF 0xea,0x0 000cc4 90d8 BCF 0xd8,0x0,0x0 000cc6 36e9 RLCF 0xe9,0x1,0x0 000cc8 36ea RLCF 0xea,0x1,0x0 000cca 0e69 MOVLW 0x69 000ccc 26e9 ADDWF 0xe9,0x1,0x0 000cce 0e01 MOVLW 0x1 000cd0 22ea ADDWFC 0xea,0x1,0x0 000cd2 6aee CLRF 0xee,0x0 000cd4 6aed CLRF 0xed,0x0 000cd6 cfdf MOVFF 0xfdf,0xfe9 g_RC_state[i] = kOFF; C:\Projects\UBW\FW\D_143\user\user.c 000cd8 ffe9 000cda 6aea CLRF 0xea,0x0 000cdc bee9 BTFSC 0xe9,0x7,0x0 000cde 68ea SETF 0xea,0x0 000ce0 0e51 MOVLW 0x51 000ce2 26e9 ADDWF 0xe9,0x1,0x0 000ce4 0e01 MOVLW 0x1 000ce6 22ea ADDWFC 0xea,0x1,0x0 000ce8 0e01 MOVLW 0x1 000cea 6eef MOVWF 0xef,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Enable TMR0 for our RC timing operation C:\Projects\UBW\FW\D_143\user\user.c 000cf0 86d5 BSF 0xd5,0x3,0x0 T0CONbits.PSA = 1; // Do NOT use the prescaler C:\Projects\UBW\FW\D_143\user\user.c 000cf2 9ad5 BCF 0xd5,0x5,0x0 T0CONbits.T0CS = 0; // Use internal clock C:\Projects\UBW\FW\D_143\user\user.c 000cf4 9cd5 BCF 0xd5,0x6,0x0 T0CONbits.T08BIT = 0; // 16 bit timer C:\Projects\UBW\FW\D_143\user\user.c 000cf6 94f2 BCF 0xf2,0x2,0x0 INTCONbits.TMR0IF = 0; // Clear the interrupt flag C:\Projects\UBW\FW\D_143\user\user.c 000cf8 9af2 BCF 0xf2,0x5,0x0 INTCONbits.TMR0IE = 0; // And clear the interrupt enable C:\Projects\UBW\FW\D_143\user\user.c 000cfa 94f1 BCF 0xf1,0x2,0x0 INTCON2bits.TMR0IP = 0; // Low priority C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Enable interrupt priorities C:\Projects\UBW\FW\D_143\user\user.c 000cfc 8ed0 BSF 0xd0,0x7,0x0 RCONbits.IPEN = 1; C:\Projects\UBW\FW\D_143\user\user.c 000cfe 94ca BCF 0xca,0x2,0x0 T2CONbits.TMR2ON = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 000d00 829d BSF 0x9d,0x1,0x0 PIE1bits.TMR2IE = 1; C:\Projects\UBW\FW\D_143\user\user.c 000d02 929f BCF 0x9f,0x1,0x0 IPR1bits.TMR2IP = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 000d04 8ef2 BSF 0xf2,0x7,0x0 INTCONbits.GIEH = 1; // Turn high priority interrupts on C:\Projects\UBW\FW\D_143\user\user.c 000d06 8cf2 BSF 0xf2,0x6,0x0 INTCONbits.GIEL = 1; // Turn low priority interrupts on C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Turn on the Timer2 C:\Projects\UBW\FW\D_143\user\user.c 000d08 84ca BSF 0xca,0x2,0x0 T2CONbits.TMR2ON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 000d0a 0e02 MOVLW 0x2 }//end UserInit C:\Projects\UBW\FW\D_143\user\user.c 000d0c 5ce1 SUBWF 0xe1,0x0,0x0 000d0e e202 BC 0xd14 000d10 6ae1 CLRF 0xe1,0x0 000d12 52e5 MOVF 0xe5,0x1,0x0 000d14 6ee1 MOVWF 0xe1,0x0 000d16 52e5 MOVF 0xe5,0x1,0x0 000d18 cfe7 MOVFF 0xfe7,0xfd9 000d1a ffd9 000d1c 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c /****************************************************************************** C:\Projects\UBW\FW\D_143\user\user.c * Function: void ProcessIO(void) C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * PreCondition: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Input: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Output: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Side Effects: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Overview: In this function, we check for a new packet that just C:\Projects\UBW\FW\D_143\user\user.c * arrived via USB. We do a few checks on the packet to see C:\Projects\UBW\FW\D_143\user\user.c * if it is worthy of us trying to interpret it. If it is, C:\Projects\UBW\FW\D_143\user\user.c * we go and call the proper function based upon the first C:\Projects\UBW\FW\D_143\user\user.c * character of the packet. C:\Projects\UBW\FW\D_143\user\user.c * NOTE: We need to see everything in one packet (i.e. we C:\Projects\UBW\FW\D_143\user\user.c * won't treat the USB data as a stream and try to find our C:\Projects\UBW\FW\D_143\user\user.c * start and end of packets within the stream. We just look C:\Projects\UBW\FW\D_143\user\user.c * at the first character of each packet for a command and C:\Projects\UBW\FW\D_143\user\user.c * check that there's a CR as the last character of the C:\Projects\UBW\FW\D_143\user\user.c * packet. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Note: None C:\Projects\UBW\FW\D_143\user\user.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\user\user.c 000d1e cfd9 MOVFF 0xfd9,0xfe6 void ProcessIO(void) C:\Projects\UBW\FW\D_143\user\user.c 000d20 ffe6 000d22 cfe1 MOVFF 0xfe1,0xfd9 000d24 ffd9 000d26 0e02 MOVLW 0x2 000d28 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c static BOOL in_cr = FALSE; C:\Projects\UBW\FW\D_143\user\user.c static byte last_fifo_size; C:\Projects\UBW\FW\D_143\user\user.c unsigned char tst_char; C:\Projects\UBW\FW\D_143\user\user.c 000d2a 0e01 MOVLW 0x1 BOOL got_full_packet = FALSE; C:\Projects\UBW\FW\D_143\user\user.c 000d2c 6adb CLRF 0xdb,0x0 000d2e 0101 MOVLB 0x1 cdc_rx_len = 0; C:\Projects\UBW\FW\D_143\user\user.c 000d30 6b99 CLRF 0x99,0x1 C:\Projects\UBW\FW\D_143\user\user.c 000d32 ec11 CALL 0x2622,0x0 BlinkUSBStatus(); C:\Projects\UBW\FW\D_143\user\user.c 000d34 f013 C:\Projects\UBW\FW\D_143\user\user.c // Check for any new I packets (from T command) ready to go out C:\Projects\UBW\FW\D_143\user\user.c 000d36 5006 MOVF 0x6,0x0,0x0 while (ISR_D_FIFO_length > 0) C:\Projects\UBW\FW\D_143\user\user.c 000d38 0800 SUBLW 0x0 000d3a e209 BC 0xd4e 000d4c d7f4 BRA 0xd36 { C:\Projects\UBW\FW\D_143\user\user.c // Spit out an I packet first C:\Projects\UBW\FW\D_143\user\user.c 000d3c ec0a CALL 0x1614,0x0 parse_I_packet (); C:\Projects\UBW\FW\D_143\user\user.c 000d3e f00b C:\Projects\UBW\FW\D_143\user\user.c // Then upate our I packet fifo stuff C:\Projects\UBW\FW\D_143\user\user.c 000d40 2a05 INCF 0x5,0x1,0x0 ISR_D_FIFO_out++; C:\Projects\UBW\FW\D_143\user\user.c 000d42 0e03 MOVLW 0x3 if (ISR_D_FIFO_out == kISR_FIFO_D_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 000d44 5c05 SUBWF 0x5,0x0,0x0 000d46 e101 BNZ 0xd4a { C:\Projects\UBW\FW\D_143\user\user.c 000d48 6a05 CLRF 0x5,0x0 ISR_D_FIFO_out = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000d4a 0606 DECF 0x6,0x1,0x0 ISR_D_FIFO_length--; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Check for a new A packet (from T command) ready to go out C:\Projects\UBW\FW\D_143\user\user.c 000d4e 500b MOVF 0xb,0x0,0x0 while (ISR_A_FIFO_length > 0) C:\Projects\UBW\FW\D_143\user\user.c 000d50 0800 SUBLW 0x0 000d52 e209 BC 0xd66 000d64 d7f4 BRA 0xd4e { C:\Projects\UBW\FW\D_143\user\user.c // Spit out an A packet first C:\Projects\UBW\FW\D_143\user\user.c 000d54 ec36 CALL 0x166c,0x0 parse_A_packet (); C:\Projects\UBW\FW\D_143\user\user.c 000d56 f00b C:\Projects\UBW\FW\D_143\user\user.c // Then update our A packet fifo stuff C:\Projects\UBW\FW\D_143\user\user.c 000d58 2a0a INCF 0xa,0x1,0x0 ISR_A_FIFO_out++; C:\Projects\UBW\FW\D_143\user\user.c 000d5a 0e03 MOVLW 0x3 if (ISR_A_FIFO_out == kISR_FIFO_A_DEPTH) C:\Projects\UBW\FW\D_143\user\user.c 000d5c 5c0a SUBWF 0xa,0x0,0x0 000d5e e101 BNZ 0xd62 { C:\Projects\UBW\FW\D_143\user\user.c 000d60 6a0a CLRF 0xa,0x0 ISR_A_FIFO_out = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000d62 060b DECF 0xb,0x1,0x0 ISR_A_FIFO_length--; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Pull in some new data if there is new data to pull in C:\Projects\UBW\FW\D_143\user\user.c if( C:\Projects\UBW\FW\D_143\user\user.c !mCDCUsartRxIsBusy() C:\Projects\UBW\FW\D_143\user\user.c 000d66 0104 MOVLB 0x4 && C:\Projects\UBW\FW\D_143\user\user.c 000d68 0104 MOVLB 0x4 000d6a 5118 MOVF 0x18,0x0,0x1 000d6c 0b80 ANDLW 0x80 !( C:\Projects\UBW\FW\D_143\user\user.c 000d70 0e06 MOVLW 0x6 (usb_device_state < CONFIGURED_STATE) C:\Projects\UBW\FW\D_143\user\user.c 000d72 0101 MOVLB 0x1 000d74 5dd2 SUBWF 0xd2,0x0,0x1 || C:\Projects\UBW\FW\D_143\user\user.c (UCONbits.SUSPND == 1) C:\Projects\UBW\FW\D_143\user\user.c 000d76 e368 BNC 0xe48 ) C:\Projects\UBW\FW\D_143\user\user.c 000d78 506d MOVF 0x6d,0x0,0x0 000d7a 0b02 ANDLW 0x2 000d7c e165 BNZ 0xe48 000d6e e16c BNZ 0xe48 ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Copy data from dual-ram buffer to user's buffer C:\Projects\UBW\FW\D_143\user\user.c 000d7e 0101 MOVLB 0x1 for(cdc_rx_len = 0; cdc_rx_len < CDC_BULK_BD_OUT.Cnt; cdc_rx_len++) C:\Projects\UBW\FW\D_143\user\user.c 000d80 6b99 CLRF 0x99,0x1 000d82 0104 MOVLB 0x4 000d84 5119 MOVF 0x19,0x0,0x1 000d86 0101 MOVLB 0x1 000d88 5d99 SUBWF 0x99,0x0,0x1 000d8a e253 BC 0xe32 000e2c 0101 MOVLB 0x1 000e2e 2b99 INCF 0x99,0x1,0x1 000e30 d7a8 BRA 0xd82 { C:\Projects\UBW\FW\D_143\user\user.c // Check to see if we are in a CR/LF situation C:\Projects\UBW\FW\D_143\user\user.c 000d8c 0101 MOVLB 0x1 tst_char = cdc_data_rx[cdc_rx_len]; C:\Projects\UBW\FW\D_143\user\user.c 000d8e 5199 MOVF 0x99,0x0,0x1 000d90 6aea CLRF 0xea,0x0 000d92 0f08 ADDLW 0x8 000d94 6ee9 MOVWF 0xe9,0x0 000d96 0e05 MOVLW 0x5 000d98 22ea ADDWFC 0xea,0x1,0x0 000d9a cfef MOVFF 0xfef,0xfdf 000d9c ffdf if ( C:\Projects\UBW\FW\D_143\user\user.c 000d9e 0101 MOVLB 0x1 !in_cr C:\Projects\UBW\FW\D_143\user\user.c 000da0 51d6 MOVF 0xd6,0x0,0x1 && C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 000da4 0e0d MOVLW 0xd kCR == tst_char C:\Projects\UBW\FW\D_143\user\user.c 000da6 6e2a MOVWF 0x2a,0x0 000da8 50df MOVF 0xdf,0x0,0x0 000daa 5c2a SUBWF 0x2a,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 000dae 0e0a MOVLW 0xa kLF == tst_char C:\Projects\UBW\FW\D_143\user\user.c 000db0 6e2b MOVWF 0x2b,0x0 000db2 50df MOVF 0xdf,0x0,0x0 000dac e005 BZ 0xdb8 ) C:\Projects\UBW\FW\D_143\user\user.c 000db4 5c2b SUBWF 0x2b,0x0,0x0 000db6 e112 BNZ 0xddc 000da2 e11c BNZ 0xddc ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 000db8 0101 MOVLB 0x1 in_cr = TRUE; C:\Projects\UBW\FW\D_143\user\user.c 000dba 0e01 MOVLW 0x1 000dbc 6fd6 MOVWF 0xd6,0x1 000dbe 0101 MOVLB 0x1 g_RX_buf[g_RX_buf_in] = kCR; C:\Projects\UBW\FW\D_143\user\user.c 000dc0 51b8 MOVF 0xb8,0x0,0x1 000dc2 6aea CLRF 0xea,0x0 000dc4 0f40 ADDLW 0x40 000dc6 6ee9 MOVWF 0xe9,0x0 000dc8 0e02 MOVLW 0x2 000dca 22ea ADDWFC 0xea,0x1,0x0 000dcc 0e0d MOVLW 0xd 000dce 6eef MOVWF 0xef,0x0 000dd0 0101 MOVLB 0x1 g_RX_buf_in++; C:\Projects\UBW\FW\D_143\user\user.c 000dd2 2bb8 INCF 0xb8,0x1,0x1 C:\Projects\UBW\FW\D_143\user\user.c // At this point, we know we have a full packet C:\Projects\UBW\FW\D_143\user\user.c // of information from the PC to parse C:\Projects\UBW\FW\D_143\user\user.c 000dd4 52de MOVF 0xde,0x1,0x0 got_full_packet = TRUE; C:\Projects\UBW\FW\D_143\user\user.c 000dd6 0e01 MOVLW 0x1 000dd8 6edd MOVWF 0xdd,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000dda d015 BRA 0xe06 else if ( C:\Projects\UBW\FW\D_143\user\user.c 000ddc 0e0d MOVLW 0xd tst_char != kCR C:\Projects\UBW\FW\D_143\user\user.c 000dde 5cdf SUBWF 0xdf,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 000de2 0e0a MOVLW 0xa tst_char != kLF C:\Projects\UBW\FW\D_143\user\user.c 000de0 e011 BZ 0xe04 ) C:\Projects\UBW\FW\D_143\user\user.c 000de4 5cdf SUBWF 0xdf,0x0,0x0 000de6 e00e BZ 0xe04 { C:\Projects\UBW\FW\D_143\user\user.c // Only add a byte if it is not a CR or LF C:\Projects\UBW\FW\D_143\user\user.c 000de8 0101 MOVLB 0x1 g_RX_buf[g_RX_buf_in] = tst_char; C:\Projects\UBW\FW\D_143\user\user.c 000dea 51b8 MOVF 0xb8,0x0,0x1 000dec 6aea CLRF 0xea,0x0 000dee 0f40 ADDLW 0x40 000df0 6ee9 MOVWF 0xe9,0x0 000df2 0e02 MOVLW 0x2 000df4 22ea ADDWFC 0xea,0x1,0x0 000df6 cfdf MOVFF 0xfdf,0xfef 000df8 ffef 000dfa 0101 MOVLB 0x1 in_cr = FALSE; C:\Projects\UBW\FW\D_143\user\user.c 000dfc 6bd6 CLRF 0xd6,0x1 000dfe 0101 MOVLB 0x1 g_RX_buf_in++; C:\Projects\UBW\FW\D_143\user\user.c 000e00 2bb8 INCF 0xb8,0x1,0x1 } C:\Projects\UBW\FW\D_143\user\user.c 000e02 d001 BRA 0xe06 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 000e04 d013 BRA 0xe2c continue; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c // Check for buffer wraparound C:\Projects\UBW\FW\D_143\user\user.c 000e06 0e40 MOVLW 0x40 if (kRX_BUF_SIZE == g_RX_buf_in) C:\Projects\UBW\FW\D_143\user\user.c 000e08 0101 MOVLB 0x1 000e0a 5db8 SUBWF 0xb8,0x0,0x1 000e0c e102 BNZ 0xe12 { C:\Projects\UBW\FW\D_143\user\user.c 000e0e 0101 MOVLB 0x1 g_RX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000e10 6bb8 CLRF 0xb8,0x1 } C:\Projects\UBW\FW\D_143\user\user.c // If we hit the out pointer, then this is bad. C:\Projects\UBW\FW\D_143\user\user.c 000e12 0101 MOVLB 0x1 if (g_RX_buf_in == g_RX_buf_out) C:\Projects\UBW\FW\D_143\user\user.c 000e14 51b9 MOVF 0xb9,0x0,0x1 000e16 0101 MOVLB 0x1 000e18 5db8 SUBWF 0xb8,0x0,0x1 000e1a e102 BNZ 0xe20 { C:\Projects\UBW\FW\D_143\user\user.c 000e1c 860d BSF 0xd,0x3,0x0 bitset (error_byte, kERROR_BYTE_RX_BUFFER_OVERRUN); C:\Projects\UBW\FW\D_143\user\user.c 000e1e d009 BRA 0xe32 break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c // Now, if we've gotten a full command (user send ) then C:\Projects\UBW\FW\D_143\user\user.c // go call the code that deals with that command, and then C:\Projects\UBW\FW\D_143\user\user.c // keep parsing. (This allows multiple small commands per packet) C:\Projects\UBW\FW\D_143\user\user.c 000e20 0e01 MOVLW 0x1 if (got_full_packet) C:\Projects\UBW\FW\D_143\user\user.c 000e22 50db MOVF 0xdb,0x0,0x0 000e24 e003 BZ 0xe2c { C:\Projects\UBW\FW\D_143\user\user.c 000e26 d91c RCALL 0x1060 parse_packet (); C:\Projects\UBW\FW\D_143\user\user.c 000e28 0e01 MOVLW 0x1 got_full_packet = FALSE; C:\Projects\UBW\FW\D_143\user\user.c 000e2a 6adb CLRF 0xdb,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Prepare dual-ram buffer for next OUT transaction C:\Projects\UBW\FW\D_143\user\user.c 000e32 0104 MOVLB 0x4 CDC_BULK_BD_OUT.Cnt = sizeof(cdc_data_rx); C:\Projects\UBW\FW\D_143\user\user.c 000e34 0e40 MOVLW 0x40 000e36 6f19 MOVWF 0x19,0x1 000e38 0e40 MOVLW 0x40 mUSBBufferReady(CDC_BULK_BD_OUT); C:\Projects\UBW\FW\D_143\user\user.c 000e3a 0104 MOVLB 0x4 000e3c 1718 ANDWF 0x18,0x1,0x1 000e3e 0104 MOVLB 0x4 000e40 7d18 BTG 0x18,0x6,0x1 000e42 0e88 MOVLW 0x88 000e44 0104 MOVLB 0x4 000e46 1318 IORWF 0x18,0x1,0x1 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Check for any errors logged in error_byte that need to be sent out C:\Projects\UBW\FW\D_143\user\user.c 000e48 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 000e4a e101 BNZ 0xe4e 000e4c d081 BRA 0xf50 { C:\Projects\UBW\FW\D_143\user\user.c 000e4e a00d BTFSS 0xd,0x0,0x0 if (bittst (error_byte, 0)) C:\Projects\UBW\FW\D_143\user\user.c 000e50 d010 BRA 0xe72 { C:\Projects\UBW\FW\D_143\user\user.c // Unused as of yet C:\Projects\UBW\FW\D_143\user\user.c 000e52 0e5f MOVLW 0x5f printf ((far rom char *)"!0 \r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000e54 6e2a MOVWF 0x2a,0x0 000e56 0e40 MOVLW 0x40 000e58 6e2b MOVWF 0x2b,0x0 000e5a 6a2c CLRF 0x2c,0x0 000e5c c02a MOVFF 0x2a,0xfe6 000e5e ffe6 000e60 c02b MOVFF 0x2b,0xfe6 000e62 ffe6 000e64 c02c MOVFF 0x2c,0xfe6 000e66 ffe6 000e68 ec5f CALL 0x42be,0x0 000e6a f021 000e6c 52e5 MOVF 0xe5,0x1,0x0 000e6e 52e5 MOVF 0xe5,0x1,0x0 000e70 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000e72 a20d BTFSS 0xd,0x1,0x0 if (bittst (error_byte, 1)) C:\Projects\UBW\FW\D_143\user\user.c 000e74 d010 BRA 0xe96 { C:\Projects\UBW\FW\D_143\user\user.c // Unused as of yet C:\Projects\UBW\FW\D_143\user\user.c 000e76 0e59 MOVLW 0x59 printf ((far rom char *)"!1 \r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000e78 6e2a MOVWF 0x2a,0x0 000e7a 0e40 MOVLW 0x40 000e7c 6e2b MOVWF 0x2b,0x0 000e7e 6a2c CLRF 0x2c,0x0 000e80 c02a MOVFF 0x2a,0xfe6 000e82 ffe6 000e84 c02b MOVFF 0x2b,0xfe6 000e86 ffe6 000e88 c02c MOVFF 0x2c,0xfe6 000e8a ffe6 000e8c ec5f CALL 0x42be,0x0 000e8e f021 000e90 52e5 MOVF 0xe5,0x1,0x0 000e92 52e5 MOVF 0xe5,0x1,0x0 000e94 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000e96 a40d BTFSS 0xd,0x2,0x0 if (bittst (error_byte, kERROR_BYTE_TX_BUF_OVERRUN)) C:\Projects\UBW\FW\D_143\user\user.c 000e98 d010 BRA 0xeba { C:\Projects\UBW\FW\D_143\user\user.c 000e9a 0e3d MOVLW 0x3d printf ((far rom char *)"!2 Err: TX Buffer overrun\r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000e9c 6e2a MOVWF 0x2a,0x0 000e9e 0e40 MOVLW 0x40 000ea0 6e2b MOVWF 0x2b,0x0 000ea2 6a2c CLRF 0x2c,0x0 000ea4 c02a MOVFF 0x2a,0xfe6 000ea6 ffe6 000ea8 c02b MOVFF 0x2b,0xfe6 000eaa ffe6 000eac c02c MOVFF 0x2c,0xfe6 000eae ffe6 000eb0 ec5f CALL 0x42be,0x0 000eb2 f021 000eb4 52e5 MOVF 0xe5,0x1,0x0 000eb6 52e5 MOVF 0xe5,0x1,0x0 000eb8 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000eba a60d BTFSS 0xd,0x3,0x0 if (bittst (error_byte, kERROR_BYTE_RX_BUFFER_OVERRUN)) C:\Projects\UBW\FW\D_143\user\user.c 000ebc d010 BRA 0xede { C:\Projects\UBW\FW\D_143\user\user.c 000ebe 0e21 MOVLW 0x21 printf ((far rom char *)"!3 Err: RX Buffer overrun\r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000ec0 6e2a MOVWF 0x2a,0x0 000ec2 0e40 MOVLW 0x40 000ec4 6e2b MOVWF 0x2b,0x0 000ec6 6a2c CLRF 0x2c,0x0 000ec8 c02a MOVFF 0x2a,0xfe6 000eca ffe6 000ecc c02b MOVFF 0x2b,0xfe6 000ece ffe6 000ed0 c02c MOVFF 0x2c,0xfe6 000ed2 ffe6 000ed4 ec5f CALL 0x42be,0x0 000ed6 f021 000ed8 52e5 MOVF 0xe5,0x1,0x0 000eda 52e5 MOVF 0xe5,0x1,0x0 000edc 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000ede a80d BTFSS 0xd,0x4,0x0 if (bittst (error_byte, kERROR_BYTE_MISSING_PARAMETER)) C:\Projects\UBW\FW\D_143\user\user.c 000ee0 d010 BRA 0xf02 { C:\Projects\UBW\FW\D_143\user\user.c 000ee2 0e02 MOVLW 0x2 printf ((far rom char *)"!4 Err: Missing parameter(s)\r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000ee4 6e2a MOVWF 0x2a,0x0 000ee6 0e40 MOVLW 0x40 000ee8 6e2b MOVWF 0x2b,0x0 000eea 6a2c CLRF 0x2c,0x0 000eec c02a MOVFF 0x2a,0xfe6 000eee ffe6 000ef0 c02b MOVFF 0x2b,0xfe6 000ef2 ffe6 000ef4 c02c MOVFF 0x2c,0xfe6 000ef6 ffe6 000ef8 ec5f CALL 0x42be,0x0 000efa f021 000efc 52e5 MOVF 0xe5,0x1,0x0 000efe 52e5 MOVF 0xe5,0x1,0x0 000f00 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000f02 aa0d BTFSS 0xd,0x5,0x0 if (bittst (error_byte, kERROR_BYTE_PRINTED_ERROR)) C:\Projects\UBW\FW\D_143\user\user.c 000f04 d000 BRA 0xf06 { C:\Projects\UBW\FW\D_143\user\user.c // We don't need to do anything since something has already been printed out C:\Projects\UBW\FW\D_143\user\user.c //printf ((rom char *)"!5\r\n"); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000f06 ac0d BTFSS 0xd,0x6,0x0 if (bittst (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT)) C:\Projects\UBW\FW\D_143\user\user.c 000f08 d010 BRA 0xf2a { C:\Projects\UBW\FW\D_143\user\user.c 000f0a 0ee1 MOVLW 0xe1 printf ((far rom char *)"!6 Err: Invalid paramter value\r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000f0c 6e2a MOVWF 0x2a,0x0 000f0e 0e3f MOVLW 0x3f 000f10 6e2b MOVWF 0x2b,0x0 000f12 6a2c CLRF 0x2c,0x0 000f14 c02a MOVFF 0x2a,0xfe6 000f16 ffe6 000f18 c02b MOVFF 0x2b,0xfe6 000f1a ffe6 000f1c c02c MOVFF 0x2c,0xfe6 000f1e ffe6 000f20 ec5f CALL 0x42be,0x0 000f22 f021 000f24 52e5 MOVF 0xe5,0x1,0x0 000f26 52e5 MOVF 0xe5,0x1,0x0 000f28 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000f2a ae0d BTFSS 0xd,0x7,0x0 if (bittst (error_byte, kERROR_BYTE_EXTRA_CHARACTERS)) C:\Projects\UBW\FW\D_143\user\user.c 000f2c d010 BRA 0xf4e { C:\Projects\UBW\FW\D_143\user\user.c 000f2e 0ec8 MOVLW 0xc8 printf ((far rom char *)"!7 Err: Extra parmater\r\n"); C:\Projects\UBW\FW\D_143\user\user.c 000f30 6e2a MOVWF 0x2a,0x0 000f32 0e3f MOVLW 0x3f 000f34 6e2b MOVWF 0x2b,0x0 000f36 6a2c CLRF 0x2c,0x0 000f38 c02a MOVFF 0x2a,0xfe6 000f3a ffe6 000f3c c02b MOVFF 0x2b,0xfe6 000f3e ffe6 000f40 c02c MOVFF 0x2c,0xfe6 000f42 ffe6 000f44 ec5f CALL 0x42be,0x0 000f46 f021 000f48 52e5 MOVF 0xe5,0x1,0x0 000f4a 52e5 MOVF 0xe5,0x1,0x0 000f4c 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000f4e 6a0d CLRF 0xd,0x0 error_byte = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Go send any data that needs sending to PC C:\Projects\UBW\FW\D_143\user\user.c 000f50 d835 RCALL 0xfbc check_and_send_TX_data (); C:\Projects\UBW\FW\D_143\user\user.c 000f52 0e02 MOVLW 0x2 } C:\Projects\UBW\FW\D_143\user\user.c 000f54 5ce1 SUBWF 0xe1,0x0,0x0 000f56 e202 BC 0xf5c 000f58 6ae1 CLRF 0xe1,0x0 000f5a 52e5 MOVF 0xe5,0x1,0x0 000f5c 6ee1 MOVWF 0xe1,0x0 000f5e 52e5 MOVF 0xe5,0x1,0x0 000f60 cfe7 MOVFF 0xfe7,0xfd9 000f62 ffd9 000f64 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // This is our replacement for the standard putc routine C:\Projects\UBW\FW\D_143\user\user.c // This enables printf() and all related functions to print to C:\Projects\UBW\FW\D_143\user\user.c // the UBS output (i.e. to the PC) buffer C:\Projects\UBW\FW\D_143\user\user.c 000f66 cfd9 MOVFF 0xfd9,0xfe6 int _user_putc (char c) C:\Projects\UBW\FW\D_143\user\user.c 000f68 ffe6 000f6a cfe1 MOVFF 0xfe1,0xfd9 000f6c ffd9 { C:\Projects\UBW\FW\D_143\user\user.c // Copy the character into the output buffer C:\Projects\UBW\FW\D_143\user\user.c 000f6e 0101 MOVLB 0x1 g_TX_buf[g_TX_buf_in] = c; C:\Projects\UBW\FW\D_143\user\user.c 000f70 51b6 MOVF 0xb6,0x0,0x1 000f72 6aea CLRF 0xea,0x0 000f74 0f00 ADDLW 0x0 000f76 6ee9 MOVWF 0xe9,0x0 000f78 0e02 MOVLW 0x2 000f7a 22ea ADDWFC 0xea,0x1,0x0 000f7c 0efe MOVLW 0xfe 000f7e cfdb MOVFF 0xfdb,0xfef 000f80 ffef 000f82 0101 MOVLB 0x1 g_TX_buf_in++; C:\Projects\UBW\FW\D_143\user\user.c 000f84 2bb6 INCF 0xb6,0x1,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Check for wrap around C:\Projects\UBW\FW\D_143\user\user.c 000f86 0e40 MOVLW 0x40 if (kTX_BUF_SIZE == g_TX_buf_in) C:\Projects\UBW\FW\D_143\user\user.c 000f88 0101 MOVLB 0x1 000f8a 5db6 SUBWF 0xb6,0x0,0x1 000f8c e102 BNZ 0xf92 { C:\Projects\UBW\FW\D_143\user\user.c 000f8e 0101 MOVLB 0x1 g_TX_buf_in = 0; C:\Projects\UBW\FW\D_143\user\user.c 000f90 6bb6 CLRF 0xb6,0x1 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Also check to see if we bumpted up against our output pointer C:\Projects\UBW\FW\D_143\user\user.c 000f92 0101 MOVLB 0x1 if (g_TX_buf_in == g_TX_buf_out) C:\Projects\UBW\FW\D_143\user\user.c 000f94 51b7 MOVF 0xb7,0x0,0x1 000f96 0101 MOVLB 0x1 000f98 5db6 SUBWF 0xb6,0x0,0x1 000f9a e101 BNZ 0xf9e { C:\Projects\UBW\FW\D_143\user\user.c 000f9c 840d BSF 0xd,0x2,0x0 bitset (error_byte, kERROR_BYTE_TX_BUF_OVERRUN); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 000f9e 0efe MOVLW 0xfe return (c); C:\Projects\UBW\FW\D_143\user\user.c 000fa0 cfdb MOVFF 0xfdb,0x2a 000fa2 f02a 000fa4 6a2b CLRF 0x2b,0x0 000fa6 be2a BTFSC 0x2a,0x7,0x0 000fa8 682b SETF 0x2b,0x0 000faa c02a MOVFF 0x2a,0xff3 000fac fff3 000fae c02b MOVFF 0x2b,0xff4 000fb0 fff4 000fb2 d000 BRA 0xfb4 000fb4 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 000fb6 cfe7 MOVFF 0xfe7,0xfd9 000fb8 ffd9 000fba 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // In this function, we check to see it is OK to transmit. If so C:\Projects\UBW\FW\D_143\user\user.c // we see if there is any data to transmit to PC. If so, we schedule C:\Projects\UBW\FW\D_143\user\user.c // it for sending. C:\Projects\UBW\FW\D_143\user\user.c 000fbc cfd9 MOVFF 0xfd9,0xfe6 void check_and_send_TX_data (void) C:\Projects\UBW\FW\D_143\user\user.c 000fbe ffe6 000fc0 cfe1 MOVFF 0xfe1,0xfd9 000fc2 ffd9 000fc4 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c char temp; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Only send if we're not already sending something C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 000fc6 0101 MOVLB 0x1 mUSBUSARTIsTxTrfReady () C:\Projects\UBW\FW\D_143\user\user.c 000fc8 519a MOVF 0x9a,0x0,0x1 && C:\Projects\UBW\FW\D_143\user\user.c !( C:\Projects\UBW\FW\D_143\user\user.c 000fcc 0e06 MOVLW 0x6 (usb_device_state < CONFIGURED_STATE) C:\Projects\UBW\FW\D_143\user\user.c 000fce 0101 MOVLB 0x1 000fd0 5dd2 SUBWF 0xd2,0x0,0x1 || C:\Projects\UBW\FW\D_143\user\user.c (UCONbits.SUSPND == 1) C:\Projects\UBW\FW\D_143\user\user.c 000fd2 e341 BNC 0x1056 ) C:\Projects\UBW\FW\D_143\user\user.c 000fd4 506d MOVF 0x6d,0x0,0x0 000fd6 0b02 ANDLW 0x2 000fd8 e13e BNZ 0x1056 000fca e145 BNZ 0x1056 ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // And only send if there's something there to send C:\Projects\UBW\FW\D_143\user\user.c 000fda 0101 MOVLB 0x1 if (g_TX_buf_out != g_TX_buf_in) C:\Projects\UBW\FW\D_143\user\user.c 000fdc 51b6 MOVF 0xb6,0x0,0x1 000fde 0101 MOVLB 0x1 000fe0 5db7 SUBWF 0xb7,0x0,0x1 000fe2 e039 BZ 0x1056 { C:\Projects\UBW\FW\D_143\user\user.c // Now decide if we need to break it up into two parts or not C:\Projects\UBW\FW\D_143\user\user.c 000fe4 0101 MOVLB 0x1 if (g_TX_buf_in > g_TX_buf_out) C:\Projects\UBW\FW\D_143\user\user.c 000fe6 51b7 MOVF 0xb7,0x0,0x1 000fe8 0101 MOVLB 0x1 000fea 80d8 BSF 0xd8,0x0,0x0 000fec 55b6 SUBFWB 0xb6,0x0,0x1 000fee e21a BC 0x1024 { C:\Projects\UBW\FW\D_143\user\user.c // Since IN is beyond OUT, only need one chunk C:\Projects\UBW\FW\D_143\user\user.c 000ff0 0101 MOVLB 0x1 temp = g_TX_buf_in - g_TX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c 000ff2 51b7 MOVF 0xb7,0x0,0x1 000ff4 0101 MOVLB 0x1 000ff6 5db6 SUBWF 0xb6,0x0,0x1 000ff8 6edf MOVWF 0xdf,0x0 000ffa 0101 MOVLB 0x1 mUSBUSARTTxRam (&g_TX_buf[g_TX_buf_out], temp); C:\Projects\UBW\FW\D_143\user\user.c 000ffc 51b7 MOVF 0xb7,0x0,0x1 000ffe 0101 MOVLB 0x1 001000 6f9b MOVWF 0x9b,0x1 001002 6b9c CLRF 0x9c,0x1 001004 0e00 MOVLW 0x0 001006 0101 MOVLB 0x1 001008 279b ADDWF 0x9b,0x1,0x1 00100a 0e02 MOVLW 0x2 00100c 0101 MOVLB 0x1 00100e 239c ADDWFC 0x9c,0x1,0x1 001010 cfdf MOVFF 0xfdf,0x19f 001012 f19f 001014 0101 MOVLB 0x1 001016 6ba0 CLRF 0xa0,0x1 001018 0101 MOVLB 0x1 00101a 0e01 MOVLW 0x1 00101c 6f9a MOVWF 0x9a,0x1 // Now that we've scheduled the data for sending, C:\Projects\UBW\FW\D_143\user\user.c // update the pointer C:\Projects\UBW\FW\D_143\user\user.c 00101e c1b6 MOVFF 0x1b6,0x1b7 g_TX_buf_out = g_TX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c 001020 f1b7 } C:\Projects\UBW\FW\D_143\user\user.c 001022 d019 BRA 0x1056 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Since IN is before OUT, we need to send from OUT to the end C:\Projects\UBW\FW\D_143\user\user.c // of the buffer, then the next time around we'll catch C:\Projects\UBW\FW\D_143\user\user.c // from the beginning to IN. C:\Projects\UBW\FW\D_143\user\user.c 001024 0e40 MOVLW 0x40 temp = kTX_BUF_SIZE - g_TX_buf_out; C:\Projects\UBW\FW\D_143\user\user.c 001026 0101 MOVLB 0x1 001028 80d8 BSF 0xd8,0x0,0x0 00102a 55b7 SUBFWB 0xb7,0x0,0x1 00102c 6edf MOVWF 0xdf,0x0 00102e 0101 MOVLB 0x1 mUSBUSARTTxRam (&g_TX_buf[g_TX_buf_out], temp); C:\Projects\UBW\FW\D_143\user\user.c 001030 51b7 MOVF 0xb7,0x0,0x1 001032 0101 MOVLB 0x1 001034 6f9b MOVWF 0x9b,0x1 001036 6b9c CLRF 0x9c,0x1 001038 0e00 MOVLW 0x0 00103a 0101 MOVLB 0x1 00103c 279b ADDWF 0x9b,0x1,0x1 00103e 0e02 MOVLW 0x2 001040 0101 MOVLB 0x1 001042 239c ADDWFC 0x9c,0x1,0x1 001044 cfdf MOVFF 0xfdf,0x19f 001046 f19f 001048 0101 MOVLB 0x1 00104a 6ba0 CLRF 0xa0,0x1 00104c 0101 MOVLB 0x1 00104e 0e01 MOVLW 0x1 001050 6f9a MOVWF 0x9a,0x1 // Now that we've scheduled the data for sending, C:\Projects\UBW\FW\D_143\user\user.c // update the pointer C:\Projects\UBW\FW\D_143\user\user.c 001052 0101 MOVLB 0x1 g_TX_buf_out = 0; C:\Projects\UBW\FW\D_143\user\user.c 001054 6bb7 CLRF 0xb7,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001056 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001058 52e5 MOVF 0xe5,0x1,0x0 00105a cfe7 MOVFF 0xfe7,0xfd9 00105c ffd9 00105e 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Look at the new packet, see what command it is, and C:\Projects\UBW\FW\D_143\user\user.c // route it appropriately. We come in knowing that C:\Projects\UBW\FW\D_143\user\user.c // our packet is in g_RX_buf[], and that the beginning C:\Projects\UBW\FW\D_143\user\user.c // of the packet is at g_RX_buf_out, and the end (CR) is at C:\Projects\UBW\FW\D_143\user\user.c // g_RX_buf_in. Note that because of buffer wrapping, C:\Projects\UBW\FW\D_143\user\user.c // g_RX_buf_in may be less than g_RX_buf_out. C:\Projects\UBW\FW\D_143\user\user.c 001060 cfd9 MOVFF 0xfd9,0xfe6 void parse_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001062 ffe6 001064 cfe1 MOVFF 0xfe1,0xfd9 001066 ffd9 001068 0e04 MOVLW 0x4 00106a 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c 00106c 6ade CLRF 0xde,0x0 unsigned int command = 0; C:\Projects\UBW\FW\D_143\user\user.c 00106e 6add CLRF 0xdd,0x0 001070 0e02 MOVLW 0x2 unsigned char cmd1 = 0; C:\Projects\UBW\FW\D_143\user\user.c 001072 6adb CLRF 0xdb,0x0 001074 0e03 MOVLW 0x3 unsigned char cmd2 = 0; C:\Projects\UBW\FW\D_143\user\user.c 001076 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Always grab the first character (which is the first byte of the command) C:\Projects\UBW\FW\D_143\user\user.c 001078 0101 MOVLB 0x1 cmd1 = toupper (g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 00107a 51b9 MOVF 0xb9,0x0,0x1 00107c 6aea CLRF 0xea,0x0 00107e 0f40 ADDLW 0x40 001080 6ee9 MOVWF 0xe9,0x0 001082 0e02 MOVLW 0x2 001084 22ea ADDWFC 0xea,0x1,0x0 001086 50ef MOVF 0xef,0x0,0x0 001088 6ee6 MOVWF 0xe6,0x0 00108a 6ae6 CLRF 0xe6,0x0 00108c ec58 CALL 0x44b0,0x0 00108e f022 001090 52e5 MOVF 0xe5,0x1,0x0 001092 52e5 MOVF 0xe5,0x1,0x0 001094 0e02 MOVLW 0x2 001096 cff3 MOVFF 0xff3,0xfdb 001098 ffdb 00109a 0101 MOVLB 0x1 advance_RX_buf_out(); C:\Projects\UBW\FW\D_143\user\user.c 00109c 2bb9 INCF 0xb9,0x1,0x1 00109e 0e40 MOVLW 0x40 0010a0 0101 MOVLB 0x1 0010a2 5db9 SUBWF 0xb9,0x0,0x1 0010a4 e102 BNZ 0x10aa 0010a6 0101 MOVLB 0x1 0010a8 6bb9 CLRF 0xb9,0x1 0010aa 0e02 MOVLW 0x2 command = cmd1; C:\Projects\UBW\FW\D_143\user\user.c 0010ac 50db MOVF 0xdb,0x0,0x0 0010ae 6ede MOVWF 0xde,0x0 0010b0 6add CLRF 0xdd,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Only grab second one if it is not a comma C:\Projects\UBW\FW\D_143\user\user.c 0010b2 0101 MOVLB 0x1 if (g_RX_buf[g_RX_buf_out] != ',' && g_RX_buf[g_RX_buf_out] != kCR) C:\Projects\UBW\FW\D_143\user\user.c 0010b4 51b9 MOVF 0xb9,0x0,0x1 0010b6 6aea CLRF 0xea,0x0 0010b8 0f40 ADDLW 0x40 0010ba 6ee9 MOVWF 0xe9,0x0 0010bc 0e02 MOVLW 0x2 0010be 22ea ADDWFC 0xea,0x1,0x0 0010c0 50ef MOVF 0xef,0x0,0x0 0010c2 082c SUBLW 0x2c 0010c4 e035 BZ 0x1130 0010c6 0101 MOVLB 0x1 0010c8 51b9 MOVF 0xb9,0x0,0x1 0010ca 6aea CLRF 0xea,0x0 0010cc 0f40 ADDLW 0x40 0010ce 6ee9 MOVWF 0xe9,0x0 0010d0 0e02 MOVLW 0x2 0010d2 22ea ADDWFC 0xea,0x1,0x0 0010d4 50ef MOVF 0xef,0x0,0x0 0010d6 080d SUBLW 0xd 0010d8 e02b BZ 0x1130 { C:\Projects\UBW\FW\D_143\user\user.c 0010da 0101 MOVLB 0x1 cmd2 = toupper (g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 0010dc 51b9 MOVF 0xb9,0x0,0x1 0010de 6aea CLRF 0xea,0x0 0010e0 0f40 ADDLW 0x40 0010e2 6ee9 MOVWF 0xe9,0x0 0010e4 0e02 MOVLW 0x2 0010e6 22ea ADDWFC 0xea,0x1,0x0 0010e8 50ef MOVF 0xef,0x0,0x0 0010ea 6ee6 MOVWF 0xe6,0x0 0010ec 6ae6 CLRF 0xe6,0x0 0010ee ec58 CALL 0x44b0,0x0 0010f0 f022 0010f2 52e5 MOVF 0xe5,0x1,0x0 0010f4 52e5 MOVF 0xe5,0x1,0x0 0010f6 0e03 MOVLW 0x3 0010f8 cff3 MOVFF 0xff3,0xfdb 0010fa ffdb 0010fc 0101 MOVLB 0x1 advance_RX_buf_out(); C:\Projects\UBW\FW\D_143\user\user.c 0010fe 2bb9 INCF 0xb9,0x1,0x1 001100 0e40 MOVLW 0x40 001102 0101 MOVLB 0x1 001104 5db9 SUBWF 0xb9,0x0,0x1 001106 e102 BNZ 0x110c 001108 0101 MOVLB 0x1 00110a 6bb9 CLRF 0xb9,0x1 00110c 0e02 MOVLW 0x2 command = ((unsigned int)(cmd1) << 8) + cmd2; C:\Projects\UBW\FW\D_143\user\user.c 00110e cfdb MOVFF 0xfdb,0x2c 001110 f02c 001112 c02c MOVFF 0x2c,0x2d 001114 f02d 001116 6a2c CLRF 0x2c,0x0 001118 0e03 MOVLW 0x3 00111a 50db MOVF 0xdb,0x0,0x0 00111c 0100 MOVLB 0x0 00111e 242c ADDWF 0x2c,0x0,0x0 001120 6e2a MOVWF 0x2a,0x0 001122 0e00 MOVLW 0x0 001124 202d ADDWFC 0x2d,0x0,0x0 001126 6e2b MOVWF 0x2b,0x0 001128 c02a MOVFF 0x2a,0xfde 00112a ffde 00112c c02b MOVFF 0x2b,0xfdd 00112e ffdd } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now 'command' is equal to one or two bytes of our command C:\Projects\UBW\FW\D_143\user\user.c 001130 0e00 MOVLW 0x0 switch (command) C:\Projects\UBW\FW\D_143\user\user.c 001132 cfdb MOVFF 0xfdb,0x1e 001134 f01e 001136 0e01 MOVLW 0x1 001138 cfdb MOVFF 0xfdb,0x1f 00113a f01f 00113c 0e49 MOVLW 0x49 00113e 181e XORWF 0x1e,0x0,0x0 001140 e102 BNZ 0x1146 001142 0e43 MOVLW 0x43 001144 181f XORWF 0x1f,0x0,0x0 001146 e101 BNZ 0x114a 001148 d0d7 BRA 0x12f8 00114a 0e49 MOVLW 0x49 00114c 181e XORWF 0x1e,0x0,0x0 00114e e102 BNZ 0x1154 001150 0e52 MOVLW 0x52 001152 181f XORWF 0x1f,0x0,0x0 001154 e101 BNZ 0x1158 001156 d0cd BRA 0x12f2 001158 0e49 MOVLW 0x49 00115a 181e XORWF 0x1e,0x0,0x0 00115c e102 BNZ 0x1162 00115e 0e53 MOVLW 0x53 001160 181f XORWF 0x1f,0x0,0x0 001162 e101 BNZ 0x1166 001164 d0c3 BRA 0x12ec 001166 0e53 MOVLW 0x53 001168 181e XORWF 0x1e,0x0,0x0 00116a e102 BNZ 0x1170 00116c 0e43 MOVLW 0x43 00116e 181f XORWF 0x1f,0x0,0x0 001170 e101 BNZ 0x1174 001172 d0b9 BRA 0x12e6 001174 0e53 MOVLW 0x53 001176 181e XORWF 0x1e,0x0,0x0 001178 e102 BNZ 0x117e 00117a 0e52 MOVLW 0x52 00117c 181f XORWF 0x1f,0x0,0x0 00117e e101 BNZ 0x1182 001180 d0af BRA 0x12e0 001182 0e53 MOVLW 0x53 001184 181e XORWF 0x1e,0x0,0x0 001186 e102 BNZ 0x118c 001188 0e53 MOVLW 0x53 00118a 181f XORWF 0x1f,0x0,0x0 00118c e101 BNZ 0x1190 00118e d0a5 BRA 0x12da 001190 0e53 MOVLW 0x53 001192 181e XORWF 0x1e,0x0,0x0 001194 e102 BNZ 0x119a 001196 0e42 MOVLW 0x42 001198 181f XORWF 0x1f,0x0,0x0 00119a e101 BNZ 0x119e 00119c d09b BRA 0x12d4 00119e 0e43 MOVLW 0x43 0011a0 181e XORWF 0x1e,0x0,0x0 0011a2 e102 BNZ 0x11a8 0011a4 0e42 MOVLW 0x42 0011a6 181f XORWF 0x1f,0x0,0x0 0011a8 e101 BNZ 0x11ac 0011aa d091 BRA 0x12ce 0011ac 0e43 MOVLW 0x43 0011ae 181e XORWF 0x1e,0x0,0x0 0011b0 e102 BNZ 0x11b6 0011b2 0e52 MOVLW 0x52 0011b4 181f XORWF 0x1f,0x0,0x0 0011b6 e101 BNZ 0x11ba 0011b8 d087 BRA 0x12c8 0011ba 0e4f MOVLW 0x4f 0011bc 181e XORWF 0x1e,0x0,0x0 0011be e102 BNZ 0x11c4 0011c0 0e42 MOVLW 0x42 0011c2 181f XORWF 0x1f,0x0,0x0 0011c4 e101 BNZ 0x11c8 0011c6 d07d BRA 0x12c2 0011c8 0e57 MOVLW 0x57 0011ca 181e XORWF 0x1e,0x0,0x0 0011cc e102 BNZ 0x11d2 0011ce 0e4d MOVLW 0x4d 0011d0 181f XORWF 0x1f,0x0,0x0 0011d2 e075 BZ 0x12be 0011d4 0e52 MOVLW 0x52 0011d6 181e XORWF 0x1e,0x0,0x0 0011d8 e102 BNZ 0x11de 0011da 0e4d MOVLW 0x4d 0011dc 181f XORWF 0x1f,0x0,0x0 0011de e06d BZ 0x12ba 0011e0 0e44 MOVLW 0x44 0011e2 181e XORWF 0x1e,0x0,0x0 0011e4 e102 BNZ 0x11ea 0011e6 0e50 MOVLW 0x50 0011e8 181f XORWF 0x1f,0x0,0x0 0011ea e065 BZ 0x12b6 0011ec 0e4f MOVLW 0x4f 0011ee 181e XORWF 0x1e,0x0,0x0 0011f0 e102 BNZ 0x11f6 0011f2 0e50 MOVLW 0x50 0011f4 181f XORWF 0x1f,0x0,0x0 0011f6 e05d BZ 0x12b2 0011f8 0e49 MOVLW 0x49 0011fa 181e XORWF 0x1e,0x0,0x0 0011fc e102 BNZ 0x1202 0011fe 0e50 MOVLW 0x50 001200 181f XORWF 0x1f,0x0,0x0 001202 e055 BZ 0x12ae 001204 0e58 MOVLW 0x58 001206 181e XORWF 0x1e,0x0,0x0 001208 e102 BNZ 0x120e 00120a 0e54 MOVLW 0x54 00120c 181f XORWF 0x1f,0x0,0x0 00120e e04c BZ 0x12a8 001210 0e54 MOVLW 0x54 001212 181e XORWF 0x1e,0x0,0x0 001214 e101 BNZ 0x1218 001216 501f MOVF 0x1f,0x0,0x0 001218 e045 BZ 0x12a4 00121a 0e41 MOVLW 0x41 00121c 181e XORWF 0x1e,0x0,0x0 00121e e101 BNZ 0x1222 001220 501f MOVF 0x1f,0x0,0x0 001222 e03e BZ 0x12a0 001224 0e56 MOVLW 0x56 001226 181e XORWF 0x1e,0x0,0x0 001228 e101 BNZ 0x122c 00122a 501f MOVF 0x1f,0x0,0x0 00122c e037 BZ 0x129c 00122e 0e49 MOVLW 0x49 001230 181e XORWF 0x1e,0x0,0x0 001232 e101 BNZ 0x1236 001234 501f MOVF 0x1f,0x0,0x0 001236 e030 BZ 0x1298 001238 0e4f MOVLW 0x4f 00123a 181e XORWF 0x1e,0x0,0x0 00123c e101 BNZ 0x1240 00123e 501f MOVF 0x1f,0x0,0x0 001240 e029 BZ 0x1294 001242 0e55 MOVLW 0x55 001244 181e XORWF 0x1e,0x0,0x0 001246 e102 BNZ 0x124c 001248 0e43 MOVLW 0x43 00124a 181f XORWF 0x1f,0x0,0x0 00124c e021 BZ 0x1290 00124e 0e58 MOVLW 0x58 001250 181e XORWF 0x1e,0x0,0x0 001252 e102 BNZ 0x1258 001254 0e43 MOVLW 0x43 001256 181f XORWF 0x1f,0x0,0x0 001258 e018 BZ 0x128a 00125a 0e43 MOVLW 0x43 00125c 181e XORWF 0x1e,0x0,0x0 00125e e101 BNZ 0x1262 001260 501f MOVF 0x1f,0x0,0x0 001262 e011 BZ 0x1286 001264 0e52 MOVLW 0x52 001266 181e XORWF 0x1e,0x0,0x0 001268 e101 BNZ 0x126c 00126a 501f MOVF 0x1f,0x0,0x0 00126c e00a BZ 0x1282 00126e 0e58 MOVLW 0x58 001270 181e XORWF 0x1e,0x0,0x0 001272 e102 BNZ 0x1278 001274 0e52 MOVLW 0x52 001276 181f XORWF 0x1f,0x0,0x0 001278 e001 BZ 0x127c 00127a d041 BRA 0x12fe { C:\Projects\UBW\FW\D_143\user\user.c case ('R' * 256) + 'X': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // For receiving serial C:\Projects\UBW\FW\D_143\user\user.c 00127c ecc4 CALL 0x1b88,0x0 parse_RX_packet (); C:\Projects\UBW\FW\D_143\user\user.c 00127e f00d 001280 d07d BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'R': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Reset command (resets everything to power-on state) C:\Projects\UBW\FW\D_143\user\user.c 001282 d8b3 RCALL 0x13ea parse_R_packet (); C:\Projects\UBW\FW\D_143\user\user.c 001284 d07b BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'C': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Configure command (configure ports for Input or Ouptut) C:\Projects\UBW\FW\D_143\user\user.c 001286 d936 RCALL 0x14f4 parse_C_packet (); C:\Projects\UBW\FW\D_143\user\user.c 001288 d079 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('C' * 256) + 'X': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // For configuring serial port C:\Projects\UBW\FW\D_143\user\user.c 00128a ecc6 CALL 0x1b8c,0x0 parse_CX_packet (); C:\Projects\UBW\FW\D_143\user\user.c 00128c f00d 00128e d076 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('C' * 256) + 'U': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // For configuring UBW C:\Projects\UBW\FW\D_143\user\user.c 001290 d8b0 RCALL 0x13f2 parse_CU_packet (); C:\Projects\UBW\FW\D_143\user\user.c 001292 d074 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'O': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Output command (tell the ports to output something) C:\Projects\UBW\FW\D_143\user\user.c 001294 d98c RCALL 0x15ae parse_O_packet (); C:\Projects\UBW\FW\D_143\user\user.c 001296 d072 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'I': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Input command (return the current status of the ports) C:\Projects\UBW\FW\D_143\user\user.c 001298 d9bd RCALL 0x1614 parse_I_packet (); C:\Projects\UBW\FW\D_143\user\user.c 00129a d070 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'V': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Version command C:\Projects\UBW\FW\D_143\user\user.c 00129c d9d6 RCALL 0x164a parse_V_packet (); C:\Projects\UBW\FW\D_143\user\user.c 00129e d06e BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'A': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Analog command C:\Projects\UBW\FW\D_143\user\user.c 0012a0 d9e5 RCALL 0x166c parse_A_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012a2 d06c BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case 'T': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // For timed I/O C:\Projects\UBW\FW\D_143\user\user.c 0012a4 d8e6 RCALL 0x1472 parse_T_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012a6 d06a BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('T' * 256) + 'X': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // For transmitting serial C:\Projects\UBW\FW\D_143\user\user.c 0012a8 ecc2 CALL 0x1b84,0x0 parse_TX_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012aa f00d 0012ac d067 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('P' * 256) + 'I': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // PI for reading a single pin C:\Projects\UBW\FW\D_143\user\user.c 0012ae db51 RCALL 0x1952 parse_PI_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012b0 d065 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('P' * 256) + 'O': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // PO for setting a single pin C:\Projects\UBW\FW\D_143\user\user.c 0012b2 dbcf RCALL 0x1a52 parse_PO_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012b4 d063 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c case ('P' * 256) + 'D': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // PD for setting a pin's direction C:\Projects\UBW\FW\D_143\user\user.c 0012b6 dab1 RCALL 0x181a parse_PD_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012b8 d061 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('M' * 256) + 'R': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // MR for Memory Read C:\Projects\UBW\FW\D_143\user\user.c 0012ba da6e RCALL 0x1798 parse_MR_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012bc d05f BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('M' * 256) + 'W': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // MW for Memory Write C:\Projects\UBW\FW\D_143\user\user.c 0012be da37 RCALL 0x172e parse_MW_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012c0 d05d BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('B' * 256) + 'O': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // MR for Fast Parallel Output C:\Projects\UBW\FW\D_143\user\user.c 0012c2 ecb4 CALL 0x1d68,0x0 parse_BO_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012c4 f00e 0012c6 d05a BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('R' * 256) + 'C': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // RC for RC servo output C:\Projects\UBW\FW\D_143\user\user.c 0012c8 ecc8 CALL 0x1b90,0x0 parse_RC_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012ca f00d 0012cc d057 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('B' * 256) + 'C': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // BC for Fast Parallel Configure C:\Projects\UBW\FW\D_143\user\user.c 0012ce ec6d CALL 0x1cda,0x0 parse_BC_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012d0 f00e 0012d2 d054 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('B' * 256) + 'S': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // BS for Fast Binary Stream output C:\Projects\UBW\FW\D_143\user\user.c 0012d4 ecfb CALL 0x1ff6,0x0 parse_BS_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012d6 f00f 0012d8 d051 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('S' * 256) + 'S': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // SS for Send SPI C:\Projects\UBW\FW\D_143\user\user.c 0012da ecb7 CALL 0x216e,0x0 parse_SS_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012dc f010 0012de d04e BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('R' * 256) + 'S': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // RS for Receive SPI C:\Projects\UBW\FW\D_143\user\user.c 0012e0 ecba CALL 0x2174,0x0 parse_RS_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012e2 f010 0012e4 d04b BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('C' * 256) + 'S': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // CS for Configure SPI C:\Projects\UBW\FW\D_143\user\user.c 0012e6 ecbd CALL 0x217a,0x0 parse_CS_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012e8 f010 0012ea d048 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('S' * 256) + 'I': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // SI for Send I2C C:\Projects\UBW\FW\D_143\user\user.c 0012ec ecc0 CALL 0x2180,0x0 parse_SI_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012ee f010 0012f0 d045 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('R' * 256) + 'I': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // RI for Receive I2C C:\Projects\UBW\FW\D_143\user\user.c 0012f2 ecc3 CALL 0x2186,0x0 parse_RI_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012f4 f010 0012f6 d042 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c case ('C' * 256) + 'I': C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // CI for Configure I2C C:\Projects\UBW\FW\D_143\user\user.c 0012f8 ecc6 CALL 0x218c,0x0 parse_CI_packet (); C:\Projects\UBW\FW\D_143\user\user.c 0012fa f010 0012fc d03f BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c default: C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0012fe 0e03 MOVLW 0x3 if (0 == cmd2) C:\Projects\UBW\FW\D_143\user\user.c 001300 50db MOVF 0xdb,0x0,0x0 001302 e11a BNZ 0x1338 { C:\Projects\UBW\FW\D_143\user\user.c // Send back 'unknown command' error C:\Projects\UBW\FW\D_143\user\user.c printf ( C:\Projects\UBW\FW\D_143\user\user.c (far rom char *)"!8 Err: Unknown command '%c:%2X'\r\n" C:\Projects\UBW\FW\D_143\user\user.c 001314 0ea5 MOVLW 0xa5 ,cmd1 C:\Projects\UBW\FW\D_143\user\user.c 001316 6e2a MOVWF 0x2a,0x0 001318 0e3f MOVLW 0x3f 00131a 6e2b MOVWF 0x2b,0x0 00131c 6a2c CLRF 0x2c,0x0 00131e c02a MOVFF 0x2a,0xfe6 001320 ffe6 001322 c02b MOVFF 0x2b,0xfe6 001324 ffe6 001326 c02c MOVFF 0x2c,0xfe6 001328 ffe6 00130c 0e02 MOVLW 0x2 ,cmd1 C:\Projects\UBW\FW\D_143\user\user.c 00130e cfdb MOVFF 0xfdb,0xfe6 001310 ffe6 001312 6ae6 CLRF 0xe6,0x0 001304 0e02 MOVLW 0x2 ); C:\Projects\UBW\FW\D_143\user\user.c 001306 cfdb MOVFF 0xfdb,0xfe6 001308 ffe6 00130a 6ae6 CLRF 0xe6,0x0 00132a ec5f CALL 0x42be,0x0 00132c f021 00132e 6e2d MOVWF 0x2d,0x0 001330 0e07 MOVLW 0x7 001332 5ee1 SUBWF 0xe1,0x1,0x0 001334 502d MOVF 0x2d,0x0,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001336 d021 BRA 0x137a else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Send back 'unknown command' error C:\Projects\UBW\FW\D_143\user\user.c printf ( C:\Projects\UBW\FW\D_143\user\user.c (far rom char *)"!8 Err: Unknown command '%c%c:%2X%2X'\r\n" C:\Projects\UBW\FW\D_143\user\user.c 001358 0e7d MOVLW 0x7d ,cmd1 C:\Projects\UBW\FW\D_143\user\user.c 00135a 6e2a MOVWF 0x2a,0x0 00135c 0e3f MOVLW 0x3f 00135e 6e2b MOVWF 0x2b,0x0 001360 6a2c CLRF 0x2c,0x0 001362 c02a MOVFF 0x2a,0xfe6 001364 ffe6 001366 c02b MOVFF 0x2b,0xfe6 001368 ffe6 00136a c02c MOVFF 0x2c,0xfe6 00136c ffe6 001350 0e02 MOVLW 0x2 ,cmd2 C:\Projects\UBW\FW\D_143\user\user.c 001352 cfdb MOVFF 0xfdb,0xfe6 001354 ffe6 001356 6ae6 CLRF 0xe6,0x0 001348 0e03 MOVLW 0x3 ,cmd1 C:\Projects\UBW\FW\D_143\user\user.c 00134a cfdb MOVFF 0xfdb,0xfe6 00134c ffe6 00134e 6ae6 CLRF 0xe6,0x0 001340 0e02 MOVLW 0x2 ,cmd2 C:\Projects\UBW\FW\D_143\user\user.c 001342 cfdb MOVFF 0xfdb,0xfe6 001344 ffe6 001346 6ae6 CLRF 0xe6,0x0 001338 0e03 MOVLW 0x3 ); C:\Projects\UBW\FW\D_143\user\user.c 00133a cfdb MOVFF 0xfdb,0xfe6 00133c ffe6 00133e 6ae6 CLRF 0xe6,0x0 00136e ec5f CALL 0x42be,0x0 001370 f021 001372 6e2d MOVWF 0x2d,0x0 001374 0e0b MOVLW 0xb 001376 5ee1 SUBWF 0xe1,0x1,0x0 001378 502d MOVF 0x2d,0x0,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 00137a d000 BRA 0x137c break; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Double check that our output pointer is now at the ending C:\Projects\UBW\FW\D_143\user\user.c // If it is not, this indicates that there were extra characters that C:\Projects\UBW\FW\D_143\user\user.c // the command parsing routine didn't eat. This would be an error and needs C:\Projects\UBW\FW\D_143\user\user.c // to be reported. (Ignore for Reset command because FIFO pointers get cleared.) C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 00137c 0101 MOVLB 0x1 (g_RX_buf[g_RX_buf_out] != kCR && 0 == error_byte) C:\Projects\UBW\FW\D_143\user\user.c 00137e 51b9 MOVF 0xb9,0x0,0x1 001380 6aea CLRF 0xea,0x0 001382 0f40 ADDLW 0x40 001384 6ee9 MOVWF 0xe9,0x0 001386 0e02 MOVLW 0x2 001388 22ea ADDWFC 0xea,0x1,0x0 00138a 50ef MOVF 0xef,0x0,0x0 00138c 080d SUBLW 0xd 00138e e00d BZ 0x13aa 001390 500d MOVF 0xd,0x0,0x0 001392 e10b BNZ 0x13aa && C:\Projects\UBW\FW\D_143\user\user.c 001394 0e52 MOVLW 0x52 ('R' != command) C:\Projects\UBW\FW\D_143\user\user.c 001396 6e2a MOVWF 0x2a,0x0 001398 6a2b CLRF 0x2b,0x0 00139a 50df MOVF 0xdf,0x0,0x0 00139c 182a XORWF 0x2a,0x0,0x0 00139e e103 BNZ 0x13a6 0013a0 52de MOVF 0xde,0x1,0x0 0013a2 50dd MOVF 0xdd,0x0,0x0 0013a4 182b XORWF 0x2b,0x0,0x0 0013a6 e001 BZ 0x13aa ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0013a8 8e0d BSF 0xd,0x7,0x0 bitset (error_byte, kERROR_BYTE_EXTRA_CHARACTERS); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Clean up by skipping over any bytes we haven't eaten C:\Projects\UBW\FW\D_143\user\user.c // This is safe since we parse each packet as we get a C:\Projects\UBW\FW\D_143\user\user.c // (i.e. g_RX_buf_in doesn't move while we are in this routine) C:\Projects\UBW\FW\D_143\user\user.c 0013aa c1b8 MOVFF 0x1b8,0x1b9 g_RX_buf_out = g_RX_buf_in; C:\Projects\UBW\FW\D_143\user\user.c 0013ac f1b9 0013ae 0e04 MOVLW 0x4 } C:\Projects\UBW\FW\D_143\user\user.c 0013b0 5ce1 SUBWF 0xe1,0x0,0x0 0013b2 e202 BC 0x13b8 0013b4 6ae1 CLRF 0xe1,0x0 0013b6 52e5 MOVF 0xe5,0x1,0x0 0013b8 6ee1 MOVWF 0xe1,0x0 0013ba 52e5 MOVF 0xe5,0x1,0x0 0013bc cfe7 MOVFF 0xfe7,0xfd9 0013be ffd9 0013c0 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Print out the positive acknoledgement that the packet was received C:\Projects\UBW\FW\D_143\user\user.c // if we have acks turned on. C:\Projects\UBW\FW\D_143\user\user.c void print_ack(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0013c2 0101 MOVLB 0x1 if (g_ack_enable) C:\Projects\UBW\FW\D_143\user\user.c 0013c4 51be MOVF 0xbe,0x0,0x1 0013c6 e010 BZ 0x13e8 { C:\Projects\UBW\FW\D_143\user\user.c 0013c8 0e7c MOVLW 0x7c printf ((far rom char *)st_OK); C:\Projects\UBW\FW\D_143\user\user.c 0013ca 6e2a MOVWF 0x2a,0x0 0013cc 0e45 MOVLW 0x45 0013ce 6e2b MOVWF 0x2b,0x0 0013d0 6a2c CLRF 0x2c,0x0 0013d2 c02a MOVFF 0x2a,0xfe6 0013d4 ffe6 0013d6 c02b MOVFF 0x2b,0xfe6 0013d8 ffe6 0013da c02c MOVFF 0x2c,0xfe6 0013dc ffe6 0013de ec5f CALL 0x42be,0x0 0013e0 f021 0013e2 52e5 MOVF 0xe5,0x1,0x0 0013e4 52e5 MOVF 0xe5,0x1,0x0 0013e6 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0013e8 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Return all I/Os to their default power-on values C:\Projects\UBW\FW\D_143\user\user.c void parse_R_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0013ea ecc4 CALL 0xb88,0x0 UserInit (); C:\Projects\UBW\FW\D_143\user\user.c 0013ec f005 0013ee dfe9 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 0013f0 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // CU is "Configure UBW" and controls system-wide configruation values C:\Projects\UBW\FW\D_143\user\user.c // "CU,," C:\Projects\UBW\FW\D_143\user\user.c // C:\Projects\UBW\FW\D_143\user\user.c // 1 {1|0} turns on or off the 'ack' ("OK" at end of packets) C:\Projects\UBW\FW\D_143\user\user.c 0013f2 cfd9 MOVFF 0xfd9,0xfe6 void parse_CU_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 0013f4 ffe6 0013f6 cfe1 MOVFF 0xfe1,0xfd9 0013f8 ffd9 0013fa 0e03 MOVLW 0x3 0013fc 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char parameter_number; C:\Projects\UBW\FW\D_143\user\user.c signed int paramater_value; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0013fe 0e01 MOVLW 0x1 parameter_number = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001400 6ee6 MOVWF 0xe6,0x0 001402 ecc9 CALL 0x2192,0x0 001404 f010 001406 52e5 MOVF 0xe5,0x1,0x0 001408 501d MOVF 0x1d,0x0,0x0 00140a 6edf MOVWF 0xdf,0x0 00140c 0e02 MOVLW 0x2 paramater_value = extract_number (kINT); C:\Projects\UBW\FW\D_143\user\user.c 00140e 6ee6 MOVWF 0xe6,0x0 001410 ecc9 CALL 0x2192,0x0 001412 f010 001414 52e5 MOVF 0xe5,0x1,0x0 001416 52de MOVF 0xde,0x1,0x0 001418 c01d MOVFF 0x1d,0xfde 00141a ffde 00141c c01e MOVFF 0x1e,0xfdd 00141e ffdd 001420 52dd MOVF 0xdd,0x1,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001422 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001424 e001 BZ 0x1428 { C:\Projects\UBW\FW\D_143\user\user.c 001426 d01b BRA 0x145e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001428 04df DECF 0xdf,0x0,0x0 if (1 == parameter_number) C:\Projects\UBW\FW\D_143\user\user.c 00142a e118 BNZ 0x145c { C:\Projects\UBW\FW\D_143\user\user.c 00142c 50d9 MOVF 0xd9,0x0,0x0 if (0 == paramater_value || 1 == paramater_value) C:\Projects\UBW\FW\D_143\user\user.c 00142e 0f01 ADDLW 0x1 001430 6ee9 MOVWF 0xe9,0x0 001432 cfda MOVFF 0xfda,0xfea 001434 ffea 001436 50ee MOVF 0xee,0x0,0x0 001438 10ed IORWF 0xed,0x0,0x0 00143a e00b BZ 0x1452 00143c 0e01 MOVLW 0x1 00143e 6e2a MOVWF 0x2a,0x0 001440 6a2b CLRF 0x2b,0x0 001442 0e01 MOVLW 0x1 001444 50db MOVF 0xdb,0x0,0x0 001446 182a XORWF 0x2a,0x0,0x0 001448 e103 BNZ 0x1450 00144a 0e02 MOVLW 0x2 00144c 50db MOVF 0xdb,0x0,0x0 00144e 182b XORWF 0x2b,0x0,0x0 001450 e104 BNZ 0x145a { C:\Projects\UBW\FW\D_143\user\user.c 001452 0e01 MOVLW 0x1 g_ack_enable = paramater_value; C:\Projects\UBW\FW\D_143\user\user.c 001454 cfdb MOVFF 0xfdb,0x1be 001456 f1be } C:\Projects\UBW\FW\D_143\user\user.c 001458 d001 BRA 0x145c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00145a 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 00145c dfb2 RCALL 0x13c2 print_ack(); C:\Projects\UBW\FW\D_143\user\user.c 00145e 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001460 5ce1 SUBWF 0xe1,0x0,0x0 001462 e202 BC 0x1468 001464 6ae1 CLRF 0xe1,0x0 001466 52e5 MOVF 0xe5,0x1,0x0 001468 6ee1 MOVWF 0xe1,0x0 00146a 52e5 MOVF 0xe5,0x1,0x0 00146c cfe7 MOVFF 0xfe7,0xfd9 00146e ffd9 001470 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // "T" Packet C:\Projects\UBW\FW\D_143\user\user.c // Causes PIC to sample digital or analog inputs at a regular interval and send C:\Projects\UBW\FW\D_143\user\user.c // I (or A) packets back at that interval. C:\Projects\UBW\FW\D_143\user\user.c // Send T,0,0 to stop I (or A) packets C:\Projects\UBW\FW\D_143\user\user.c // FORMAT: T,, C:\Projects\UBW\FW\D_143\user\user.c // is 0 for digital (I packets) and 1 for analog (A packets) C:\Projects\UBW\FW\D_143\user\user.c // EXAMPLE: "T,4000,0" to send an I packet back every 4 seconds. C:\Projects\UBW\FW\D_143\user\user.c // EXAMPLE: "T,2000,1" to send an A packet back every 2 seconds. C:\Projects\UBW\FW\D_143\user\user.c 001472 cfd9 MOVFF 0xfd9,0xfe6 void parse_T_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001474 ffe6 001476 cfe1 MOVFF 0xfe1,0xfd9 001478 ffd9 00147a 0e03 MOVLW 0x3 00147c 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned int value; C:\Projects\UBW\FW\D_143\user\user.c 00147e 0e02 MOVLW 0x2 unsigned char mode = 0; C:\Projects\UBW\FW\D_143\user\user.c 001480 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Extract the value C:\Projects\UBW\FW\D_143\user\user.c 001482 0e03 MOVLW 0x3 time_between_updates = extract_number (kUINT); C:\Projects\UBW\FW\D_143\user\user.c 001484 6ee6 MOVWF 0xe6,0x0 001486 ecc9 CALL 0x2192,0x0 001488 f010 00148a 52e5 MOVF 0xe5,0x1,0x0 00148c c01d MOVFF 0x1d,0x0 00148e f000 001490 c01e MOVFF 0x1e,0x1 001492 f001 // Extract the value C:\Projects\UBW\FW\D_143\user\user.c 001494 0e01 MOVLW 0x1 mode = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001496 6ee6 MOVWF 0xe6,0x0 001498 ecc9 CALL 0x2192,0x0 00149a f010 00149c 52e5 MOVF 0xe5,0x1,0x0 00149e 0e02 MOVLW 0x2 0014a0 c01d MOVFF 0x1d,0xfdb 0014a2 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 0014a4 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 0014a6 e001 BZ 0x14aa { C:\Projects\UBW\FW\D_143\user\user.c 0014a8 d01b BRA 0x14e0 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now start up the timer at the right rate or shut C:\Projects\UBW\FW\D_143\user\user.c // it down. C:\Projects\UBW\FW\D_143\user\user.c 0014aa 0e02 MOVLW 0x2 if (0 == mode) C:\Projects\UBW\FW\D_143\user\user.c 0014ac 50db MOVF 0xdb,0x0,0x0 0014ae e10c BNZ 0x14c8 { C:\Projects\UBW\FW\D_143\user\user.c 0014b0 5000 MOVF 0x0,0x0,0x0 if (0 == time_between_updates) C:\Projects\UBW\FW\D_143\user\user.c 0014b2 1001 IORWF 0x1,0x0,0x0 0014b4 e103 BNZ 0x14bc { C:\Projects\UBW\FW\D_143\user\user.c // Turn off sending of I packets. C:\Projects\UBW\FW\D_143\user\user.c 0014b6 6a02 CLRF 0x2,0x0 ISR_D_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 0014b8 6a03 CLRF 0x3,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0014ba d005 BRA 0x14c6 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0014bc 84ca BSF 0xca,0x2,0x0 T2CONbits.TMR2ON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Eventually gaurd this section from interrupts C:\Projects\UBW\FW\D_143\user\user.c 0014be c000 MOVFF 0x0,0x2 ISR_D_RepeatRate = time_between_updates; C:\Projects\UBW\FW\D_143\user\user.c 0014c0 f002 0014c2 c001 MOVFF 0x1,0x3 0014c4 f003 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0014c6 d00b BRA 0x14de else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0014c8 5000 MOVF 0x0,0x0,0x0 if (0 == time_between_updates) C:\Projects\UBW\FW\D_143\user\user.c 0014ca 1001 IORWF 0x1,0x0,0x0 0014cc e103 BNZ 0x14d4 { C:\Projects\UBW\FW\D_143\user\user.c // Turn off sending of A packets. C:\Projects\UBW\FW\D_143\user\user.c 0014ce 6a07 CLRF 0x7,0x0 ISR_A_RepeatRate = 0; C:\Projects\UBW\FW\D_143\user\user.c 0014d0 6a08 CLRF 0x8,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0014d2 d005 BRA 0x14de else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0014d4 84ca BSF 0xca,0x2,0x0 T2CONbits.TMR2ON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Eventually gaurd this section from interrupts C:\Projects\UBW\FW\D_143\user\user.c 0014d6 c000 MOVFF 0x0,0x7 ISR_A_RepeatRate = time_between_updates; C:\Projects\UBW\FW\D_143\user\user.c 0014d8 f007 0014da c001 MOVFF 0x1,0x8 0014dc f008 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0014de df71 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 0014e0 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 0014e2 5ce1 SUBWF 0xe1,0x0,0x0 0014e4 e202 BC 0x14ea 0014e6 6ae1 CLRF 0xe1,0x0 0014e8 52e5 MOVF 0xe5,0x1,0x0 0014ea 6ee1 MOVWF 0xe1,0x0 0014ec 52e5 MOVF 0xe5,0x1,0x0 0014ee cfe7 MOVFF 0xfe7,0xfd9 0014f0 ffd9 0014f2 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // FORMAT: C,,,, C:\Projects\UBW\FW\D_143\user\user.c // EXAMPLE: "C,255,0,4,0" C:\Projects\UBW\FW\D_143\user\user.c // is the byte sent to the Data Direction (DDR) regsiter for C:\Projects\UBW\FW\D_143\user\user.c // each port. A 1 in a bit location means input, a 0 means output. C:\Projects\UBW\FW\D_143\user\user.c // is a value between 0 and 12. It tells the UBW C:\Projects\UBW\FW\D_143\user\user.c // how many analog inputs to enable. If a zero is sent for this C:\Projects\UBW\FW\D_143\user\user.c // parameter, all analog inputs are disabled. C:\Projects\UBW\FW\D_143\user\user.c // For the other values, see the following chart to know what pins are C:\Projects\UBW\FW\D_143\user\user.c // used for what: C:\Projects\UBW\FW\D_143\user\user.c // C:\Projects\UBW\FW\D_143\user\user.c // Note that in the following chart, PortE is references. This port C:\Projects\UBW\FW\D_143\user\user.c // only exists on the 40 and 44 pin versions of the UBW. For the C:\Projects\UBW\FW\D_143\user\user.c // 28 pin versions of the UBW, all PortE based analog pins will return C:\Projects\UBW\FW\D_143\user\user.c // zero. C:\Projects\UBW\FW\D_143\user\user.c // C:\Projects\UBW\FW\D_143\user\user.c // Analog Inputs Enabled Pins Used For Analog Inputs C:\Projects\UBW\FW\D_143\user\user.c // --------------- --------------------- ------------------------------- C:\Projects\UBW\FW\D_143\user\user.c // 0 C:\Projects\UBW\FW\D_143\user\user.c // 1 AN0 A0 C:\Projects\UBW\FW\D_143\user\user.c // 2 AN0,AN1 A0,A1 C:\Projects\UBW\FW\D_143\user\user.c // 3 AN0,AN1,AN2 A0,A1,A2 C:\Projects\UBW\FW\D_143\user\user.c // 4 AN0,AN1,AN2,AN3 A0,A1,A2,A3 C:\Projects\UBW\FW\D_143\user\user.c // 5 AN0,AN1,AN2,AN3,AN4 A0,A1,A2,A3,A5 C:\Projects\UBW\FW\D_143\user\user.c // 6 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0 C:\Projects\UBW\FW\D_143\user\user.c // AN5 C:\Projects\UBW\FW\D_143\user\user.c // 7 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6 C:\Projects\UBW\FW\D_143\user\user.c // 8 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1,E2 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6,AN7 C:\Projects\UBW\FW\D_143\user\user.c // 9 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1,E2,B2 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6,AN7,AN8 C:\Projects\UBW\FW\D_143\user\user.c // 10 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1,E2,B2,B3 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6,AN7,AN8, C:\Projects\UBW\FW\D_143\user\user.c // AN9 C:\Projects\UBW\FW\D_143\user\user.c // 11 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1,E2,B2,B3,B1 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6,AN7,AN8, C:\Projects\UBW\FW\D_143\user\user.c // AB9,AN10 C:\Projects\UBW\FW\D_143\user\user.c // 12 AN0,AN1,AN2,AN3,AN4, A0,A1,A2,A3,A5,E0,E1,E2,B2,B3,B1,B4 C:\Projects\UBW\FW\D_143\user\user.c // AN5,AN6,AN7,AN8, C:\Projects\UBW\FW\D_143\user\user.c // AN9,AN10,AN11 C:\Projects\UBW\FW\D_143\user\user.c // NOTE: it is up to the user to tell the proper port direction bits to be C:\Projects\UBW\FW\D_143\user\user.c // inputs for the analog channels they wish to use. C:\Projects\UBW\FW\D_143\user\user.c 0014f4 cfd9 MOVFF 0xfd9,0xfe6 void parse_C_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 0014f6 ffe6 0014f8 cfe1 MOVFF 0xfe1,0xfd9 0014fa ffd9 0014fc 0e04 MOVLW 0x4 0014fe 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char PA, PB, PC, AA; C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c unsigned char PD, PE; C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Extract each of the four values. C:\Projects\UBW\FW\D_143\user\user.c 001500 0e01 MOVLW 0x1 PA = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001502 6ee6 MOVWF 0xe6,0x0 001504 ecc9 CALL 0x2192,0x0 001506 f010 001508 52e5 MOVF 0xe5,0x1,0x0 00150a 501d MOVF 0x1d,0x0,0x0 00150c 6edf MOVWF 0xdf,0x0 00150e 0e01 MOVLW 0x1 PB = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001510 6ee6 MOVWF 0xe6,0x0 001512 ecc9 CALL 0x2192,0x0 001514 f010 001516 52e5 MOVF 0xe5,0x1,0x0 001518 0e01 MOVLW 0x1 00151a c01d MOVFF 0x1d,0xfdb 00151c ffdb 00151e 0e01 MOVLW 0x1 PC = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001520 6ee6 MOVWF 0xe6,0x0 001522 ecc9 CALL 0x2192,0x0 001524 f010 001526 52e5 MOVF 0xe5,0x1,0x0 001528 0e02 MOVLW 0x2 00152a c01d MOVFF 0x1d,0xfdb 00152c ffdb #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c PD = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c PE = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c 00152e 0e01 MOVLW 0x1 AA = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001530 6ee6 MOVWF 0xe6,0x0 001532 ecc9 CALL 0x2192,0x0 001534 f010 001536 52e5 MOVF 0xe5,0x1,0x0 001538 0e03 MOVLW 0x3 00153a c01d MOVFF 0x1d,0xfdb 00153c ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 00153e 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001540 e001 BZ 0x1544 { C:\Projects\UBW\FW\D_143\user\user.c 001542 d02b BRA 0x159a return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now write those values to the data direction registers. C:\Projects\UBW\FW\D_143\user\user.c 001544 50df MOVF 0xdf,0x0,0x0 TRISA = PA; C:\Projects\UBW\FW\D_143\user\user.c 001546 6e92 MOVWF 0x92,0x0 001548 0e01 MOVLW 0x1 TRISB = PB; C:\Projects\UBW\FW\D_143\user\user.c 00154a 50db MOVF 0xdb,0x0,0x0 00154c 6e93 MOVWF 0x93,0x0 00154e 0e02 MOVLW 0x2 TRISC = PC; C:\Projects\UBW\FW\D_143\user\user.c 001550 50db MOVF 0xdb,0x0,0x0 001552 6e94 MOVWF 0x94,0x0 #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c TRISD = PD; C:\Projects\UBW\FW\D_143\user\user.c TRISE = PE; C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Handle the analog value. C:\Projects\UBW\FW\D_143\user\user.c // Maximum value of 12. C:\Projects\UBW\FW\D_143\user\user.c 001554 0e03 MOVLW 0x3 if (AA > 12) C:\Projects\UBW\FW\D_143\user\user.c 001556 50db MOVF 0xdb,0x0,0x0 001558 080c SUBLW 0xc 00155a e205 BC 0x1566 { C:\Projects\UBW\FW\D_143\user\user.c 00155c 0e0c MOVLW 0xc AA = 12; C:\Projects\UBW\FW\D_143\user\user.c 00155e 6ef3 MOVWF 0xf3,0x0 001560 0e03 MOVLW 0x3 001562 cff3 MOVFF 0xff3,0xfdb 001564 ffdb } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // If we are turning off Analog inputs C:\Projects\UBW\FW\D_143\user\user.c 001566 0e03 MOVLW 0x3 if (0 == AA) C:\Projects\UBW\FW\D_143\user\user.c 001568 50db MOVF 0xdb,0x0,0x0 00156a e105 BNZ 0x1576 { C:\Projects\UBW\FW\D_143\user\user.c // Turn all analog inputs into digital inputs C:\Projects\UBW\FW\D_143\user\user.c 00156c 0e0f MOVLW 0xf ADCON1 = 0x0F; C:\Projects\UBW\FW\D_143\user\user.c 00156e 6ec1 MOVWF 0xc1,0x0 // Turn off the ADC C:\Projects\UBW\FW\D_143\user\user.c 001570 90c2 BCF 0xc2,0x0,0x0 ADCON0bits.ADON = 0; C:\Projects\UBW\FW\D_143\user\user.c // Turn off our own idea of how many analog channels to convert C:\Projects\UBW\FW\D_143\user\user.c 001572 6a0c CLRF 0xc,0x0 AnalogEnable = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001574 d011 BRA 0x1598 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Some protection from ISR C:\Projects\UBW\FW\D_143\user\user.c 001576 6a0c CLRF 0xc,0x0 AnalogEnable = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // We're turning some on. C:\Projects\UBW\FW\D_143\user\user.c // Start by selecting channel zero C:\Projects\UBW\FW\D_143\user\user.c 001578 6ac2 CLRF 0xc2,0x0 ADCON0 = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Then enabling the proper number of channels C:\Projects\UBW\FW\D_143\user\user.c 00157a 0e03 MOVLW 0x3 ADCON1 = 15 - AA; C:\Projects\UBW\FW\D_143\user\user.c 00157c cfdb MOVFF 0xfdb,0xfe6 00157e ffe6 001580 0e0f MOVLW 0xf 001582 52e5 MOVF 0xe5,0x1,0x0 001584 80d8 BSF 0xd8,0x0,0x0 001586 54e7 SUBFWB 0xe7,0x0,0x0 001588 6ec1 MOVWF 0xc1,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Set up ADCON2 options C:\Projects\UBW\FW\D_143\user\user.c // A/D Result right justified C:\Projects\UBW\FW\D_143\user\user.c // Acq time = 20 Tad (?) C:\Projects\UBW\FW\D_143\user\user.c // Tad = Fosc/64 C:\Projects\UBW\FW\D_143\user\user.c 00158a 0ebe MOVLW 0xbe ADCON2 = 0b10111110; C:\Projects\UBW\FW\D_143\user\user.c 00158c 6ec0 MOVWF 0xc0,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Turn on the ADC C:\Projects\UBW\FW\D_143\user\user.c 00158e 80c2 BSF 0xc2,0x0,0x0 ADCON0bits.ADON = 1; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Tell ourselves how many channels to convert, and turn on ISR conversions C:\Projects\UBW\FW\D_143\user\user.c 001590 0e03 MOVLW 0x3 AnalogEnable = AA; C:\Projects\UBW\FW\D_143\user\user.c 001592 50db MOVF 0xdb,0x0,0x0 001594 6e0c MOVWF 0xc,0x0 C:\Projects\UBW\FW\D_143\user\user.c 001596 84ca BSF 0xca,0x2,0x0 T2CONbits.TMR2ON = 1; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001598 df14 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 00159a 0e04 MOVLW 0x4 } C:\Projects\UBW\FW\D_143\user\user.c 00159c 5ce1 SUBWF 0xe1,0x0,0x0 00159e e202 BC 0x15a4 0015a0 6ae1 CLRF 0xe1,0x0 0015a2 52e5 MOVF 0xe5,0x1,0x0 0015a4 6ee1 MOVWF 0xe1,0x0 0015a6 52e5 MOVF 0xe5,0x1,0x0 0015a8 cfe7 MOVFF 0xfe7,0xfd9 0015aa ffd9 0015ac 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Outputs values to the ports pins that are set up as outputs. C:\Projects\UBW\FW\D_143\user\user.c // Example "O,121,224,002" C:\Projects\UBW\FW\D_143\user\user.c 0015ae cfd9 MOVFF 0xfd9,0xfe6 void parse_O_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 0015b0 ffe6 0015b2 cfe1 MOVFF 0xfe1,0xfd9 0015b4 ffd9 0015b6 0e03 MOVLW 0x3 0015b8 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char PA, PB, PC; C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c unsigned char PD, PE; C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Extract each of the values. C:\Projects\UBW\FW\D_143\user\user.c 0015ba 0e01 MOVLW 0x1 PA = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 0015bc 6ee6 MOVWF 0xe6,0x0 0015be ecc9 CALL 0x2192,0x0 0015c0 f010 0015c2 52e5 MOVF 0xe5,0x1,0x0 0015c4 501d MOVF 0x1d,0x0,0x0 0015c6 6edf MOVWF 0xdf,0x0 0015c8 0e01 MOVLW 0x1 PB = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 0015ca 6ee6 MOVWF 0xe6,0x0 0015cc ecc9 CALL 0x2192,0x0 0015ce f010 0015d0 52e5 MOVF 0xe5,0x1,0x0 0015d2 0e01 MOVLW 0x1 0015d4 c01d MOVFF 0x1d,0xfdb 0015d6 ffdb 0015d8 0e01 MOVLW 0x1 PC = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 0015da 6ee6 MOVWF 0xe6,0x0 0015dc ecc9 CALL 0x2192,0x0 0015de f010 0015e0 52e5 MOVF 0xe5,0x1,0x0 0015e2 0e02 MOVLW 0x2 0015e4 c01d MOVFF 0x1d,0xfdb 0015e6 ffdb #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c PD = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c PE = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 0015e8 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 0015ea e001 BZ 0x15ee { C:\Projects\UBW\FW\D_143\user\user.c 0015ec d009 BRA 0x1600 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c // Now write those values to the data port registers. C:\Projects\UBW\FW\D_143\user\user.c 0015ee 50df MOVF 0xdf,0x0,0x0 LATA = PA; C:\Projects\UBW\FW\D_143\user\user.c 0015f0 6e89 MOVWF 0x89,0x0 0015f2 0e01 MOVLW 0x1 LATB = PB; C:\Projects\UBW\FW\D_143\user\user.c 0015f4 50db MOVF 0xdb,0x0,0x0 0015f6 6e8a MOVWF 0x8a,0x0 0015f8 0e02 MOVLW 0x2 LATC = PC; C:\Projects\UBW\FW\D_143\user\user.c 0015fa 50db MOVF 0xdb,0x0,0x0 0015fc 6e8b MOVWF 0x8b,0x0 #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c LATD = PD; C:\Projects\UBW\FW\D_143\user\user.c LATE = PE; C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0015fe dee1 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001600 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001602 5ce1 SUBWF 0xe1,0x0,0x0 001604 e202 BC 0x160a 001606 6ae1 CLRF 0xe1,0x0 001608 52e5 MOVF 0xe5,0x1,0x0 00160a 6ee1 MOVWF 0xe1,0x0 00160c 52e5 MOVF 0xe5,0x1,0x0 00160e cfe7 MOVFF 0xfe7,0xfd9 001610 ffd9 001612 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Read in the three I/O ports (A,B,C) and create C:\Projects\UBW\FW\D_143\user\user.c // a packet to send back with all of values. C:\Projects\UBW\FW\D_143\user\user.c // Example: "I,143,221,010" C:\Projects\UBW\FW\D_143\user\user.c // Remember that on UBW 28 pin boards, we only have C:\Projects\UBW\FW\D_143\user\user.c // Port A bits 0 through 5 C:\Projects\UBW\FW\D_143\user\user.c // Port B bits 0 through 7 C:\Projects\UBW\FW\D_143\user\user.c // Port C bits 0,1,2 and 6,7 C:\Projects\UBW\FW\D_143\user\user.c // And that Port C bits 0,1,2 are used for C:\Projects\UBW\FW\D_143\user\user.c // User1 LED, User2 LED and Program switch respectively. C:\Projects\UBW\FW\D_143\user\user.c // The rest will be read in as zeros. C:\Projects\UBW\FW\D_143\user\user.c void parse_I_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c printf ( C:\Projects\UBW\FW\D_143\user\user.c (far rom char*)"I,%03i,%03i,%03i,%03i,%03i\r\n", C:\Projects\UBW\FW\D_143\user\user.c PORTA, C:\Projects\UBW\FW\D_143\user\user.c PORTB, C:\Projects\UBW\FW\D_143\user\user.c PORTC, C:\Projects\UBW\FW\D_143\user\user.c PORTD, C:\Projects\UBW\FW\D_143\user\user.c PORTE C:\Projects\UBW\FW\D_143\user\user.c ); C:\Projects\UBW\FW\D_143\user\user.c #else C:\Projects\UBW\FW\D_143\user\user.c printf ( C:\Projects\UBW\FW\D_143\user\user.c 001626 0e6a MOVLW 0x6a (far rom char*)"I,%03i,%03i,%03i\r\n", C:\Projects\UBW\FW\D_143\user\user.c 001628 6e2a MOVWF 0x2a,0x0 00162a 0e3f MOVLW 0x3f 00162c 6e2b MOVWF 0x2b,0x0 00162e 6a2c CLRF 0x2c,0x0 001630 c02a MOVFF 0x2a,0xfe6 001632 ffe6 001634 c02b MOVFF 0x2b,0xfe6 001636 ffe6 001638 c02c MOVFF 0x2c,0xfe6 00163a ffe6 001620 5080 MOVF 0x80,0x0,0x0 PORTA, C:\Projects\UBW\FW\D_143\user\user.c 001622 6ee6 MOVWF 0xe6,0x0 001624 6ae6 CLRF 0xe6,0x0 00161a 5081 MOVF 0x81,0x0,0x0 PORTB, C:\Projects\UBW\FW\D_143\user\user.c 00161c 6ee6 MOVWF 0xe6,0x0 00161e 6ae6 CLRF 0xe6,0x0 001614 5082 MOVF 0x82,0x0,0x0 PORTC C:\Projects\UBW\FW\D_143\user\user.c 001616 6ee6 MOVWF 0xe6,0x0 ); C:\Projects\UBW\FW\D_143\user\user.c 001618 6ae6 CLRF 0xe6,0x0 00163c ec5f CALL 0x42be,0x0 00163e f021 001640 6e2d MOVWF 0x2d,0x0 001642 0e09 MOVLW 0x9 001644 5ee1 SUBWF 0xe1,0x1,0x0 001646 502d MOVF 0x2d,0x0,0x0 #endif C:\Projects\UBW\FW\D_143\user\user.c 001648 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // All we do here is just print out our version number C:\Projects\UBW\FW\D_143\user\user.c void parse_V_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00164a 0e84 MOVLW 0x84 printf ((far rom char *)st_version); C:\Projects\UBW\FW\D_143\user\user.c 00164c 6e2a MOVWF 0x2a,0x0 00164e 0e45 MOVLW 0x45 001650 6e2b MOVWF 0x2b,0x0 001652 6a2c CLRF 0x2c,0x0 001654 c02a MOVFF 0x2a,0xfe6 001656 ffe6 001658 c02b MOVFF 0x2b,0xfe6 00165a ffe6 00165c c02c MOVFF 0x2c,0xfe6 00165e ffe6 001660 ec5f CALL 0x42be,0x0 001662 f021 001664 52e5 MOVF 0xe5,0x1,0x0 001666 52e5 MOVF 0xe5,0x1,0x0 001668 52e5 MOVF 0xe5,0x1,0x0 00166a 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // A is for read Analog inputs C:\Projects\UBW\FW\D_143\user\user.c // Just print out the last analog values for each of the C:\Projects\UBW\FW\D_143\user\user.c // enabled channels. The number of value returned in the C:\Projects\UBW\FW\D_143\user\user.c // A packet depend upon the number of analog inputs enabled. C:\Projects\UBW\FW\D_143\user\user.c // The user can enabled any number of analog inputs between C:\Projects\UBW\FW\D_143\user\user.c // 0 and 12. (none enabled, through all 12 analog inputs enabled). C:\Projects\UBW\FW\D_143\user\user.c // Returned packet will look like "A,0,0,0,0,0,0" if C:\Projects\UBW\FW\D_143\user\user.c // six analog inputs are enabled but they are all C:\Projects\UBW\FW\D_143\user\user.c // grounded. Note that each one is a 10 bit C:\Projects\UBW\FW\D_143\user\user.c // value, where 0 means the intput was at ground, and C:\Projects\UBW\FW\D_143\user\user.c // 1024 means it was at +5 V. (Or whatever the USB +5 C:\Projects\UBW\FW\D_143\user\user.c // pin is at.) C:\Projects\UBW\FW\D_143\user\user.c 00166c cfd9 MOVFF 0xfd9,0xfe6 void parse_A_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 00166e ffe6 001670 cfe1 MOVFF 0xfe1,0xfd9 001672 ffd9 001674 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c 001676 6adf CLRF 0xdf,0x0 char channel = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Put the beginning of the packet in place C:\Projects\UBW\FW\D_143\user\user.c 001678 0e68 MOVLW 0x68 printf ((far rom char *)"A"); C:\Projects\UBW\FW\D_143\user\user.c 00167a 6e2a MOVWF 0x2a,0x0 00167c 0e3f MOVLW 0x3f 00167e 6e2b MOVWF 0x2b,0x0 001680 6a2c CLRF 0x2c,0x0 001682 c02a MOVFF 0x2a,0xfe6 001684 ffe6 001686 c02b MOVFF 0x2b,0xfe6 001688 ffe6 00168a c02c MOVFF 0x2c,0xfe6 00168c ffe6 00168e ec5f CALL 0x42be,0x0 001690 f021 001692 52e5 MOVF 0xe5,0x1,0x0 001694 52e5 MOVF 0xe5,0x1,0x0 001696 52e5 MOVF 0xe5,0x1,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Now add each analog value C:\Projects\UBW\FW\D_143\user\user.c 001698 6adf CLRF 0xdf,0x0 for (channel = 0; channel < AnalogEnable; channel++) C:\Projects\UBW\FW\D_143\user\user.c 00169a 500c MOVF 0xc,0x0,0x0 00169c 5cdf SUBWF 0xdf,0x0,0x0 00169e e232 BC 0x1704 001700 2adf INCF 0xdf,0x1,0x0 001702 d7cb BRA 0x169a { C:\Projects\UBW\FW\D_143\user\user.c printf( C:\Projects\UBW\FW\D_143\user\user.c (far rom char *)",%04u" C:\Projects\UBW\FW\D_143\user\user.c 0016a0 cfdf MOVFF 0xfdf,0x2a ,ISR_A_FIFO[channel][ISR_A_FIFO_out] C:\Projects\UBW\FW\D_143\user\user.c 0016a2 f02a 0016a4 6a2b CLRF 0x2b,0x0 0016a6 be2a BTFSC 0x2a,0x7,0x0 0016a8 682b SETF 0x2b,0x0 0016aa 0e06 MOVLW 0x6 0016ac 022b MULWF 0x2b,0x0 0016ae cff3 MOVFF 0xff3,0x2b 0016b0 f02b 0016b2 0e06 MOVLW 0x6 0016b4 022a MULWF 0x2a,0x0 0016b6 cff3 MOVFF 0xff3,0x2a 0016b8 f02a 0016ba 50f4 MOVF 0xf4,0x0,0x0 0016bc 262b ADDWF 0x2b,0x1,0x0 0016be 0e00 MOVLW 0x0 0016c0 262a ADDWF 0x2a,0x1,0x0 0016c2 0e01 MOVLW 0x1 0016c4 222b ADDWFC 0x2b,0x1,0x0 0016c6 500a MOVF 0xa,0x0,0x0 0016c8 0d02 MULLW 0x2 0016ca 502a MOVF 0x2a,0x0,0x0 0016cc 24f3 ADDWF 0xf3,0x0,0x0 0016ce 6ee9 MOVWF 0xe9,0x0 0016d0 502b MOVF 0x2b,0x0,0x0 0016d2 20f4 ADDWFC 0xf4,0x0,0x0 0016d4 6eea MOVWF 0xea,0x0 0016de 0e62 MOVLW 0x62 0016e0 6e2c MOVWF 0x2c,0x0 0016e2 0e3f MOVLW 0x3f 0016e4 6e2d MOVWF 0x2d,0x0 0016e6 6a2e CLRF 0x2e,0x0 0016e8 c02c MOVFF 0x2c,0xfe6 0016ea ffe6 0016ec c02d MOVFF 0x2d,0xfe6 0016ee ffe6 0016f0 c02e MOVFF 0x2e,0xfe6 0016f2 ffe6 0016d6 cfee MOVFF 0xfee,0xfe6 ); C:\Projects\UBW\FW\D_143\user\user.c 0016d8 ffe6 0016da cfef MOVFF 0xfef,0xfe6 0016dc ffe6 0016f4 ec5f CALL 0x42be,0x0 0016f6 f021 0016f8 6e2f MOVWF 0x2f,0x0 0016fa 0e05 MOVLW 0x5 0016fc 5ee1 SUBWF 0xe1,0x1,0x0 0016fe 502f MOVF 0x2f,0x0,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Add \r\n and terminating zero. C:\Projects\UBW\FW\D_143\user\user.c 001704 0e81 MOVLW 0x81 printf ((far rom char *)st_LFCR); C:\Projects\UBW\FW\D_143\user\user.c 001706 6e2a MOVWF 0x2a,0x0 001708 0e45 MOVLW 0x45 00170a 6e2b MOVWF 0x2b,0x0 00170c 6a2c CLRF 0x2c,0x0 00170e c02a MOVFF 0x2a,0xfe6 001710 ffe6 001712 c02b MOVFF 0x2b,0xfe6 001714 ffe6 001716 c02c MOVFF 0x2c,0xfe6 001718 ffe6 00171a ec5f CALL 0x42be,0x0 00171c f021 00171e 52e5 MOVF 0xe5,0x1,0x0 001720 52e5 MOVF 0xe5,0x1,0x0 001722 52e5 MOVF 0xe5,0x1,0x0 001724 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001726 52e5 MOVF 0xe5,0x1,0x0 001728 cfe7 MOVFF 0xfe7,0xfd9 00172a ffd9 00172c 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // MW is for Memory Write C:\Projects\UBW\FW\D_143\user\user.c // "MW,," C:\Projects\UBW\FW\D_143\user\user.c // is a decimal value between 0 and 4096 indicating the RAM address to write to C:\Projects\UBW\FW\D_143\user\user.c // is a decimal value between 0 and 255 that is the value to write C:\Projects\UBW\FW\D_143\user\user.c 00172e cfd9 MOVFF 0xfd9,0xfe6 void parse_MW_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001730 ffe6 001732 cfe1 MOVFF 0xfe1,0xfd9 001734 ffd9 001736 0e03 MOVLW 0x3 001738 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned int location; C:\Projects\UBW\FW\D_143\user\user.c unsigned char value; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 00173a 0e03 MOVLW 0x3 location = extract_number (kUINT); C:\Projects\UBW\FW\D_143\user\user.c 00173c 6ee6 MOVWF 0xe6,0x0 00173e ecc9 CALL 0x2192,0x0 001740 f010 001742 52e5 MOVF 0xe5,0x1,0x0 001744 c01d MOVFF 0x1d,0xfde 001746 ffde 001748 c01e MOVFF 0x1e,0xfdd 00174a ffdd 00174c 0e01 MOVLW 0x1 value = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 00174e 6ee6 MOVWF 0xe6,0x0 001750 ecc9 CALL 0x2192,0x0 001752 f010 001754 52e5 MOVF 0xe5,0x1,0x0 001756 0e02 MOVLW 0x2 001758 c01d MOVFF 0x1d,0xfdb 00175a ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 00175c 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 00175e e001 BZ 0x1762 { C:\Projects\UBW\FW\D_143\user\user.c 001760 d011 BRA 0x1784 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c // Limit check the address and write the byte in C:\Projects\UBW\FW\D_143\user\user.c 001762 cfde MOVFF 0xfde,0x2a if (location < 4096) C:\Projects\UBW\FW\D_143\user\user.c 001764 f02a 001766 cfdd MOVFF 0xfdd,0x2b 001768 f02b 00176a 0e00 MOVLW 0x0 00176c 5c2a SUBWF 0x2a,0x0,0x0 00176e 0e10 MOVLW 0x10 001770 582b SUBWFB 0x2b,0x0,0x0 001772 e207 BC 0x1782 { C:\Projects\UBW\FW\D_143\user\user.c 001774 cfde MOVFF 0xfde,0xfe9 *((unsigned char *)location) = value; C:\Projects\UBW\FW\D_143\user\user.c 001776 ffe9 001778 cfdd MOVFF 0xfdd,0xfea 00177a ffea 00177c 0e02 MOVLW 0x2 00177e cfdb MOVFF 0xfdb,0xfef 001780 ffef } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001782 de1f RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001784 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001786 5ce1 SUBWF 0xe1,0x0,0x0 001788 e202 BC 0x178e 00178a 6ae1 CLRF 0xe1,0x0 00178c 52e5 MOVF 0xe5,0x1,0x0 00178e 6ee1 MOVWF 0xe1,0x0 001790 52e5 MOVF 0xe5,0x1,0x0 001792 cfe7 MOVFF 0xfe7,0xfd9 001794 ffd9 001796 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // MR is for Memory Read C:\Projects\UBW\FW\D_143\user\user.c // "MW," C:\Projects\UBW\FW\D_143\user\user.c // is a decimal value between 0 and 4096 indicating the RAM address to read from C:\Projects\UBW\FW\D_143\user\user.c // The UBW will then send a "MR," packet back to the PC C:\Projects\UBW\FW\D_143\user\user.c // where is the byte value read from the address C:\Projects\UBW\FW\D_143\user\user.c 001798 cfd9 MOVFF 0xfd9,0xfe6 void parse_MR_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 00179a ffe6 00179c cfe1 MOVFF 0xfe1,0xfd9 00179e ffd9 0017a0 0e03 MOVLW 0x3 0017a2 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned int location; C:\Projects\UBW\FW\D_143\user\user.c unsigned char value; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0017a4 0e03 MOVLW 0x3 location = extract_number (kUINT); C:\Projects\UBW\FW\D_143\user\user.c 0017a6 6ee6 MOVWF 0xe6,0x0 0017a8 ecc9 CALL 0x2192,0x0 0017aa f010 0017ac 52e5 MOVF 0xe5,0x1,0x0 0017ae c01d MOVFF 0x1d,0xfde 0017b0 ffde 0017b2 c01e MOVFF 0x1e,0xfdd 0017b4 ffdd C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 0017b6 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 0017b8 e001 BZ 0x17bc { C:\Projects\UBW\FW\D_143\user\user.c 0017ba d025 BRA 0x1806 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Limit check the address and write the byte in C:\Projects\UBW\FW\D_143\user\user.c 0017bc cfde MOVFF 0xfde,0x2a if (location < 4096) C:\Projects\UBW\FW\D_143\user\user.c 0017be f02a 0017c0 cfdd MOVFF 0xfdd,0x2b 0017c2 f02b 0017c4 0e00 MOVLW 0x0 0017c6 5c2a SUBWF 0x2a,0x0,0x0 0017c8 0e10 MOVLW 0x10 0017ca 582b SUBWFB 0x2b,0x0,0x0 0017cc e207 BC 0x17dc { C:\Projects\UBW\FW\D_143\user\user.c 0017ce cfde MOVFF 0xfde,0xfe9 value = *((unsigned char *)location); C:\Projects\UBW\FW\D_143\user\user.c 0017d0 ffe9 0017d2 cfdd MOVFF 0xfdd,0xfea 0017d4 ffea 0017d6 0e02 MOVLW 0x2 0017d8 cfef MOVFF 0xfef,0xfdb 0017da ffdb } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now send back the MR packet C:\Projects\UBW\FW\D_143\user\user.c printf ( C:\Projects\UBW\FW\D_143\user\user.c (far rom char *)"MR,%03u\r\n" C:\Projects\UBW\FW\D_143\user\user.c 0017e4 0e58 MOVLW 0x58 ,value C:\Projects\UBW\FW\D_143\user\user.c 0017e6 6e2a MOVWF 0x2a,0x0 0017e8 0e3f MOVLW 0x3f 0017ea 6e2b MOVWF 0x2b,0x0 0017ec 6a2c CLRF 0x2c,0x0 0017ee c02a MOVFF 0x2a,0xfe6 0017f0 ffe6 0017f2 c02b MOVFF 0x2b,0xfe6 0017f4 ffe6 0017f6 c02c MOVFF 0x2c,0xfe6 0017f8 ffe6 0017dc 0e02 MOVLW 0x2 ); C:\Projects\UBW\FW\D_143\user\user.c 0017de cfdb MOVFF 0xfdb,0xfe6 0017e0 ffe6 0017e2 6ae6 CLRF 0xe6,0x0 0017fa ec5f CALL 0x42be,0x0 0017fc f021 0017fe 6e2d MOVWF 0x2d,0x0 001800 0e05 MOVLW 0x5 001802 5ee1 SUBWF 0xe1,0x1,0x0 001804 502d MOVF 0x2d,0x0,0x0 001806 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001808 5ce1 SUBWF 0xe1,0x0,0x0 00180a e202 BC 0x1810 00180c 6ae1 CLRF 0xe1,0x0 00180e 52e5 MOVF 0xe5,0x1,0x0 001810 6ee1 MOVWF 0xe1,0x0 001812 52e5 MOVF 0xe5,0x1,0x0 001814 cfe7 MOVFF 0xfe7,0xfd9 001816 ffd9 001818 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // PD is for Pin Direction C:\Projects\UBW\FW\D_143\user\user.c // "PD,,," C:\Projects\UBW\FW\D_143\user\user.c // is "A", "B", "C" and indicates the port C:\Projects\UBW\FW\D_143\user\user.c // is a number between 0 and 7 and indicates which pin to change direction on C:\Projects\UBW\FW\D_143\user\user.c // is "1" for input, "0" for output C:\Projects\UBW\FW\D_143\user\user.c 00181a cfd9 MOVFF 0xfd9,0xfe6 void parse_PD_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 00181c ffe6 00181e cfe1 MOVFF 0xfe1,0xfd9 001820 ffd9 001822 0e03 MOVLW 0x3 001824 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char port; C:\Projects\UBW\FW\D_143\user\user.c unsigned char pin; C:\Projects\UBW\FW\D_143\user\user.c unsigned char direction; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001826 0e05 MOVLW 0x5 port = extract_number (kUCASE_ASCII_CHAR); C:\Projects\UBW\FW\D_143\user\user.c 001828 6ee6 MOVWF 0xe6,0x0 00182a ecc9 CALL 0x2192,0x0 00182c f010 00182e 52e5 MOVF 0xe5,0x1,0x0 001830 501d MOVF 0x1d,0x0,0x0 001832 6edf MOVWF 0xdf,0x0 001834 0e01 MOVLW 0x1 pin = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001836 6ee6 MOVWF 0xe6,0x0 001838 ecc9 CALL 0x2192,0x0 00183a f010 00183c 52e5 MOVF 0xe5,0x1,0x0 00183e 0e01 MOVLW 0x1 001840 c01d MOVFF 0x1d,0xfdb 001842 ffdb 001844 0e01 MOVLW 0x1 direction = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001846 6ee6 MOVWF 0xe6,0x0 001848 ecc9 CALL 0x2192,0x0 00184a f010 00184c 52e5 MOVF 0xe5,0x1,0x0 00184e 0e02 MOVLW 0x2 001850 c01d MOVFF 0x1d,0xfdb 001852 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001854 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001856 e001 BZ 0x185a { C:\Projects\UBW\FW\D_143\user\user.c 001858 d072 BRA 0x193e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Limit check the parameters C:\Projects\UBW\FW\D_143\user\user.c 00185a 0e02 MOVLW 0x2 if (direction > 1) C:\Projects\UBW\FW\D_143\user\user.c 00185c 50db MOVF 0xdb,0x0,0x0 00185e 0801 SUBLW 0x1 001860 e202 BC 0x1866 { C:\Projects\UBW\FW\D_143\user\user.c 001862 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001864 d06c BRA 0x193e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001866 0e01 MOVLW 0x1 if (pin > 7) C:\Projects\UBW\FW\D_143\user\user.c 001868 50db MOVF 0xdb,0x0,0x0 00186a 0807 SUBLW 0x7 00186c e202 BC 0x1872 { C:\Projects\UBW\FW\D_143\user\user.c 00186e 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001870 d066 BRA 0x193e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001872 0e41 MOVLW 0x41 if ('A' == port) C:\Projects\UBW\FW\D_143\user\user.c 001874 6e2a MOVWF 0x2a,0x0 001876 50df MOVF 0xdf,0x0,0x0 001878 5c2a SUBWF 0x2a,0x0,0x0 00187a e11c BNZ 0x18b4 { C:\Projects\UBW\FW\D_143\user\user.c 00187c 0e02 MOVLW 0x2 if (0 == direction) C:\Projects\UBW\FW\D_143\user\user.c 00187e 50db MOVF 0xdb,0x0,0x0 001880 e10d BNZ 0x189c { C:\Projects\UBW\FW\D_143\user\user.c 001882 0e01 MOVLW 0x1 bitclr (DDRA, pin); C:\Projects\UBW\FW\D_143\user\user.c 001884 6ef3 MOVWF 0xf3,0x0 001886 0e01 MOVLW 0x1 001888 50db MOVF 0xdb,0x0,0x0 00188a e004 BZ 0x1894 00188c 90d8 BCF 0xd8,0x0,0x0 00188e 36f3 RLCF 0xf3,0x1,0x0 001890 06e8 DECF 0xe8,0x1,0x0 001892 e1fc BNZ 0x188c 001894 50f3 MOVF 0xf3,0x0,0x0 001896 1ce8 COMF 0xe8,0x0,0x0 001898 1692 ANDWF 0x92,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 00189a d00b BRA 0x18b2 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00189c 0e01 MOVLW 0x1 bitset (DDRA, pin); C:\Projects\UBW\FW\D_143\user\user.c 00189e 6ef3 MOVWF 0xf3,0x0 0018a0 0e01 MOVLW 0x1 0018a2 50db MOVF 0xdb,0x0,0x0 0018a4 e004 BZ 0x18ae 0018a6 90d8 BCF 0xd8,0x0,0x0 0018a8 36f3 RLCF 0xf3,0x1,0x0 0018aa 06e8 DECF 0xe8,0x1,0x0 0018ac e1fc BNZ 0x18a6 0018ae 50f3 MOVF 0xf3,0x0,0x0 0018b0 1292 IORWF 0x92,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0018b2 d044 BRA 0x193c else if ('B' == port) C:\Projects\UBW\FW\D_143\user\user.c 0018b4 0e42 MOVLW 0x42 0018b6 6e2a MOVWF 0x2a,0x0 0018b8 50df MOVF 0xdf,0x0,0x0 0018ba 5c2a SUBWF 0x2a,0x0,0x0 0018bc e11c BNZ 0x18f6 { C:\Projects\UBW\FW\D_143\user\user.c 0018be 0e02 MOVLW 0x2 if (0 == direction) C:\Projects\UBW\FW\D_143\user\user.c 0018c0 50db MOVF 0xdb,0x0,0x0 0018c2 e10d BNZ 0x18de { C:\Projects\UBW\FW\D_143\user\user.c 0018c4 0e01 MOVLW 0x1 bitclr (DDRB, pin); C:\Projects\UBW\FW\D_143\user\user.c 0018c6 6ef3 MOVWF 0xf3,0x0 0018c8 0e01 MOVLW 0x1 0018ca 50db MOVF 0xdb,0x0,0x0 0018cc e004 BZ 0x18d6 0018ce 90d8 BCF 0xd8,0x0,0x0 0018d0 36f3 RLCF 0xf3,0x1,0x0 0018d2 06e8 DECF 0xe8,0x1,0x0 0018d4 e1fc BNZ 0x18ce 0018d6 50f3 MOVF 0xf3,0x0,0x0 0018d8 1ce8 COMF 0xe8,0x0,0x0 0018da 1693 ANDWF 0x93,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0018dc d00b BRA 0x18f4 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0018de 0e01 MOVLW 0x1 bitset (DDRB, pin); C:\Projects\UBW\FW\D_143\user\user.c 0018e0 6ef3 MOVWF 0xf3,0x0 0018e2 0e01 MOVLW 0x1 0018e4 50db MOVF 0xdb,0x0,0x0 0018e6 e004 BZ 0x18f0 0018e8 90d8 BCF 0xd8,0x0,0x0 0018ea 36f3 RLCF 0xf3,0x1,0x0 0018ec 06e8 DECF 0xe8,0x1,0x0 0018ee e1fc BNZ 0x18e8 0018f0 50f3 MOVF 0xf3,0x0,0x0 0018f2 1293 IORWF 0x93,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0018f4 d023 BRA 0x193c else if ('C' == port) C:\Projects\UBW\FW\D_143\user\user.c 0018f6 0e43 MOVLW 0x43 0018f8 6e2a MOVWF 0x2a,0x0 0018fa 50df MOVF 0xdf,0x0,0x0 0018fc 5c2a SUBWF 0x2a,0x0,0x0 0018fe e11c BNZ 0x1938 { C:\Projects\UBW\FW\D_143\user\user.c 001900 0e02 MOVLW 0x2 if (0 == direction) C:\Projects\UBW\FW\D_143\user\user.c 001902 50db MOVF 0xdb,0x0,0x0 001904 e10d BNZ 0x1920 { C:\Projects\UBW\FW\D_143\user\user.c 001906 0e01 MOVLW 0x1 bitclr (DDRC, pin); C:\Projects\UBW\FW\D_143\user\user.c 001908 6ef3 MOVWF 0xf3,0x0 00190a 0e01 MOVLW 0x1 00190c 50db MOVF 0xdb,0x0,0x0 00190e e004 BZ 0x1918 001910 90d8 BCF 0xd8,0x0,0x0 001912 36f3 RLCF 0xf3,0x1,0x0 001914 06e8 DECF 0xe8,0x1,0x0 001916 e1fc BNZ 0x1910 001918 50f3 MOVF 0xf3,0x0,0x0 00191a 1ce8 COMF 0xe8,0x0,0x0 00191c 1694 ANDWF 0x94,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 00191e d00b BRA 0x1936 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001920 0e01 MOVLW 0x1 bitset (DDRC, pin); C:\Projects\UBW\FW\D_143\user\user.c 001922 6ef3 MOVWF 0xf3,0x0 001924 0e01 MOVLW 0x1 001926 50db MOVF 0xdb,0x0,0x0 001928 e004 BZ 0x1932 00192a 90d8 BCF 0xd8,0x0,0x0 00192c 36f3 RLCF 0xf3,0x1,0x0 00192e 06e8 DECF 0xe8,0x1,0x0 001930 e1fc BNZ 0x192a 001932 50f3 MOVF 0xf3,0x0,0x0 001934 1294 IORWF 0x94,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c else if ('D' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c if (0 == direction) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitclr (DDRD, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitset (DDRD, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else if ('E' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c if (0 == direction) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitclr (DDRE, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitset (DDRE, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c 001936 d002 BRA 0x193c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001938 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 00193a d001 BRA 0x193e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 00193c dd42 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 00193e 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001940 5ce1 SUBWF 0xe1,0x0,0x0 001942 e202 BC 0x1948 001944 6ae1 CLRF 0xe1,0x0 001946 52e5 MOVF 0xe5,0x1,0x0 001948 6ee1 MOVWF 0xe1,0x0 00194a 52e5 MOVF 0xe5,0x1,0x0 00194c cfe7 MOVFF 0xfe7,0xfd9 00194e ffd9 001950 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // PI is for Pin Input C:\Projects\UBW\FW\D_143\user\user.c // "PI,," C:\Projects\UBW\FW\D_143\user\user.c // is "A", "B", "C" and indicates the port C:\Projects\UBW\FW\D_143\user\user.c // is a number between 0 and 7 and indicates which pin to read C:\Projects\UBW\FW\D_143\user\user.c // The command returns a "PI," packet, C:\Projects\UBW\FW\D_143\user\user.c // where is the value (0 or 1 for digital, 0 to 1024 for Analog) C:\Projects\UBW\FW\D_143\user\user.c // value for that pin. C:\Projects\UBW\FW\D_143\user\user.c 001952 cfd9 MOVFF 0xfd9,0xfe6 void parse_PI_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001954 ffe6 001956 cfe1 MOVFF 0xfe1,0xfd9 001958 ffd9 00195a 0e03 MOVLW 0x3 00195c 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char port; C:\Projects\UBW\FW\D_143\user\user.c unsigned char pin; C:\Projects\UBW\FW\D_143\user\user.c 00195e 0e02 MOVLW 0x2 unsigned char value = 0; C:\Projects\UBW\FW\D_143\user\user.c 001960 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c 001962 0e05 MOVLW 0x5 port = extract_number (kUCASE_ASCII_CHAR); C:\Projects\UBW\FW\D_143\user\user.c 001964 6ee6 MOVWF 0xe6,0x0 001966 ecc9 CALL 0x2192,0x0 001968 f010 00196a 52e5 MOVF 0xe5,0x1,0x0 00196c 501d MOVF 0x1d,0x0,0x0 00196e 6edf MOVWF 0xdf,0x0 001970 0e01 MOVLW 0x1 pin = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001972 6ee6 MOVWF 0xe6,0x0 001974 ecc9 CALL 0x2192,0x0 001976 f010 001978 52e5 MOVF 0xe5,0x1,0x0 00197a 0e01 MOVLW 0x1 00197c c01d MOVFF 0x1d,0xfdb 00197e ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001980 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001982 e001 BZ 0x1986 { C:\Projects\UBW\FW\D_143\user\user.c 001984 d05c BRA 0x1a3e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Limit check the parameters C:\Projects\UBW\FW\D_143\user\user.c 001986 0e01 MOVLW 0x1 if (pin > 7) C:\Projects\UBW\FW\D_143\user\user.c 001988 50db MOVF 0xdb,0x0,0x0 00198a 0807 SUBLW 0x7 00198c e202 BC 0x1992 { C:\Projects\UBW\FW\D_143\user\user.c 00198e 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001990 d056 BRA 0x1a3e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Then test the bit in question based upon port C:\Projects\UBW\FW\D_143\user\user.c 001992 0e41 MOVLW 0x41 if ('A' == port) C:\Projects\UBW\FW\D_143\user\user.c 001994 6e2a MOVWF 0x2a,0x0 001996 50df MOVF 0xdf,0x0,0x0 001998 5c2a SUBWF 0x2a,0x0,0x0 00199a e110 BNZ 0x19bc { C:\Projects\UBW\FW\D_143\user\user.c 00199c 0e01 MOVLW 0x1 value = bittst (PORTA, pin); C:\Projects\UBW\FW\D_143\user\user.c 00199e 6ef3 MOVWF 0xf3,0x0 0019a0 0e01 MOVLW 0x1 0019a2 50db MOVF 0xdb,0x0,0x0 0019a4 e004 BZ 0x19ae 0019a6 90d8 BCF 0xd8,0x0,0x0 0019a8 36f3 RLCF 0xf3,0x1,0x0 0019aa 06e8 DECF 0xe8,0x1,0x0 0019ac e1fc BNZ 0x19a6 0019ae 50f3 MOVF 0xf3,0x0,0x0 0019b0 1480 ANDWF 0x80,0x0,0x0 0019b2 6ee7 MOVWF 0xe7,0x0 0019b4 0e02 MOVLW 0x2 0019b6 cfe7 MOVFF 0xfe7,0xfdb 0019b8 ffdb } C:\Projects\UBW\FW\D_143\user\user.c 0019ba d02c BRA 0x1a14 else if ('B' == port) C:\Projects\UBW\FW\D_143\user\user.c 0019bc 0e42 MOVLW 0x42 0019be 6e2a MOVWF 0x2a,0x0 0019c0 50df MOVF 0xdf,0x0,0x0 0019c2 5c2a SUBWF 0x2a,0x0,0x0 0019c4 e110 BNZ 0x19e6 { C:\Projects\UBW\FW\D_143\user\user.c 0019c6 0e01 MOVLW 0x1 value = bittst (PORTB, pin); C:\Projects\UBW\FW\D_143\user\user.c 0019c8 6ef3 MOVWF 0xf3,0x0 0019ca 0e01 MOVLW 0x1 0019cc 50db MOVF 0xdb,0x0,0x0 0019ce e004 BZ 0x19d8 0019d0 90d8 BCF 0xd8,0x0,0x0 0019d2 36f3 RLCF 0xf3,0x1,0x0 0019d4 06e8 DECF 0xe8,0x1,0x0 0019d6 e1fc BNZ 0x19d0 0019d8 50f3 MOVF 0xf3,0x0,0x0 0019da 1481 ANDWF 0x81,0x0,0x0 0019dc 6ee7 MOVWF 0xe7,0x0 0019de 0e02 MOVLW 0x2 0019e0 cfe7 MOVFF 0xfe7,0xfdb 0019e2 ffdb } C:\Projects\UBW\FW\D_143\user\user.c 0019e4 d017 BRA 0x1a14 else if ('C' == port) C:\Projects\UBW\FW\D_143\user\user.c 0019e6 0e43 MOVLW 0x43 0019e8 6e2a MOVWF 0x2a,0x0 0019ea 50df MOVF 0xdf,0x0,0x0 0019ec 5c2a SUBWF 0x2a,0x0,0x0 0019ee e110 BNZ 0x1a10 { C:\Projects\UBW\FW\D_143\user\user.c 0019f0 0e01 MOVLW 0x1 value = bittst (PORTC, pin); C:\Projects\UBW\FW\D_143\user\user.c 0019f2 6ef3 MOVWF 0xf3,0x0 0019f4 0e01 MOVLW 0x1 0019f6 50db MOVF 0xdb,0x0,0x0 0019f8 e004 BZ 0x1a02 0019fa 90d8 BCF 0xd8,0x0,0x0 0019fc 36f3 RLCF 0xf3,0x1,0x0 0019fe 06e8 DECF 0xe8,0x1,0x0 001a00 e1fc BNZ 0x19fa 001a02 50f3 MOVF 0xf3,0x0,0x0 001a04 1482 ANDWF 0x82,0x0,0x0 001a06 6ee7 MOVWF 0xe7,0x0 001a08 0e02 MOVLW 0x2 001a0a cfe7 MOVFF 0xfe7,0xfdb 001a0c ffdb } C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c else if ('D' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c value = bittst (PORTD, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else if ('E' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c value = bittst (PORTE, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c 001a0e d002 BRA 0x1a14 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001a10 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001a12 d015 BRA 0x1a3e return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now send back our response C:\Projects\UBW\FW\D_143\user\user.c printf( C:\Projects\UBW\FW\D_143\user\user.c (far rom char *)"PI,%1u\r\n" C:\Projects\UBW\FW\D_143\user\user.c 001a1c 0e4f MOVLW 0x4f ,value C:\Projects\UBW\FW\D_143\user\user.c 001a1e 6e2a MOVWF 0x2a,0x0 001a20 0e3f MOVLW 0x3f 001a22 6e2b MOVWF 0x2b,0x0 001a24 6a2c CLRF 0x2c,0x0 001a26 c02a MOVFF 0x2a,0xfe6 001a28 ffe6 001a2a c02b MOVFF 0x2b,0xfe6 001a2c ffe6 001a2e c02c MOVFF 0x2c,0xfe6 001a30 ffe6 001a14 0e02 MOVLW 0x2 ); C:\Projects\UBW\FW\D_143\user\user.c 001a16 cfdb MOVFF 0xfdb,0xfe6 001a18 ffe6 001a1a 6ae6 CLRF 0xe6,0x0 001a32 ec5f CALL 0x42be,0x0 001a34 f021 001a36 6e2d MOVWF 0x2d,0x0 001a38 0e05 MOVLW 0x5 001a3a 5ee1 SUBWF 0xe1,0x1,0x0 001a3c 502d MOVF 0x2d,0x0,0x0 001a3e 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001a40 5ce1 SUBWF 0xe1,0x0,0x0 001a42 e202 BC 0x1a48 001a44 6ae1 CLRF 0xe1,0x0 001a46 52e5 MOVF 0xe5,0x1,0x0 001a48 6ee1 MOVWF 0xe1,0x0 001a4a 52e5 MOVF 0xe5,0x1,0x0 001a4c cfe7 MOVFF 0xfe7,0xfd9 001a4e ffd9 001a50 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // PO is for Pin Output C:\Projects\UBW\FW\D_143\user\user.c // "PO,,," C:\Projects\UBW\FW\D_143\user\user.c // is "A", "B", "C" and indicates the port C:\Projects\UBW\FW\D_143\user\user.c // is a number between 0 and 7 and indicates which pin to write out the value to C:\Projects\UBW\FW\D_143\user\user.c // is "1" or "0" and indicates the state to change the pin to C:\Projects\UBW\FW\D_143\user\user.c 001a52 cfd9 MOVFF 0xfd9,0xfe6 void parse_PO_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001a54 ffe6 001a56 cfe1 MOVFF 0xfe1,0xfd9 001a58 ffd9 001a5a 0e03 MOVLW 0x3 001a5c 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char port; C:\Projects\UBW\FW\D_143\user\user.c unsigned char pin; C:\Projects\UBW\FW\D_143\user\user.c unsigned char value; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001a5e 0e05 MOVLW 0x5 port = extract_number (kUCASE_ASCII_CHAR); C:\Projects\UBW\FW\D_143\user\user.c 001a60 6ee6 MOVWF 0xe6,0x0 001a62 db97 RCALL 0x2192 001a64 52e5 MOVF 0xe5,0x1,0x0 001a66 501d MOVF 0x1d,0x0,0x0 001a68 6edf MOVWF 0xdf,0x0 001a6a 0e01 MOVLW 0x1 pin = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001a6c 6ee6 MOVWF 0xe6,0x0 001a6e db91 RCALL 0x2192 001a70 52e5 MOVF 0xe5,0x1,0x0 001a72 0e01 MOVLW 0x1 001a74 c01d MOVFF 0x1d,0xfdb 001a76 ffdb 001a78 0e01 MOVLW 0x1 value = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001a7a 6ee6 MOVWF 0xe6,0x0 001a7c db8a RCALL 0x2192 001a7e 52e5 MOVF 0xe5,0x1,0x0 001a80 0e02 MOVLW 0x2 001a82 c01d MOVFF 0x1d,0xfdb 001a84 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001a86 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001a88 e001 BZ 0x1a8c { C:\Projects\UBW\FW\D_143\user\user.c 001a8a d072 BRA 0x1b70 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Limit check the parameters C:\Projects\UBW\FW\D_143\user\user.c 001a8c 0e02 MOVLW 0x2 if (value > 1) C:\Projects\UBW\FW\D_143\user\user.c 001a8e 50db MOVF 0xdb,0x0,0x0 001a90 0801 SUBLW 0x1 001a92 e202 BC 0x1a98 { C:\Projects\UBW\FW\D_143\user\user.c 001a94 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001a96 d06c BRA 0x1b70 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001a98 0e01 MOVLW 0x1 if (pin > 7) C:\Projects\UBW\FW\D_143\user\user.c 001a9a 50db MOVF 0xdb,0x0,0x0 001a9c 0807 SUBLW 0x7 001a9e e202 BC 0x1aa4 { C:\Projects\UBW\FW\D_143\user\user.c 001aa0 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001aa2 d066 BRA 0x1b70 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001aa4 0e41 MOVLW 0x41 if ('A' == port) C:\Projects\UBW\FW\D_143\user\user.c 001aa6 6e2a MOVWF 0x2a,0x0 001aa8 50df MOVF 0xdf,0x0,0x0 001aaa 5c2a SUBWF 0x2a,0x0,0x0 001aac e11c BNZ 0x1ae6 { C:\Projects\UBW\FW\D_143\user\user.c 001aae 0e02 MOVLW 0x2 if (0 == value) C:\Projects\UBW\FW\D_143\user\user.c 001ab0 50db MOVF 0xdb,0x0,0x0 001ab2 e10d BNZ 0x1ace { C:\Projects\UBW\FW\D_143\user\user.c 001ab4 0e01 MOVLW 0x1 bitclr (LATA, pin); C:\Projects\UBW\FW\D_143\user\user.c 001ab6 6ef3 MOVWF 0xf3,0x0 001ab8 0e01 MOVLW 0x1 001aba 50db MOVF 0xdb,0x0,0x0 001abc e004 BZ 0x1ac6 001abe 90d8 BCF 0xd8,0x0,0x0 001ac0 36f3 RLCF 0xf3,0x1,0x0 001ac2 06e8 DECF 0xe8,0x1,0x0 001ac4 e1fc BNZ 0x1abe 001ac6 50f3 MOVF 0xf3,0x0,0x0 001ac8 1ce8 COMF 0xe8,0x0,0x0 001aca 1689 ANDWF 0x89,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001acc d00b BRA 0x1ae4 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001ace 0e01 MOVLW 0x1 bitset (LATA, pin); C:\Projects\UBW\FW\D_143\user\user.c 001ad0 6ef3 MOVWF 0xf3,0x0 001ad2 0e01 MOVLW 0x1 001ad4 50db MOVF 0xdb,0x0,0x0 001ad6 e004 BZ 0x1ae0 001ad8 90d8 BCF 0xd8,0x0,0x0 001ada 36f3 RLCF 0xf3,0x1,0x0 001adc 06e8 DECF 0xe8,0x1,0x0 001ade e1fc BNZ 0x1ad8 001ae0 50f3 MOVF 0xf3,0x0,0x0 001ae2 1289 IORWF 0x89,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001ae4 d044 BRA 0x1b6e else if ('B' == port) C:\Projects\UBW\FW\D_143\user\user.c 001ae6 0e42 MOVLW 0x42 001ae8 6e2a MOVWF 0x2a,0x0 001aea 50df MOVF 0xdf,0x0,0x0 001aec 5c2a SUBWF 0x2a,0x0,0x0 001aee e11c BNZ 0x1b28 { C:\Projects\UBW\FW\D_143\user\user.c 001af0 0e02 MOVLW 0x2 if (0 == value) C:\Projects\UBW\FW\D_143\user\user.c 001af2 50db MOVF 0xdb,0x0,0x0 001af4 e10d BNZ 0x1b10 { C:\Projects\UBW\FW\D_143\user\user.c 001af6 0e01 MOVLW 0x1 bitclr (LATB, pin); C:\Projects\UBW\FW\D_143\user\user.c 001af8 6ef3 MOVWF 0xf3,0x0 001afa 0e01 MOVLW 0x1 001afc 50db MOVF 0xdb,0x0,0x0 001afe e004 BZ 0x1b08 001b00 90d8 BCF 0xd8,0x0,0x0 001b02 36f3 RLCF 0xf3,0x1,0x0 001b04 06e8 DECF 0xe8,0x1,0x0 001b06 e1fc BNZ 0x1b00 001b08 50f3 MOVF 0xf3,0x0,0x0 001b0a 1ce8 COMF 0xe8,0x0,0x0 001b0c 168a ANDWF 0x8a,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001b0e d00b BRA 0x1b26 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b10 0e01 MOVLW 0x1 bitset (LATB, pin); C:\Projects\UBW\FW\D_143\user\user.c 001b12 6ef3 MOVWF 0xf3,0x0 001b14 0e01 MOVLW 0x1 001b16 50db MOVF 0xdb,0x0,0x0 001b18 e004 BZ 0x1b22 001b1a 90d8 BCF 0xd8,0x0,0x0 001b1c 36f3 RLCF 0xf3,0x1,0x0 001b1e 06e8 DECF 0xe8,0x1,0x0 001b20 e1fc BNZ 0x1b1a 001b22 50f3 MOVF 0xf3,0x0,0x0 001b24 128a IORWF 0x8a,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001b26 d023 BRA 0x1b6e else if ('C' == port) C:\Projects\UBW\FW\D_143\user\user.c 001b28 0e43 MOVLW 0x43 001b2a 6e2a MOVWF 0x2a,0x0 001b2c 50df MOVF 0xdf,0x0,0x0 001b2e 5c2a SUBWF 0x2a,0x0,0x0 001b30 e11c BNZ 0x1b6a { C:\Projects\UBW\FW\D_143\user\user.c 001b32 0e02 MOVLW 0x2 if (0 == value) C:\Projects\UBW\FW\D_143\user\user.c 001b34 50db MOVF 0xdb,0x0,0x0 001b36 e10d BNZ 0x1b52 { C:\Projects\UBW\FW\D_143\user\user.c 001b38 0e01 MOVLW 0x1 bitclr (LATC, pin); C:\Projects\UBW\FW\D_143\user\user.c 001b3a 6ef3 MOVWF 0xf3,0x0 001b3c 0e01 MOVLW 0x1 001b3e 50db MOVF 0xdb,0x0,0x0 001b40 e004 BZ 0x1b4a 001b42 90d8 BCF 0xd8,0x0,0x0 001b44 36f3 RLCF 0xf3,0x1,0x0 001b46 06e8 DECF 0xe8,0x1,0x0 001b48 e1fc BNZ 0x1b42 001b4a 50f3 MOVF 0xf3,0x0,0x0 001b4c 1ce8 COMF 0xe8,0x0,0x0 001b4e 168b ANDWF 0x8b,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001b50 d00b BRA 0x1b68 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b52 0e01 MOVLW 0x1 bitset (LATC, pin); C:\Projects\UBW\FW\D_143\user\user.c 001b54 6ef3 MOVWF 0xf3,0x0 001b56 0e01 MOVLW 0x1 001b58 50db MOVF 0xdb,0x0,0x0 001b5a e004 BZ 0x1b64 001b5c 90d8 BCF 0xd8,0x0,0x0 001b5e 36f3 RLCF 0xf3,0x1,0x0 001b60 06e8 DECF 0xe8,0x1,0x0 001b62 e1fc BNZ 0x1b5c 001b64 50f3 MOVF 0xf3,0x0,0x0 001b66 128b IORWF 0x8b,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c #ifdef __18F4550 C:\Projects\UBW\FW\D_143\user\user.c else if ('D' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c if (0 == value) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitclr (LATD, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitset (LATD, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else if ('E' == port) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c if (0 == value) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitclr (LATE, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c bitset (LATE, pin); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c #endif C:\Projects\UBW\FW\D_143\user\user.c 001b68 d002 BRA 0x1b6e else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b6a 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001b6c d001 BRA 0x1b70 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001b6e dc29 RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001b70 0e03 MOVLW 0x3 } C:\Projects\UBW\FW\D_143\user\user.c 001b72 5ce1 SUBWF 0xe1,0x0,0x0 001b74 e202 BC 0x1b7a 001b76 6ae1 CLRF 0xe1,0x0 001b78 52e5 MOVF 0xe5,0x1,0x0 001b7a 6ee1 MOVWF 0xe1,0x0 001b7c 52e5 MOVF 0xe5,0x1,0x0 001b7e cfe7 MOVFF 0xfe7,0xfd9 001b80 ffd9 001b82 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // TX is for Serial Transmit C:\Projects\UBW\FW\D_143\user\user.c // "TX,," C:\Projects\UBW\FW\D_143\user\user.c // is a count of the number of bytes in the field. C:\Projects\UBW\FW\D_143\user\user.c // It must never be larger than the number of bytes that are currently free in the C:\Projects\UBW\FW\D_143\user\user.c // software TX buffer or some data will get lost. C:\Projects\UBW\FW\D_143\user\user.c // are the bytes that you want the UBW to send. It will store them C:\Projects\UBW\FW\D_143\user\user.c // in its software TX buffer until there is time to send them out the TX pin. C:\Projects\UBW\FW\D_143\user\user.c // If you send in "0" for a C:\Projects\UBW\FW\D_143\user\user.c // then the UBW will send back a "TX," packet, C:\Projects\UBW\FW\D_143\user\user.c // where is the number of bytes currently available in the C:\Projects\UBW\FW\D_143\user\user.c // software TX buffer. C:\Projects\UBW\FW\D_143\user\user.c void parse_TX_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b84 dc1e RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001b86 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // RX is for Serial Receive C:\Projects\UBW\FW\D_143\user\user.c // "RX," C:\Projects\UBW\FW\D_143\user\user.c // is the maximum number of characters that you want the UBW to send C:\Projects\UBW\FW\D_143\user\user.c // back to you in the RX packet. If you use "0" for then the UBW C:\Projects\UBW\FW\D_143\user\user.c // will just send you the current number of bytes in it's RX buffer, and if C:\Projects\UBW\FW\D_143\user\user.c // there have been any buffer overruns since the last time a of C:\Projects\UBW\FW\D_143\user\user.c // "0" was received by the UBW. C:\Projects\UBW\FW\D_143\user\user.c // This command will send back a "RX,," C:\Projects\UBW\FW\D_143\user\user.c // or "RX,," packet depending upon if you send C:\Projects\UBW\FW\D_143\user\user.c // "0" or something else for C:\Projects\UBW\FW\D_143\user\user.c // in the returning RX packet is a count of the number of bytes C:\Projects\UBW\FW\D_143\user\user.c // in the field. It will never be more than the C:\Projects\UBW\FW\D_143\user\user.c // you sent in. C:\Projects\UBW\FW\D_143\user\user.c // is the data (in raw form - byte for byte what was received - C:\Projects\UBW\FW\D_143\user\user.c // i.e. not translated in any way, into ASCII values or anything else) that the UBW C:\Projects\UBW\FW\D_143\user\user.c // received. This may include s and NULLs among any other bytes, so make sure C:\Projects\UBW\FW\D_143\user\user.c // your PC application treates the RX packet coming back from the UBW in a speical way C:\Projects\UBW\FW\D_143\user\user.c // so as not to screw up normal packet processing if any special caracters are received. C:\Projects\UBW\FW\D_143\user\user.c // is a valule between 0 and MAX_SERIAL_RX_BUFFER_SIZE that records C:\Projects\UBW\FW\D_143\user\user.c // the total number of bytes, at that point in time, that the UBW is holding, waiting C:\Projects\UBW\FW\D_143\user\user.c // to pass on to the PC. C:\Projects\UBW\FW\D_143\user\user.c // has several bits. C:\Projects\UBW\FW\D_143\user\user.c // Bit 0 = Software RX Buffer Overrun (1 means software RX buffer (on RX pin) C:\Projects\UBW\FW\D_143\user\user.c // has been overrun and data has been lost) This will happen if you don't C:\Projects\UBW\FW\D_143\user\user.c // read the data out of the UWB often enough and the data is coming in too fast. C:\Projects\UBW\FW\D_143\user\user.c // Bit 1 = Software TX Buffer Overrun (1 means software TX buffer (on TX pin) C:\Projects\UBW\FW\D_143\user\user.c // as been overrun and data hs been lost. This will happen if you send too much C:\Projects\UBW\FW\D_143\user\user.c // data to the UBW and you have the serial port set to a low baud rate. C:\Projects\UBW\FW\D_143\user\user.c void parse_RX_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b88 dc1c RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001b8a 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // CX is for setting up serial port parameters C:\Projects\UBW\FW\D_143\user\user.c // TBD C:\Projects\UBW\FW\D_143\user\user.c void parse_CX_packet(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001b8c dc1a RCALL 0x13c2 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001b8e 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // RC is for outputting RC servo pulses on a pin C:\Projects\UBW\FW\D_143\user\user.c // "RC,,," C:\Projects\UBW\FW\D_143\user\user.c // is "A", "B", "C" and indicates the port C:\Projects\UBW\FW\D_143\user\user.c // is a number between 0 and 7 and indicates which pin to output the new value on C:\Projects\UBW\FW\D_143\user\user.c // is an unsigned 16 bit number between 0 and 11890. C:\Projects\UBW\FW\D_143\user\user.c // If is "0" then the RC output on that pin is disabled. C:\Projects\UBW\FW\D_143\user\user.c // Otherwise = 1 means 1ms pulse, = 11890 means 2ms pulse, C:\Projects\UBW\FW\D_143\user\user.c // any value inbetween means proportional pulse values between those two C:\Projects\UBW\FW\D_143\user\user.c // Note: The pin used for RC output must be set as an output, or not much will happen. C:\Projects\UBW\FW\D_143\user\user.c // The RC command will continue to send out pulses at the last set value on C:\Projects\UBW\FW\D_143\user\user.c // each pin that has RC output with a repition rate of 1 pulse about every 19ms. C:\Projects\UBW\FW\D_143\user\user.c // If you have RC output enabled on a pin, outputting a digital value to that pin C:\Projects\UBW\FW\D_143\user\user.c // will be overwritten the next time the RC pulses. Make sure to turn off the RC C:\Projects\UBW\FW\D_143\user\user.c // output if you want to use the pin for something else. C:\Projects\UBW\FW\D_143\user\user.c 001b90 cfd9 MOVFF 0xfd9,0xfe6 void parse_RC_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001b92 ffe6 001b94 cfe1 MOVFF 0xfe1,0xfd9 001b96 ffd9 001b98 0e04 MOVLW 0x4 001b9a 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char port; C:\Projects\UBW\FW\D_143\user\user.c unsigned char pin; C:\Projects\UBW\FW\D_143\user\user.c unsigned int value; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001b9c 0e05 MOVLW 0x5 port = extract_number (kUCASE_ASCII_CHAR); C:\Projects\UBW\FW\D_143\user\user.c 001b9e 6ee6 MOVWF 0xe6,0x0 001ba0 daf8 RCALL 0x2192 001ba2 52e5 MOVF 0xe5,0x1,0x0 001ba4 501d MOVF 0x1d,0x0,0x0 001ba6 6edf MOVWF 0xdf,0x0 001ba8 0e01 MOVLW 0x1 pin = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001baa 6ee6 MOVWF 0xe6,0x0 001bac daf2 RCALL 0x2192 001bae 52e5 MOVF 0xe5,0x1,0x0 001bb0 0e01 MOVLW 0x1 001bb2 c01d MOVFF 0x1d,0xfdb 001bb4 ffdb 001bb6 0e03 MOVLW 0x3 value = extract_number (kUINT); C:\Projects\UBW\FW\D_143\user\user.c 001bb8 6ee6 MOVWF 0xe6,0x0 001bba daeb RCALL 0x2192 001bbc 52e5 MOVF 0xe5,0x1,0x0 001bbe 0e02 MOVLW 0x2 001bc0 c01d MOVFF 0x1d,0xfdb 001bc2 ffdb 001bc4 0e03 MOVLW 0x3 001bc6 c01e MOVFF 0x1e,0xfdb 001bc8 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001bca 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001bcc e001 BZ 0x1bd0 { C:\Projects\UBW\FW\D_143\user\user.c 001bce d07b BRA 0x1cc6 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Max value user can input. (min is zero) C:\Projects\UBW\FW\D_143\user\user.c 001bd0 50d9 MOVF 0xd9,0x0,0x0 if (value > 11890) C:\Projects\UBW\FW\D_143\user\user.c 001bd2 0f02 ADDLW 0x2 001bd4 6ee9 MOVWF 0xe9,0x0 001bd6 cfda MOVFF 0xfda,0xfea 001bd8 ffea 001bda 0e72 MOVLW 0x72 001bdc 80d8 BSF 0xd8,0x0,0x0 001bde 54ee SUBFWB 0xee,0x0,0x0 001be0 0e2e MOVLW 0x2e 001be2 54ed SUBFWB 0xed,0x0,0x0 001be4 e202 BC 0x1bea { C:\Projects\UBW\FW\D_143\user\user.c 001be6 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001be8 d06e BRA 0x1cc6 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Now get Value in the form that TMR0 needs it C:\Projects\UBW\FW\D_143\user\user.c // TMR0 needs to get filled with values from 65490 (1ms) to 53600 (2ms) C:\Projects\UBW\FW\D_143\user\user.c 001bea 50d9 MOVF 0xd9,0x0,0x0 if (value != 0) C:\Projects\UBW\FW\D_143\user\user.c 001bec 0f02 ADDLW 0x2 001bee 6ee9 MOVWF 0xe9,0x0 001bf0 cfda MOVFF 0xfda,0xfea 001bf2 ffea 001bf4 50ee MOVF 0xee,0x0,0x0 001bf6 10ed IORWF 0xed,0x0,0x0 001bf8 e01f BZ 0x1c38 { C:\Projects\UBW\FW\D_143\user\user.c 001bfa 682d SETF 0x2d,0x0 value = (65535 - (value + 45)); C:\Projects\UBW\FW\D_143\user\user.c 001bfc 682e SETF 0x2e,0x0 001bfe 6a2f CLRF 0x2f,0x0 001c00 0e2d MOVLW 0x2d 001c02 6ee7 MOVWF 0xe7,0x0 001c04 0e02 MOVLW 0x2 001c06 cfdb MOVFF 0xfdb,0x30 001c08 f030 001c0a 0e03 MOVLW 0x3 001c0c cfdb MOVFF 0xfdb,0x31 001c0e f031 001c10 50e7 MOVF 0xe7,0x0,0x0 001c12 2630 ADDWF 0x30,0x1,0x0 001c14 0e00 MOVLW 0x0 001c16 2231 ADDWFC 0x31,0x1,0x0 001c18 6a32 CLRF 0x32,0x0 001c1a 5030 MOVF 0x30,0x0,0x0 001c1c 5c2d SUBWF 0x2d,0x0,0x0 001c1e 6e2a MOVWF 0x2a,0x0 001c20 5031 MOVF 0x31,0x0,0x0 001c22 582e SUBWFB 0x2e,0x0,0x0 001c24 6e2b MOVWF 0x2b,0x0 001c26 5032 MOVF 0x32,0x0,0x0 001c28 582f SUBWFB 0x2f,0x0,0x0 001c2a 6e2c MOVWF 0x2c,0x0 001c2c 0e02 MOVLW 0x2 001c2e c02a MOVFF 0x2a,0xfdb 001c30 ffdb 001c32 0e03 MOVLW 0x3 001c34 c02b MOVFF 0x2b,0xfdb 001c36 ffdb } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001c38 0e01 MOVLW 0x1 if (pin > 7) C:\Projects\UBW\FW\D_143\user\user.c 001c3a 50db MOVF 0xdb,0x0,0x0 001c3c 0807 SUBLW 0x7 001c3e e202 BC 0x1c44 { C:\Projects\UBW\FW\D_143\user\user.c 001c40 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001c42 d041 BRA 0x1cc6 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001c44 0e41 MOVLW 0x41 if ('A' == port) C:\Projects\UBW\FW\D_143\user\user.c 001c46 6e2a MOVWF 0x2a,0x0 001c48 50df MOVF 0xdf,0x0,0x0 001c4a 5c2a SUBWF 0x2a,0x0,0x0 001c4c e102 BNZ 0x1c52 { C:\Projects\UBW\FW\D_143\user\user.c 001c4e 6adf CLRF 0xdf,0x0 port = 0; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001c50 d012 BRA 0x1c76 else if ('B' == port) C:\Projects\UBW\FW\D_143\user\user.c 001c52 0e42 MOVLW 0x42 001c54 6e2a MOVWF 0x2a,0x0 001c56 50df MOVF 0xdf,0x0,0x0 001c58 5c2a SUBWF 0x2a,0x0,0x0 001c5a e103 BNZ 0x1c62 { C:\Projects\UBW\FW\D_143\user\user.c 001c5c 0e08 MOVLW 0x8 port = 8; C:\Projects\UBW\FW\D_143\user\user.c 001c5e 6edf MOVWF 0xdf,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001c60 d00a BRA 0x1c76 else if ('C' == port) C:\Projects\UBW\FW\D_143\user\user.c 001c62 0e43 MOVLW 0x43 001c64 6e2a MOVWF 0x2a,0x0 001c66 50df MOVF 0xdf,0x0,0x0 001c68 5c2a SUBWF 0x2a,0x0,0x0 001c6a e103 BNZ 0x1c72 { C:\Projects\UBW\FW\D_143\user\user.c 001c6c 0e10 MOVLW 0x10 port = 16; C:\Projects\UBW\FW\D_143\user\user.c 001c6e 6edf MOVWF 0xdf,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001c70 d002 BRA 0x1c76 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001c72 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001c74 d028 BRA 0x1cc6 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Store the new RC time value C:\Projects\UBW\FW\D_143\user\user.c 001c76 0e01 MOVLW 0x1 g_RC_value[pin + port] = value; C:\Projects\UBW\FW\D_143\user\user.c 001c78 50db MOVF 0xdb,0x0,0x0 001c7a 24df ADDWF 0xdf,0x0,0x0 001c7c 6ee9 MOVWF 0xe9,0x0 001c7e 6aea CLRF 0xea,0x0 001c80 90d8 BCF 0xd8,0x0,0x0 001c82 36e9 RLCF 0xe9,0x1,0x0 001c84 36ea RLCF 0xea,0x1,0x0 001c86 0e69 MOVLW 0x69 001c88 26e9 ADDWF 0xe9,0x1,0x0 001c8a 0e01 MOVLW 0x1 001c8c 22ea ADDWFC 0xea,0x1,0x0 001c8e 0e02 MOVLW 0x2 001c90 cfdb MOVFF 0xfdb,0xfee 001c92 ffee 001c94 0e03 MOVLW 0x3 001c96 cfdb MOVFF 0xfdb,0xfed 001c98 ffed // Only set this state if we are off - if we are already running on C:\Projects\UBW\FW\D_143\user\user.c // this pin, then the new value will be picked up next time around (19ms) C:\Projects\UBW\FW\D_143\user\user.c 001c9a 0e01 MOVLW 0x1 if (kOFF == g_RC_state[pin + port]) C:\Projects\UBW\FW\D_143\user\user.c 001c9c 50db MOVF 0xdb,0x0,0x0 001c9e 24df ADDWF 0xdf,0x0,0x0 001ca0 6aea CLRF 0xea,0x0 001ca2 0f51 ADDLW 0x51 001ca4 6ee9 MOVWF 0xe9,0x0 001ca6 0e01 MOVLW 0x1 001ca8 22ea ADDWFC 0xea,0x1,0x0 001caa 04ef DECF 0xef,0x0,0x0 001cac e10a BNZ 0x1cc2 { C:\Projects\UBW\FW\D_143\user\user.c 001cae 0e01 MOVLW 0x1 g_RC_state[pin + port] = kWAITING; C:\Projects\UBW\FW\D_143\user\user.c 001cb0 50db MOVF 0xdb,0x0,0x0 001cb2 24df ADDWF 0xdf,0x0,0x0 001cb4 6aea CLRF 0xea,0x0 001cb6 0f51 ADDLW 0x51 001cb8 6ee9 MOVWF 0xe9,0x0 001cba 0e01 MOVLW 0x1 001cbc 22ea ADDWFC 0xea,0x1,0x0 001cbe 0e02 MOVLW 0x2 001cc0 6eef MOVWF 0xef,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001cc2 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001cc4 f009 001cc6 0e04 MOVLW 0x4 } C:\Projects\UBW\FW\D_143\user\user.c 001cc8 5ce1 SUBWF 0xe1,0x0,0x0 001cca e202 BC 0x1cd0 001ccc 6ae1 CLRF 0xe1,0x0 001cce 52e5 MOVF 0xe5,0x1,0x0 001cd0 6ee1 MOVWF 0xe1,0x0 001cd2 52e5 MOVF 0xe5,0x1,0x0 001cd4 cfe7 MOVFF 0xfe7,0xfd9 001cd6 ffd9 001cd8 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // BC is for Bulk Configure C:\Projects\UBW\FW\D_143\user\user.c // BC,,,,, C:\Projects\UBW\FW\D_143\user\user.c // This command sets up the mask and strobe bits on port A for the C:\Projects\UBW\FW\D_143\user\user.c // BO (Bulk Output) command below. Also suck in wait delay, strobe delay, etc. C:\Projects\UBW\FW\D_143\user\user.c 001cda cfd9 MOVFF 0xfd9,0xfe6 void parse_BC_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001cdc ffe6 001cde cfe1 MOVFF 0xfe1,0xfd9 001ce0 ffd9 001ce2 0e05 MOVLW 0x5 001ce4 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_init; C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_strobe_mask; C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_wait_mask; C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_strobe_delay; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001ce6 0e01 MOVLW 0x1 BO_init = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001ce8 6ee6 MOVWF 0xe6,0x0 001cea da53 RCALL 0x2192 001cec 52e5 MOVF 0xe5,0x1,0x0 001cee 501d MOVF 0x1d,0x0,0x0 001cf0 6edf MOVWF 0xdf,0x0 001cf2 0e01 MOVLW 0x1 BO_wait_mask = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001cf4 6ee6 MOVWF 0xe6,0x0 001cf6 da4d RCALL 0x2192 001cf8 52e5 MOVF 0xe5,0x1,0x0 001cfa 0e02 MOVLW 0x2 001cfc c01d MOVFF 0x1d,0xfdb 001cfe ffdb 001d00 0e01 MOVLW 0x1 BO_wait_delay = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001d02 6ee6 MOVWF 0xe6,0x0 001d04 da46 RCALL 0x2192 001d06 52e5 MOVF 0xe5,0x1,0x0 001d08 0e03 MOVLW 0x3 001d0a c01d MOVFF 0x1d,0xfdb 001d0c ffdb 001d0e 0e01 MOVLW 0x1 BO_strobe_mask = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001d10 6ee6 MOVWF 0xe6,0x0 001d12 da3f RCALL 0x2192 001d14 52e5 MOVF 0xe5,0x1,0x0 001d16 0e01 MOVLW 0x1 001d18 c01d MOVFF 0x1d,0xfdb 001d1a ffdb 001d1c 0e01 MOVLW 0x1 BO_strobe_delay = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 001d1e 6ee6 MOVWF 0xe6,0x0 001d20 da38 RCALL 0x2192 001d22 52e5 MOVF 0xe5,0x1,0x0 001d24 0e04 MOVLW 0x4 001d26 c01d MOVFF 0x1d,0xfdb 001d28 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Bail if we got a conversion error C:\Projects\UBW\FW\D_143\user\user.c 001d2a 500d MOVF 0xd,0x0,0x0 if (error_byte) C:\Projects\UBW\FW\D_143\user\user.c 001d2c e001 BZ 0x1d30 { C:\Projects\UBW\FW\D_143\user\user.c 001d2e d012 BRA 0x1d54 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Copy over values to their gloabls C:\Projects\UBW\FW\D_143\user\user.c 001d30 cfdf MOVFF 0xfdf,0x1b1 g_BO_init = BO_init; C:\Projects\UBW\FW\D_143\user\user.c 001d32 f1b1 001d34 0e02 MOVLW 0x2 g_BO_wait_mask = BO_wait_mask; C:\Projects\UBW\FW\D_143\user\user.c 001d36 cfdb MOVFF 0xfdb,0x1b3 001d38 f1b3 001d3a 0e01 MOVLW 0x1 g_BO_strobe_mask = BO_strobe_mask; C:\Projects\UBW\FW\D_143\user\user.c 001d3c cfdb MOVFF 0xfdb,0x1b2 001d3e f1b2 001d40 0e03 MOVLW 0x3 g_BO_wait_delay = BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c 001d42 cfdb MOVFF 0xfdb,0x1b4 001d44 f1b4 001d46 0e04 MOVLW 0x4 g_BO_strobe_delay = BO_strobe_delay; C:\Projects\UBW\FW\D_143\user\user.c 001d48 cfdb MOVFF 0xfdb,0x1b5 001d4a f1b5 // And initalize Port A C:\Projects\UBW\FW\D_143\user\user.c 001d4c c1b1 MOVFF 0x1b1,0xf89 LATA = g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c 001d4e ff89 C:\Projects\UBW\FW\D_143\user\user.c 001d50 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001d52 f009 001d54 0e05 MOVLW 0x5 } C:\Projects\UBW\FW\D_143\user\user.c 001d56 5ce1 SUBWF 0xe1,0x0,0x0 001d58 e202 BC 0x1d5e 001d5a 6ae1 CLRF 0xe1,0x0 001d5c 52e5 MOVF 0xe5,0x1,0x0 001d5e 6ee1 MOVWF 0xe1,0x0 001d60 52e5 MOVF 0xe5,0x1,0x0 001d62 cfe7 MOVFF 0xfe7,0xfd9 001d64 ffd9 001d66 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Bulk Output (BO) C:\Projects\UBW\FW\D_143\user\user.c // BO,4AF2C124 C:\Projects\UBW\FW\D_143\user\user.c // After the inital comma, pull in hex values and spit them out to port A C:\Projects\UBW\FW\D_143\user\user.c // Note that the procedure here is as follows: C:\Projects\UBW\FW\D_143\user\user.c // 1) Write new value to PortB C:\Projects\UBW\FW\D_143\user\user.c // 2) Assert C:\Projects\UBW\FW\D_143\user\user.c // 3) Wait for (if not zero) C:\Projects\UBW\FW\D_143\user\user.c // 4) Deassert C:\Projects\UBW\FW\D_143\user\user.c // 5) Wait for to be asserted C:\Projects\UBW\FW\D_143\user\user.c // 6) Wait for to be deasserted C:\Projects\UBW\FW\D_143\user\user.c // 7) If 5) or 6) takes longer than then just move on to next byte C:\Projects\UBW\FW\D_143\user\user.c // Repeat for each byte C:\Projects\UBW\FW\D_143\user\user.c 001d68 cfd9 MOVFF 0xfd9,0xfe6 void parse_BO_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001d6a ffe6 001d6c cfe1 MOVFF 0xfe1,0xfd9 001d6e ffd9 001d70 0e04 MOVLW 0x4 001d72 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_data_byte; C:\Projects\UBW\FW\D_143\user\user.c unsigned char new_port_A_value; C:\Projects\UBW\FW\D_143\user\user.c unsigned char tmp; C:\Projects\UBW\FW\D_143\user\user.c 001d74 0e03 MOVLW 0x3 unsigned char wait_count = 0; C:\Projects\UBW\FW\D_143\user\user.c 001d76 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Check for comma where ptr points C:\Projects\UBW\FW\D_143\user\user.c 001d78 0101 MOVLB 0x1 if (g_RX_buf[g_RX_buf_out] != ',') C:\Projects\UBW\FW\D_143\user\user.c 001d7a 51b9 MOVF 0xb9,0x0,0x1 001d7c 6aea CLRF 0xea,0x0 001d7e 0f40 ADDLW 0x40 001d80 6ee9 MOVWF 0xe9,0x0 001d82 0e02 MOVLW 0x2 001d84 22ea ADDWFC 0xea,0x1,0x0 001d86 50ef MOVF 0xef,0x0,0x0 001d88 082c SUBLW 0x2c 001d8a e01d BZ 0x1dc6 { C:\Projects\UBW\FW\D_143\user\user.c 001d8c 0101 MOVLB 0x1 printf ((far rom char *)"!5 Err: Need comma next, found: '%c'\r\n", g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 001d8e 51b9 MOVF 0xb9,0x0,0x1 001d90 6aea CLRF 0xea,0x0 001d92 0f40 ADDLW 0x40 001d94 6ee9 MOVWF 0xe9,0x0 001d96 0e02 MOVLW 0x2 001d98 22ea ADDWFC 0xea,0x1,0x0 001d9a 50ef MOVF 0xef,0x0,0x0 001d9c 6ee6 MOVWF 0xe6,0x0 001d9e 6ae6 CLRF 0xe6,0x0 001da0 0e28 MOVLW 0x28 001da2 6e2a MOVWF 0x2a,0x0 001da4 0e3f MOVLW 0x3f 001da6 6e2b MOVWF 0x2b,0x0 001da8 6a2c CLRF 0x2c,0x0 001daa c02a MOVFF 0x2a,0xfe6 001dac ffe6 001dae c02b MOVFF 0x2b,0xfe6 001db0 ffe6 001db2 c02c MOVFF 0x2c,0xfe6 001db4 ffe6 001db6 ec5f CALL 0x42be,0x0 001db8 f021 001dba 6e2d MOVWF 0x2d,0x0 001dbc 0e05 MOVLW 0x5 001dbe 5ee1 SUBWF 0xe1,0x1,0x0 001dc0 502d MOVF 0x2d,0x0,0x0 001dc2 8a0d BSF 0xd,0x5,0x0 bitset (error_byte, kERROR_BYTE_PRINTED_ERROR); C:\Projects\UBW\FW\D_143\user\user.c 001dc4 d10e BRA 0x1fe2 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 001dc6 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 001dc8 2bb9 INCF 0xb9,0x1,0x1 001dca 0e40 MOVLW 0x40 001dcc 0101 MOVLB 0x1 001dce 5db9 SUBWF 0xb9,0x0,0x1 001dd0 e102 BNZ 0x1dd6 001dd2 0101 MOVLB 0x1 001dd4 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Make sure Port A is correct C:\Projects\UBW\FW\D_143\user\user.c 001dd6 c1b1 MOVFF 0x1b1,0xf89 LATA = g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c 001dd8 ff89 001dda 0101 MOVLB 0x1 new_port_A_value = ((~LATA & g_BO_strobe_mask)) | (LATA & ~g_BO_strobe_mask); C:\Projects\UBW\FW\D_143\user\user.c 001ddc 1db2 COMF 0xb2,0x0,0x1 001dde 1489 ANDWF 0x89,0x0,0x0 001de0 6e2a MOVWF 0x2a,0x0 001de2 1c89 COMF 0x89,0x0,0x0 001de4 0101 MOVLB 0x1 001de6 15b2 ANDWF 0xb2,0x0,0x1 001de8 102a IORWF 0x2a,0x0,0x0 001dea 6ee7 MOVWF 0xe7,0x0 001dec 0e01 MOVLW 0x1 001dee cfe7 MOVFF 0xfe7,0xfdb 001df0 ffdb C:\Projects\UBW\FW\D_143\user\user.c 001df2 0101 MOVLB 0x1 while (g_RX_buf[g_RX_buf_out] != 13) C:\Projects\UBW\FW\D_143\user\user.c 001df4 51b9 MOVF 0xb9,0x0,0x1 001df6 6aea CLRF 0xea,0x0 001df8 0f40 ADDLW 0x40 001dfa 6ee9 MOVWF 0xe9,0x0 001dfc 0e02 MOVLW 0x2 001dfe 22ea ADDWFC 0xea,0x1,0x0 001e00 50ef MOVF 0xef,0x0,0x0 001e02 080d SUBLW 0xd 001e04 e101 BNZ 0x1e08 001e06 d0eb BRA 0x1fde 001fdc d70a BRA 0x1df2 { C:\Projects\UBW\FW\D_143\user\user.c // Pull in a nibble from the input buffer C:\Projects\UBW\FW\D_143\user\user.c 001e08 0101 MOVLB 0x1 tmp = toupper (g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 001e0a 51b9 MOVF 0xb9,0x0,0x1 001e0c 6aea CLRF 0xea,0x0 001e0e 0f40 ADDLW 0x40 001e10 6ee9 MOVWF 0xe9,0x0 001e12 0e02 MOVLW 0x2 001e14 22ea ADDWFC 0xea,0x1,0x0 001e16 50ef MOVF 0xef,0x0,0x0 001e18 6ee6 MOVWF 0xe6,0x0 001e1a 6ae6 CLRF 0xe6,0x0 001e1c ec58 CALL 0x44b0,0x0 001e1e f022 001e20 52e5 MOVF 0xe5,0x1,0x0 001e22 52e5 MOVF 0xe5,0x1,0x0 001e24 0e02 MOVLW 0x2 001e26 cff3 MOVFF 0xff3,0xfdb 001e28 ffdb 001e2a 0e30 MOVLW 0x30 if (tmp >= '0' && tmp <= '9') C:\Projects\UBW\FW\D_143\user\user.c 001e2c 6ef3 MOVWF 0xf3,0x0 001e2e 0e02 MOVLW 0x2 001e30 cfdb MOVFF 0xfdb,0xff4 001e32 fff4 001e34 50f3 MOVF 0xf3,0x0,0x0 001e36 5cf4 SUBWF 0xf4,0x0,0x0 001e38 e30f BNC 0x1e58 001e3a 0e02 MOVLW 0x2 001e3c 50db MOVF 0xdb,0x0,0x0 001e3e 0839 SUBLW 0x39 001e40 e30b BNC 0x1e58 { C:\Projects\UBW\FW\D_143\user\user.c 001e42 0e30 MOVLW 0x30 tmp -= '0'; C:\Projects\UBW\FW\D_143\user\user.c 001e44 6e2a MOVWF 0x2a,0x0 001e46 0e02 MOVLW 0x2 001e48 cfdb MOVFF 0xfdb,0xfe7 001e4a ffe7 001e4c 502a MOVF 0x2a,0x0,0x0 001e4e 5ee7 SUBWF 0xe7,0x1,0x0 001e50 0e02 MOVLW 0x2 001e52 cfe7 MOVFF 0xfe7,0xfdb 001e54 ffdb } C:\Projects\UBW\FW\D_143\user\user.c 001e56 d019 BRA 0x1e8a else if (tmp >= 'A' && tmp <= 'F') C:\Projects\UBW\FW\D_143\user\user.c 001e58 0e41 MOVLW 0x41 001e5a 6ef3 MOVWF 0xf3,0x0 001e5c 0e02 MOVLW 0x2 001e5e cfdb MOVFF 0xfdb,0xff4 001e60 fff4 001e62 50f3 MOVF 0xf3,0x0,0x0 001e64 5cf4 SUBWF 0xf4,0x0,0x0 001e66 e30f BNC 0x1e86 001e68 0e02 MOVLW 0x2 001e6a 50db MOVF 0xdb,0x0,0x0 001e6c 0846 SUBLW 0x46 001e6e e30b BNC 0x1e86 { C:\Projects\UBW\FW\D_143\user\user.c 001e70 0e37 MOVLW 0x37 tmp -= 55; C:\Projects\UBW\FW\D_143\user\user.c 001e72 6e2a MOVWF 0x2a,0x0 001e74 0e02 MOVLW 0x2 001e76 cfdb MOVFF 0xfdb,0xfe7 001e78 ffe7 001e7a 502a MOVF 0x2a,0x0,0x0 001e7c 5ee7 SUBWF 0xe7,0x1,0x0 001e7e 0e02 MOVLW 0x2 001e80 cfe7 MOVFF 0xfe7,0xfdb 001e82 ffdb } C:\Projects\UBW\FW\D_143\user\user.c 001e84 d002 BRA 0x1e8a else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001e86 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001e88 d0ac BRA 0x1fe2 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001e8a 0e02 MOVLW 0x2 BO_data_byte = tmp << 4; C:\Projects\UBW\FW\D_143\user\user.c 001e8c 38db SWAPF 0xdb,0x0,0x0 001e8e 0bf0 ANDLW 0xf0 001e90 6edf MOVWF 0xdf,0x0 001e92 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 001e94 2bb9 INCF 0xb9,0x1,0x1 001e96 0e40 MOVLW 0x40 001e98 0101 MOVLB 0x1 001e9a 5db9 SUBWF 0xb9,0x0,0x1 001e9c e102 BNZ 0x1ea2 001e9e 0101 MOVLB 0x1 001ea0 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Check for CR next C:\Projects\UBW\FW\D_143\user\user.c 001ea2 0e0d MOVLW 0xd if (kCR == g_RX_buf[g_RX_buf_out]) C:\Projects\UBW\FW\D_143\user\user.c 001ea4 6e2a MOVWF 0x2a,0x0 001ea6 0101 MOVLB 0x1 001ea8 51b9 MOVF 0xb9,0x0,0x1 001eaa 6aea CLRF 0xea,0x0 001eac 0f40 ADDLW 0x40 001eae 6ee9 MOVWF 0xe9,0x0 001eb0 0e02 MOVLW 0x2 001eb2 22ea ADDWFC 0xea,0x1,0x0 001eb4 50ef MOVF 0xef,0x0,0x0 001eb6 5c2a SUBWF 0x2a,0x0,0x0 001eb8 e102 BNZ 0x1ebe { C:\Projects\UBW\FW\D_143\user\user.c 001eba 880d BSF 0xd,0x4,0x0 bitset (error_byte, kERROR_BYTE_MISSING_PARAMETER); C:\Projects\UBW\FW\D_143\user\user.c 001ebc d092 BRA 0x1fe2 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 001ebe 0101 MOVLB 0x1 tmp = toupper (g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 001ec0 51b9 MOVF 0xb9,0x0,0x1 001ec2 6aea CLRF 0xea,0x0 001ec4 0f40 ADDLW 0x40 001ec6 6ee9 MOVWF 0xe9,0x0 001ec8 0e02 MOVLW 0x2 001eca 22ea ADDWFC 0xea,0x1,0x0 001ecc 50ef MOVF 0xef,0x0,0x0 001ece 6ee6 MOVWF 0xe6,0x0 001ed0 6ae6 CLRF 0xe6,0x0 001ed2 ec58 CALL 0x44b0,0x0 001ed4 f022 001ed6 52e5 MOVF 0xe5,0x1,0x0 001ed8 52e5 MOVF 0xe5,0x1,0x0 001eda 0e02 MOVLW 0x2 001edc cff3 MOVFF 0xff3,0xfdb 001ede ffdb 001ee0 0e30 MOVLW 0x30 if (tmp >= '0' && tmp <= '9') C:\Projects\UBW\FW\D_143\user\user.c 001ee2 6ef3 MOVWF 0xf3,0x0 001ee4 0e02 MOVLW 0x2 001ee6 cfdb MOVFF 0xfdb,0xff4 001ee8 fff4 001eea 50f3 MOVF 0xf3,0x0,0x0 001eec 5cf4 SUBWF 0xf4,0x0,0x0 001eee e30f BNC 0x1f0e 001ef0 0e02 MOVLW 0x2 001ef2 50db MOVF 0xdb,0x0,0x0 001ef4 0839 SUBLW 0x39 001ef6 e30b BNC 0x1f0e { C:\Projects\UBW\FW\D_143\user\user.c 001ef8 0e30 MOVLW 0x30 tmp -= '0'; C:\Projects\UBW\FW\D_143\user\user.c 001efa 6e2a MOVWF 0x2a,0x0 001efc 0e02 MOVLW 0x2 001efe cfdb MOVFF 0xfdb,0xfe7 001f00 ffe7 001f02 502a MOVF 0x2a,0x0,0x0 001f04 5ee7 SUBWF 0xe7,0x1,0x0 001f06 0e02 MOVLW 0x2 001f08 cfe7 MOVFF 0xfe7,0xfdb 001f0a ffdb } C:\Projects\UBW\FW\D_143\user\user.c 001f0c d019 BRA 0x1f40 else if (tmp >= 'A' && tmp <= 'F') C:\Projects\UBW\FW\D_143\user\user.c 001f0e 0e41 MOVLW 0x41 001f10 6ef3 MOVWF 0xf3,0x0 001f12 0e02 MOVLW 0x2 001f14 cfdb MOVFF 0xfdb,0xff4 001f16 fff4 001f18 50f3 MOVF 0xf3,0x0,0x0 001f1a 5cf4 SUBWF 0xf4,0x0,0x0 001f1c e30f BNC 0x1f3c 001f1e 0e02 MOVLW 0x2 001f20 50db MOVF 0xdb,0x0,0x0 001f22 0846 SUBLW 0x46 001f24 e30b BNC 0x1f3c { C:\Projects\UBW\FW\D_143\user\user.c 001f26 0e37 MOVLW 0x37 tmp -= 55; C:\Projects\UBW\FW\D_143\user\user.c 001f28 6e2a MOVWF 0x2a,0x0 001f2a 0e02 MOVLW 0x2 001f2c cfdb MOVFF 0xfdb,0xfe7 001f2e ffe7 001f30 502a MOVF 0x2a,0x0,0x0 001f32 5ee7 SUBWF 0xe7,0x1,0x0 001f34 0e02 MOVLW 0x2 001f36 cfe7 MOVFF 0xfe7,0xfdb 001f38 ffdb } C:\Projects\UBW\FW\D_143\user\user.c 001f3a d002 BRA 0x1f40 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 001f3c 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 001f3e d051 BRA 0x1fe2 return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001f40 0e02 MOVLW 0x2 BO_data_byte = BO_data_byte + tmp; C:\Projects\UBW\FW\D_143\user\user.c 001f42 50db MOVF 0xdb,0x0,0x0 001f44 24df ADDWF 0xdf,0x0,0x0 001f46 6edf MOVWF 0xdf,0x0 001f48 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 001f4a 2bb9 INCF 0xb9,0x1,0x1 001f4c 0e40 MOVLW 0x40 001f4e 0101 MOVLB 0x1 001f50 5db9 SUBWF 0xb9,0x0,0x1 001f52 e102 BNZ 0x1f58 001f54 0101 MOVLB 0x1 001f56 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Output the byte on Port B C:\Projects\UBW\FW\D_143\user\user.c 001f58 50df MOVF 0xdf,0x0,0x0 LATB = BO_data_byte; C:\Projects\UBW\FW\D_143\user\user.c 001f5a 6e8a MOVWF 0x8a,0x0 C:\Projects\UBW\FW\D_143\user\user.c // And strobe the Port A bits that we're supposed to C:\Projects\UBW\FW\D_143\user\user.c 001f5c 0e01 MOVLW 0x1 LATA = new_port_A_value; C:\Projects\UBW\FW\D_143\user\user.c 001f5e 50db MOVF 0xdb,0x0,0x0 001f60 6e89 MOVWF 0x89,0x0 001f62 0101 MOVLB 0x1 if (g_BO_strobe_delay) C:\Projects\UBW\FW\D_143\user\user.c 001f64 51b5 MOVF 0xb5,0x0,0x1 001f66 e005 BZ 0x1f72 { C:\Projects\UBW\FW\D_143\user\user.c 001f68 c1b5 MOVFF 0x1b5,0xfe6 Delay10TCYx (g_BO_strobe_delay); C:\Projects\UBW\FW\D_143\user\user.c 001f6a ffe6 001f6c ece9 CALL 0x45d2,0x0 001f6e f022 001f70 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 001f72 c1b1 MOVFF 0x1b1,0xf89 LATA = g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c 001f74 ff89 C:\Projects\UBW\FW\D_143\user\user.c 001f76 0101 MOVLB 0x1 if (g_BO_wait_delay) C:\Projects\UBW\FW\D_143\user\user.c 001f78 51b4 MOVF 0xb4,0x0,0x1 001f7a e030 BZ 0x1fdc { C:\Projects\UBW\FW\D_143\user\user.c // Now we spin on the wait bit specified in WaitMask C:\Projects\UBW\FW\D_143\user\user.c // (Used for Busy Bits) We also have to wait here C:\Projects\UBW\FW\D_143\user\user.c // for a maximum of g_BO_wait_delay, which is in 10 clock units C:\Projects\UBW\FW\D_143\user\user.c // First we wait for the wait mask to become asserted C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Set the wait counter to the number of delays we want C:\Projects\UBW\FW\D_143\user\user.c 001f7c 0e03 MOVLW 0x3 wait_count = g_BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c 001f7e c1b4 MOVFF 0x1b4,0xfdb 001f80 ffdb 001faa d7eb BRA 0x1f82 while ( C:\Projects\UBW\FW\D_143\user\user.c 001f82 0101 MOVLB 0x1 ((g_BO_init & g_BO_wait_mask) == (PORTA & g_BO_wait_mask)) C:\Projects\UBW\FW\D_143\user\user.c 001f84 51b1 MOVF 0xb1,0x0,0x1 001f86 0101 MOVLB 0x1 001f88 15b3 ANDWF 0xb3,0x0,0x1 001f8a 6e2a MOVWF 0x2a,0x0 001f8c 0101 MOVLB 0x1 001f8e 51b3 MOVF 0xb3,0x0,0x1 001f90 1480 ANDWF 0x80,0x0,0x0 001f92 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 001f96 0e03 MOVLW 0x3 (wait_count != 0) C:\Projects\UBW\FW\D_143\user\user.c 001f98 50db MOVF 0xdb,0x0,0x0 001f94 e10b BNZ 0x1fac ) C:\Projects\UBW\FW\D_143\user\user.c 001f9a e008 BZ 0x1fac { C:\Projects\UBW\FW\D_143\user\user.c 001f9c 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001f9e 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fa0 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fa2 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fa4 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fa6 0e03 MOVLW 0x3 wait_count--; C:\Projects\UBW\FW\D_143\user\user.c 001fa8 06db DECF 0xdb,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Set the wait counter to the number of delays we want C:\Projects\UBW\FW\D_143\user\user.c 001fac 0e03 MOVLW 0x3 wait_count = g_BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c 001fae c1b4 MOVFF 0x1b4,0xfdb 001fb0 ffdb // Then we wait for the wait mask to become de-asserted C:\Projects\UBW\FW\D_143\user\user.c 001fda d7eb BRA 0x1fb2 while ( C:\Projects\UBW\FW\D_143\user\user.c 001fb2 0101 MOVLB 0x1 ((g_BO_init & g_BO_wait_mask) != (PORTA & g_BO_wait_mask)) C:\Projects\UBW\FW\D_143\user\user.c 001fb4 51b1 MOVF 0xb1,0x0,0x1 001fb6 0101 MOVLB 0x1 001fb8 15b3 ANDWF 0xb3,0x0,0x1 001fba 6e2a MOVWF 0x2a,0x0 001fbc 0101 MOVLB 0x1 001fbe 51b3 MOVF 0xb3,0x0,0x1 001fc0 1480 ANDWF 0x80,0x0,0x0 001fc2 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 001fc6 0e03 MOVLW 0x3 (wait_count != 0) C:\Projects\UBW\FW\D_143\user\user.c 001fc8 50db MOVF 0xdb,0x0,0x0 001fc4 e00b BZ 0x1fdc ) C:\Projects\UBW\FW\D_143\user\user.c 001fca e008 BZ 0x1fdc { C:\Projects\UBW\FW\D_143\user\user.c 001fcc 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fce 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fd0 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fd2 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fd4 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 001fd6 0e03 MOVLW 0x3 wait_count--; C:\Projects\UBW\FW\D_143\user\user.c 001fd8 06db DECF 0xdb,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 001fde ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 001fe0 f009 001fe2 0e04 MOVLW 0x4 } C:\Projects\UBW\FW\D_143\user\user.c 001fe4 5ce1 SUBWF 0xe1,0x0,0x0 001fe6 e202 BC 0x1fec 001fe8 6ae1 CLRF 0xe1,0x0 001fea 52e5 MOVF 0xe5,0x1,0x0 001fec 6ee1 MOVWF 0xe1,0x0 001fee 52e5 MOVF 0xe5,0x1,0x0 001ff0 cfe7 MOVFF 0xfe7,0xfd9 001ff2 ffd9 001ff4 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Bulk Stream (BS) (he he, couldn't think of a better name) C:\Projects\UBW\FW\D_143\user\user.c // BS,, C:\Projects\UBW\FW\D_143\user\user.c // This command is extremely similar to the BO command C:\Projects\UBW\FW\D_143\user\user.c // except that instead of ASCII HEX values, it actually C:\Projects\UBW\FW\D_143\user\user.c // takes raw binary data. C:\Projects\UBW\FW\D_143\user\user.c // So in order for the UBW to know when the end of the stream C:\Projects\UBW\FW\D_143\user\user.c // is, we need to have a of bytes. C:\Projects\UBW\FW\D_143\user\user.c // represents the number of bytes after the second comma C:\Projects\UBW\FW\D_143\user\user.c // that will be the actual binary data to be streamed out port B. C:\Projects\UBW\FW\D_143\user\user.c // Then, must be exactly that length. C:\Projects\UBW\FW\D_143\user\user.c // must be between 1 and 56 (currently - in the future C:\Projects\UBW\FW\D_143\user\user.c // it would be nice to extend the upper limit) C:\Projects\UBW\FW\D_143\user\user.c // The UBW will pull in one byte at a time within the C:\Projects\UBW\FW\D_143\user\user.c // section and output it to PORTB exactly as the BO command does. C:\Projects\UBW\FW\D_143\user\user.c // It will do this for bytes. It will then pull in another C:\Projects\UBW\FW\D_143\user\user.c // byte (which must be a carrige return) and be done. C:\Projects\UBW\FW\D_143\user\user.c // The whole point of this command is to improve data throughput C:\Projects\UBW\FW\D_143\user\user.c // from the PC to the UBW. This form of data is also more efficient C:\Projects\UBW\FW\D_143\user\user.c // for the UBW to process. C:\Projects\UBW\FW\D_143\user\user.c 001ff6 cfd9 MOVFF 0xfd9,0xfe6 void parse_BS_packet(void) C:\Projects\UBW\FW\D_143\user\user.c 001ff8 ffe6 001ffa cfe1 MOVFF 0xfe1,0xfd9 001ffc ffd9 001ffe 0e05 MOVLW 0x5 002000 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char BO_data_byte; C:\Projects\UBW\FW\D_143\user\user.c unsigned char new_port_A_value; C:\Projects\UBW\FW\D_143\user\user.c unsigned char tmp; C:\Projects\UBW\FW\D_143\user\user.c 002002 0e03 MOVLW 0x3 unsigned char wait_count = 0; C:\Projects\UBW\FW\D_143\user\user.c 002004 6adb CLRF 0xdb,0x0 002006 0e04 MOVLW 0x4 unsigned char byte_count = 0; C:\Projects\UBW\FW\D_143\user\user.c 002008 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Get byte_count C:\Projects\UBW\FW\D_143\user\user.c 00200a 0e01 MOVLW 0x1 byte_count = extract_number (kUCHAR); C:\Projects\UBW\FW\D_143\user\user.c 00200c 6ee6 MOVWF 0xe6,0x0 00200e d8c1 RCALL 0x2192 002010 52e5 MOVF 0xe5,0x1,0x0 002012 0e04 MOVLW 0x4 002014 c01d MOVFF 0x1d,0xfdb 002016 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Limit check it C:\Projects\UBW\FW\D_143\user\user.c 002018 0e04 MOVLW 0x4 if (0 == byte_count || byte_count > 56) C:\Projects\UBW\FW\D_143\user\user.c 00201a 50db MOVF 0xdb,0x0,0x0 00201c e004 BZ 0x2026 00201e 0e04 MOVLW 0x4 002020 50db MOVF 0xdb,0x0,0x0 002022 0838 SUBLW 0x38 002024 e202 BC 0x202a { C:\Projects\UBW\FW\D_143\user\user.c 002026 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 002028 d098 BRA 0x215a return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Check for comma where ptr points C:\Projects\UBW\FW\D_143\user\user.c 00202a 0101 MOVLB 0x1 if (g_RX_buf[g_RX_buf_out] != ',') C:\Projects\UBW\FW\D_143\user\user.c 00202c 51b9 MOVF 0xb9,0x0,0x1 00202e 6aea CLRF 0xea,0x0 002030 0f40 ADDLW 0x40 002032 6ee9 MOVWF 0xe9,0x0 002034 0e02 MOVLW 0x2 002036 22ea ADDWFC 0xea,0x1,0x0 002038 50ef MOVF 0xef,0x0,0x0 00203a 082c SUBLW 0x2c 00203c e01d BZ 0x2078 { C:\Projects\UBW\FW\D_143\user\user.c 00203e 0101 MOVLB 0x1 printf ((far rom char *)"!5 Err: Need comma next, found: '%c'\r\n", g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 002040 51b9 MOVF 0xb9,0x0,0x1 002042 6aea CLRF 0xea,0x0 002044 0f40 ADDLW 0x40 002046 6ee9 MOVWF 0xe9,0x0 002048 0e02 MOVLW 0x2 00204a 22ea ADDWFC 0xea,0x1,0x0 00204c 50ef MOVF 0xef,0x0,0x0 00204e 6ee6 MOVWF 0xe6,0x0 002050 6ae6 CLRF 0xe6,0x0 002052 0e28 MOVLW 0x28 002054 6e2a MOVWF 0x2a,0x0 002056 0e3f MOVLW 0x3f 002058 6e2b MOVWF 0x2b,0x0 00205a 6a2c CLRF 0x2c,0x0 00205c c02a MOVFF 0x2a,0xfe6 00205e ffe6 002060 c02b MOVFF 0x2b,0xfe6 002062 ffe6 002064 c02c MOVFF 0x2c,0xfe6 002066 ffe6 002068 ec5f CALL 0x42be,0x0 00206a f021 00206c 6e2d MOVWF 0x2d,0x0 00206e 0e05 MOVLW 0x5 002070 5ee1 SUBWF 0xe1,0x1,0x0 002072 502d MOVF 0x2d,0x0,0x0 002074 8a0d BSF 0xd,0x5,0x0 bitset (error_byte, kERROR_BYTE_PRINTED_ERROR); C:\Projects\UBW\FW\D_143\user\user.c 002076 d071 BRA 0x215a return; C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 002078 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 00207a 2bb9 INCF 0xb9,0x1,0x1 00207c 0e40 MOVLW 0x40 00207e 0101 MOVLB 0x1 002080 5db9 SUBWF 0xb9,0x0,0x1 002082 e102 BNZ 0x2088 002084 0101 MOVLB 0x1 002086 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Make sure Port A is correct C:\Projects\UBW\FW\D_143\user\user.c 002088 c1b1 MOVFF 0x1b1,0xf89 LATA = g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c 00208a ff89 00208c 0101 MOVLB 0x1 new_port_A_value = ((~LATA & g_BO_strobe_mask)) | (LATA & ~g_BO_strobe_mask); C:\Projects\UBW\FW\D_143\user\user.c 00208e 1db2 COMF 0xb2,0x0,0x1 002090 1489 ANDWF 0x89,0x0,0x0 002092 6e2a MOVWF 0x2a,0x0 002094 1c89 COMF 0x89,0x0,0x0 002096 0101 MOVLB 0x1 002098 15b2 ANDWF 0xb2,0x0,0x1 00209a 102a IORWF 0x2a,0x0,0x0 00209c 6ee7 MOVWF 0xe7,0x0 00209e 0e01 MOVLW 0x1 0020a0 cfe7 MOVFF 0xfe7,0xfdb 0020a2 ffdb C:\Projects\UBW\FW\D_143\user\user.c 0020a4 0e04 MOVLW 0x4 while (byte_count != 0) C:\Projects\UBW\FW\D_143\user\user.c 0020a6 50db MOVF 0xdb,0x0,0x0 0020a8 e056 BZ 0x2156 002154 d7a7 BRA 0x20a4 { C:\Projects\UBW\FW\D_143\user\user.c // Pull in a single byte from input buffer C:\Projects\UBW\FW\D_143\user\user.c 0020aa 0101 MOVLB 0x1 BO_data_byte = g_RX_buf[g_RX_buf_out]; C:\Projects\UBW\FW\D_143\user\user.c 0020ac 51b9 MOVF 0xb9,0x0,0x1 0020ae 6aea CLRF 0xea,0x0 0020b0 0f40 ADDLW 0x40 0020b2 6ee9 MOVWF 0xe9,0x0 0020b4 0e02 MOVLW 0x2 0020b6 22ea ADDWFC 0xea,0x1,0x0 0020b8 cfef MOVFF 0xfef,0xfdf 0020ba ffdf 0020bc 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 0020be 2bb9 INCF 0xb9,0x1,0x1 0020c0 0e40 MOVLW 0x40 0020c2 0101 MOVLB 0x1 0020c4 5db9 SUBWF 0xb9,0x0,0x1 0020c6 e102 BNZ 0x20cc 0020c8 0101 MOVLB 0x1 0020ca 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Count this byte C:\Projects\UBW\FW\D_143\user\user.c 0020cc 0e04 MOVLW 0x4 byte_count--; C:\Projects\UBW\FW\D_143\user\user.c 0020ce 06db DECF 0xdb,0x1,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Output the byte on Port B C:\Projects\UBW\FW\D_143\user\user.c 0020d0 50df MOVF 0xdf,0x0,0x0 LATB = BO_data_byte; C:\Projects\UBW\FW\D_143\user\user.c 0020d2 6e8a MOVWF 0x8a,0x0 C:\Projects\UBW\FW\D_143\user\user.c // And strobe the Port A bits that we're supposed to C:\Projects\UBW\FW\D_143\user\user.c 0020d4 0e01 MOVLW 0x1 LATA = new_port_A_value; C:\Projects\UBW\FW\D_143\user\user.c 0020d6 50db MOVF 0xdb,0x0,0x0 0020d8 6e89 MOVWF 0x89,0x0 0020da 0101 MOVLB 0x1 if (g_BO_strobe_delay) C:\Projects\UBW\FW\D_143\user\user.c 0020dc 51b5 MOVF 0xb5,0x0,0x1 0020de e005 BZ 0x20ea { C:\Projects\UBW\FW\D_143\user\user.c 0020e0 c1b5 MOVFF 0x1b5,0xfe6 Delay10TCYx (g_BO_strobe_delay); C:\Projects\UBW\FW\D_143\user\user.c 0020e2 ffe6 0020e4 ece9 CALL 0x45d2,0x0 0020e6 f022 0020e8 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0020ea c1b1 MOVFF 0x1b1,0xf89 LATA = g_BO_init; C:\Projects\UBW\FW\D_143\user\user.c 0020ec ff89 C:\Projects\UBW\FW\D_143\user\user.c 0020ee 0101 MOVLB 0x1 if (g_BO_wait_delay) C:\Projects\UBW\FW\D_143\user\user.c 0020f0 51b4 MOVF 0xb4,0x0,0x1 0020f2 e030 BZ 0x2154 { C:\Projects\UBW\FW\D_143\user\user.c // Now we spin on the wait bit specified in WaitMask C:\Projects\UBW\FW\D_143\user\user.c // (Used for Busy Bits) We also have to wait here C:\Projects\UBW\FW\D_143\user\user.c // for a maximum of g_BO_wait_delay, which is in 10 clock units C:\Projects\UBW\FW\D_143\user\user.c // First we wait for the wait mask to become asserted C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Set the wait counter to the number of delays we want C:\Projects\UBW\FW\D_143\user\user.c 0020f4 0e03 MOVLW 0x3 wait_count = g_BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c 0020f6 c1b4 MOVFF 0x1b4,0xfdb 0020f8 ffdb 002122 d7eb BRA 0x20fa while ( C:\Projects\UBW\FW\D_143\user\user.c 0020fa 0101 MOVLB 0x1 ((g_BO_init & g_BO_wait_mask) == (PORTA & g_BO_wait_mask)) C:\Projects\UBW\FW\D_143\user\user.c 0020fc 51b1 MOVF 0xb1,0x0,0x1 0020fe 0101 MOVLB 0x1 002100 15b3 ANDWF 0xb3,0x0,0x1 002102 6e2a MOVWF 0x2a,0x0 002104 0101 MOVLB 0x1 002106 51b3 MOVF 0xb3,0x0,0x1 002108 1480 ANDWF 0x80,0x0,0x0 00210a 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 00210e 0e03 MOVLW 0x3 (wait_count != 0) C:\Projects\UBW\FW\D_143\user\user.c 002110 50db MOVF 0xdb,0x0,0x0 00210c e10b BNZ 0x2124 ) C:\Projects\UBW\FW\D_143\user\user.c 002112 e008 BZ 0x2124 { C:\Projects\UBW\FW\D_143\user\user.c 002114 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 002116 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 002118 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00211a 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00211c 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00211e 0e03 MOVLW 0x3 wait_count--; C:\Projects\UBW\FW\D_143\user\user.c 002120 06db DECF 0xdb,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Set the wait counter to the number of delays we want C:\Projects\UBW\FW\D_143\user\user.c 002124 0e03 MOVLW 0x3 wait_count = g_BO_wait_delay; C:\Projects\UBW\FW\D_143\user\user.c 002126 c1b4 MOVFF 0x1b4,0xfdb 002128 ffdb // Then we wait for the wait mask to become de-asserted C:\Projects\UBW\FW\D_143\user\user.c 002152 d7eb BRA 0x212a while ( C:\Projects\UBW\FW\D_143\user\user.c 00212a 0101 MOVLB 0x1 ((g_BO_init & g_BO_wait_mask) != (PORTA & g_BO_wait_mask)) C:\Projects\UBW\FW\D_143\user\user.c 00212c 51b1 MOVF 0xb1,0x0,0x1 00212e 0101 MOVLB 0x1 002130 15b3 ANDWF 0xb3,0x0,0x1 002132 6e2a MOVWF 0x2a,0x0 002134 0101 MOVLB 0x1 002136 51b3 MOVF 0xb3,0x0,0x1 002138 1480 ANDWF 0x80,0x0,0x0 00213a 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 00213e 0e03 MOVLW 0x3 (wait_count != 0) C:\Projects\UBW\FW\D_143\user\user.c 002140 50db MOVF 0xdb,0x0,0x0 00213c e00b BZ 0x2154 ) C:\Projects\UBW\FW\D_143\user\user.c 002142 e008 BZ 0x2154 { C:\Projects\UBW\FW\D_143\user\user.c 002144 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 002146 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 002148 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00214a 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00214c 0000 NOP Delay1TCY (); C:\Projects\UBW\FW\D_143\user\user.c 00214e 0e03 MOVLW 0x3 wait_count--; C:\Projects\UBW\FW\D_143\user\user.c 002150 06db DECF 0xdb,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 002156 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 002158 f009 00215a 0e05 MOVLW 0x5 } C:\Projects\UBW\FW\D_143\user\user.c 00215c 5ce1 SUBWF 0xe1,0x0,0x0 00215e e202 BC 0x2164 002160 6ae1 CLRF 0xe1,0x0 002162 52e5 MOVF 0xe5,0x1,0x0 002164 6ee1 MOVWF 0xe1,0x0 002166 52e5 MOVF 0xe5,0x1,0x0 002168 cfe7 MOVFF 0xfe7,0xfd9 00216a ffd9 00216c 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // SS Send SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_SS_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00216e ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 002170 f009 C:\Projects\UBW\FW\D_143\user\user.c 002172 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // RS Receive SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_RS_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002174 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 002176 f009 C:\Projects\UBW\FW\D_143\user\user.c 002178 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // CS Configure SPI C:\Projects\UBW\FW\D_143\user\user.c void parse_CS_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00217a ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 00217c f009 C:\Projects\UBW\FW\D_143\user\user.c 00217e 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // SI Send I2C C:\Projects\UBW\FW\D_143\user\user.c void parse_SI_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002180 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 002182 f009 C:\Projects\UBW\FW\D_143\user\user.c 002184 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // RI Receive I2C C:\Projects\UBW\FW\D_143\user\user.c void parse_RI_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002186 ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 002188 f009 C:\Projects\UBW\FW\D_143\user\user.c 00218a 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // CI Configure I2C C:\Projects\UBW\FW\D_143\user\user.c void parse_CI_packet (void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 00218c ece1 CALL 0x13c2,0x0 print_ack (); C:\Projects\UBW\FW\D_143\user\user.c 00218e f009 C:\Projects\UBW\FW\D_143\user\user.c 002190 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Look at the string pointed to by ptr C:\Projects\UBW\FW\D_143\user\user.c // There should be a comma where ptr points to upon entry. C:\Projects\UBW\FW\D_143\user\user.c // If not, throw a comma error. C:\Projects\UBW\FW\D_143\user\user.c // If so, then look for up to three bytes after the C:\Projects\UBW\FW\D_143\user\user.c // comma for numbers, and put them all into one C:\Projects\UBW\FW\D_143\user\user.c // byte (0-255). If the number is greater than 255, then C:\Projects\UBW\FW\D_143\user\user.c // thow a range error. C:\Projects\UBW\FW\D_143\user\user.c // Advance the pointer to the byte after the last number C:\Projects\UBW\FW\D_143\user\user.c // and return. C:\Projects\UBW\FW\D_143\user\user.c 002192 cfd9 MOVFF 0xfd9,0xfe6 signed short long extract_number(tExtractType type) C:\Projects\UBW\FW\D_143\user\user.c 002194 ffe6 002196 cfe1 MOVFF 0xfe1,0xfd9 002198 ffd9 00219a 0e04 MOVLW 0x4 00219c 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c signed short long acc; C:\Projects\UBW\FW\D_143\user\user.c 00219e 0e03 MOVLW 0x3 unsigned char neg = FALSE; C:\Projects\UBW\FW\D_143\user\user.c 0021a0 6adb CLRF 0xdb,0x0 C:\Projects\UBW\FW\D_143\user\user.c // Check to see if we're already at the end C:\Projects\UBW\FW\D_143\user\user.c 0021a2 0e0d MOVLW 0xd if (kCR == g_RX_buf[g_RX_buf_out]) C:\Projects\UBW\FW\D_143\user\user.c 0021a4 6e2a MOVWF 0x2a,0x0 0021a6 0101 MOVLB 0x1 0021a8 51b9 MOVF 0xb9,0x0,0x1 0021aa 6aea CLRF 0xea,0x0 0021ac 0f40 ADDLW 0x40 0021ae 6ee9 MOVWF 0xe9,0x0 0021b0 0e02 MOVLW 0x2 0021b2 22ea ADDWFC 0xea,0x1,0x0 0021b4 50ef MOVF 0xef,0x0,0x0 0021b6 5c2a SUBWF 0x2a,0x0,0x0 0021b8 e105 BNZ 0x21c4 { C:\Projects\UBW\FW\D_143\user\user.c 0021ba 880d BSF 0xd,0x4,0x0 bitset (error_byte, kERROR_BYTE_MISSING_PARAMETER); C:\Projects\UBW\FW\D_143\user\user.c 0021bc 6a1d CLRF 0x1d,0x0 return (0); C:\Projects\UBW\FW\D_143\user\user.c 0021be 6a1e CLRF 0x1e,0x0 0021c0 6a1f CLRF 0x1f,0x0 0021c2 d193 BRA 0x24ea } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Check for comma where ptr points C:\Projects\UBW\FW\D_143\user\user.c 0021c4 0101 MOVLB 0x1 if (g_RX_buf[g_RX_buf_out] != ',') C:\Projects\UBW\FW\D_143\user\user.c 0021c6 51b9 MOVF 0xb9,0x0,0x1 0021c8 6aea CLRF 0xea,0x0 0021ca 0f40 ADDLW 0x40 0021cc 6ee9 MOVWF 0xe9,0x0 0021ce 0e02 MOVLW 0x2 0021d0 22ea ADDWFC 0xea,0x1,0x0 0021d2 50ef MOVF 0xef,0x0,0x0 0021d4 082c SUBLW 0x2c 0021d6 e020 BZ 0x2218 { C:\Projects\UBW\FW\D_143\user\user.c 0021d8 0101 MOVLB 0x1 printf ((far rom char *)"!5 Err: Need comma next, found: '%c'\r\n", g_RX_buf[g_RX_buf_out]); C:\Projects\UBW\FW\D_143\user\user.c 0021da 51b9 MOVF 0xb9,0x0,0x1 0021dc 6aea CLRF 0xea,0x0 0021de 0f40 ADDLW 0x40 0021e0 6ee9 MOVWF 0xe9,0x0 0021e2 0e02 MOVLW 0x2 0021e4 22ea ADDWFC 0xea,0x1,0x0 0021e6 50ef MOVF 0xef,0x0,0x0 0021e8 6ee6 MOVWF 0xe6,0x0 0021ea 6ae6 CLRF 0xe6,0x0 0021ec 0e28 MOVLW 0x28 0021ee 6e2a MOVWF 0x2a,0x0 0021f0 0e3f MOVLW 0x3f 0021f2 6e2b MOVWF 0x2b,0x0 0021f4 6a2c CLRF 0x2c,0x0 0021f6 c02a MOVFF 0x2a,0xfe6 0021f8 ffe6 0021fa c02b MOVFF 0x2b,0xfe6 0021fc ffe6 0021fe c02c MOVFF 0x2c,0xfe6 002200 ffe6 002202 ec5f CALL 0x42be,0x0 002204 f021 002206 6e2d MOVWF 0x2d,0x0 002208 0e05 MOVLW 0x5 00220a 5ee1 SUBWF 0xe1,0x1,0x0 00220c 502d MOVF 0x2d,0x0,0x0 00220e 8a0d BSF 0xd,0x5,0x0 bitset (error_byte, kERROR_BYTE_PRINTED_ERROR); C:\Projects\UBW\FW\D_143\user\user.c 002210 6a1d CLRF 0x1d,0x0 return (0); C:\Projects\UBW\FW\D_143\user\user.c 002212 6a1e CLRF 0x1e,0x0 002214 6a1f CLRF 0x1f,0x0 002216 d169 BRA 0x24ea } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 002218 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 00221a 2bb9 INCF 0xb9,0x1,0x1 00221c 0e40 MOVLW 0x40 00221e 0101 MOVLB 0x1 002220 5db9 SUBWF 0xb9,0x0,0x1 002222 e102 BNZ 0x2228 002224 0101 MOVLB 0x1 002226 6bb9 CLRF 0xb9,0x1 C:\Projects\UBW\FW\D_143\user\user.c // Now check for a sign character if we're not looking for ASCII chars C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 002228 0e2d MOVLW 0x2d ('-' == g_RX_buf[g_RX_buf_out]) C:\Projects\UBW\FW\D_143\user\user.c 00222a 6e2a MOVWF 0x2a,0x0 00222c 0101 MOVLB 0x1 00222e 51b9 MOVF 0xb9,0x0,0x1 002230 6aea CLRF 0xea,0x0 002232 0f40 ADDLW 0x40 002234 6ee9 MOVWF 0xe9,0x0 002236 0e02 MOVLW 0x2 002238 22ea ADDWFC 0xea,0x1,0x0 00223a 50ef MOVF 0xef,0x0,0x0 00223c 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 002240 0e04 MOVLW 0x4 (kASCII_CHAR != type) C:\Projects\UBW\FW\D_143\user\user.c 002242 6e2b MOVWF 0x2b,0x0 002244 0efe MOVLW 0xfe 002246 50db MOVF 0xdb,0x0,0x0 002248 5c2b SUBWF 0x2b,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 00224c 0e05 MOVLW 0x5 (kUCASE_ASCII_CHAR != type) C:\Projects\UBW\FW\D_143\user\user.c 00224e 6e2c MOVWF 0x2c,0x0 002250 0efe MOVLW 0xfe 002252 50db MOVF 0xdb,0x0,0x0 002254 5c2c SUBWF 0x2c,0x0,0x0 00224a e022 BZ 0x2290 ) C:\Projects\UBW\FW\D_143\user\user.c 002256 e01c BZ 0x2290 00223e e128 BNZ 0x2290 ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // It's an error if we see a negative sign on an unsigned value C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 002258 0efe MOVLW 0xfe (kUCHAR == type) C:\Projects\UBW\FW\D_143\user\user.c 00225a 04db DECF 0xdb,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 00225e 0e03 MOVLW 0x3 (kUINT == type) C:\Projects\UBW\FW\D_143\user\user.c 002260 6e2a MOVWF 0x2a,0x0 002262 0efe MOVLW 0xfe 002264 50db MOVF 0xdb,0x0,0x0 002266 5c2a SUBWF 0x2a,0x0,0x0 00225c e006 BZ 0x226a ) C:\Projects\UBW\FW\D_143\user\user.c 002268 e106 BNZ 0x2276 { C:\Projects\UBW\FW\D_143\user\user.c 00226a 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 00226c 6a1d CLRF 0x1d,0x0 return (0); C:\Projects\UBW\FW\D_143\user\user.c 00226e 6a1e CLRF 0x1e,0x0 002270 6a1f CLRF 0x1f,0x0 002272 d13b BRA 0x24ea } C:\Projects\UBW\FW\D_143\user\user.c 002274 d00d BRA 0x2290 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002276 0e01 MOVLW 0x1 neg = TRUE; C:\Projects\UBW\FW\D_143\user\user.c 002278 6ef3 MOVWF 0xf3,0x0 00227a 0e03 MOVLW 0x3 00227c cff3 MOVFF 0xff3,0xfdb 00227e ffdb // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 002280 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 002282 2bb9 INCF 0xb9,0x1,0x1 002284 0e40 MOVLW 0x40 002286 0101 MOVLB 0x1 002288 5db9 SUBWF 0xb9,0x0,0x1 00228a e102 BNZ 0x2290 00228c 0101 MOVLB 0x1 00228e 6bb9 CLRF 0xb9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // If we need to get a digit, go do that C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 002290 0e04 MOVLW 0x4 (kASCII_CHAR != type) C:\Projects\UBW\FW\D_143\user\user.c 002292 6e2a MOVWF 0x2a,0x0 002294 0efe MOVLW 0xfe 002296 50db MOVF 0xdb,0x0,0x0 002298 5c2a SUBWF 0x2a,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c 00229c 0e05 MOVLW 0x5 (kUCASE_ASCII_CHAR != type) C:\Projects\UBW\FW\D_143\user\user.c 00229e 6e2b MOVWF 0x2b,0x0 0022a0 0efe MOVLW 0xfe 0022a2 50db MOVF 0xdb,0x0,0x0 0022a4 5c2b SUBWF 0x2b,0x0,0x0 00229a e011 BZ 0x22be ) C:\Projects\UBW\FW\D_143\user\user.c 0022a6 e00b BZ 0x22be { C:\Projects\UBW\FW\D_143\user\user.c 0022a8 0e05 MOVLW 0x5 extract_digit(&acc, 5); C:\Projects\UBW\FW\D_143\user\user.c 0022aa 6ee6 MOVWF 0xe6,0x0 0022ac cfd9 MOVFF 0xfd9,0xfe6 0022ae ffe6 0022b0 cfda MOVFF 0xfda,0xfe6 0022b2 ffe6 0022b4 d924 RCALL 0x24fe 0022b6 52e5 MOVF 0xe5,0x1,0x0 0022b8 52e5 MOVF 0xe5,0x1,0x0 0022ba 52e5 MOVF 0xe5,0x1,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0022bc d03a BRA 0x2332 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c // Otherwise just copy the byte C:\Projects\UBW\FW\D_143\user\user.c 0022be 0101 MOVLB 0x1 acc = g_RX_buf[g_RX_buf_out]; C:\Projects\UBW\FW\D_143\user\user.c 0022c0 51b9 MOVF 0xb9,0x0,0x1 0022c2 6aea CLRF 0xea,0x0 0022c4 0f40 ADDLW 0x40 0022c6 6ee9 MOVWF 0xe9,0x0 0022c8 0e02 MOVLW 0x2 0022ca 22ea ADDWFC 0xea,0x1,0x0 0022cc cfef MOVFF 0xfef,0x2a 0022ce f02a 0022d0 6a2b CLRF 0x2b,0x0 0022d2 6a2c CLRF 0x2c,0x0 0022d4 c02a MOVFF 0x2a,0xfdf 0022d6 ffdf 0022d8 0e01 MOVLW 0x1 0022da c02b MOVFF 0x2b,0xfdb 0022dc ffdb 0022de 0e02 MOVLW 0x2 0022e0 c02c MOVFF 0x2c,0xfdb 0022e2 ffdb C:\Projects\UBW\FW\D_143\user\user.c // Force uppercase if that's what type we have C:\Projects\UBW\FW\D_143\user\user.c 0022e4 0e05 MOVLW 0x5 if (kUCASE_ASCII_CHAR == type) C:\Projects\UBW\FW\D_143\user\user.c 0022e6 6e2a MOVWF 0x2a,0x0 0022e8 0efe MOVLW 0xfe 0022ea 50db MOVF 0xdb,0x0,0x0 0022ec 5c2a SUBWF 0x2a,0x0,0x0 0022ee e119 BNZ 0x2322 { C:\Projects\UBW\FW\D_143\user\user.c 0022f0 0e00 MOVLW 0x0 acc = toupper (acc); C:\Projects\UBW\FW\D_143\user\user.c 0022f2 cfdb MOVFF 0xfdb,0xfe6 0022f4 ffe6 0022f6 0e01 MOVLW 0x1 0022f8 cfdb MOVFF 0xfdb,0xfe6 0022fa ffe6 0022fc ec58 CALL 0x44b0,0x0 0022fe f022 002300 52e5 MOVF 0xe5,0x1,0x0 002302 52e5 MOVF 0xe5,0x1,0x0 002304 cff3 MOVFF 0xff3,0x2a 002306 f02a 002308 cff4 MOVFF 0xff4,0x2b 00230a f02b 00230c 6a2c CLRF 0x2c,0x0 00230e be2b BTFSC 0x2b,0x7,0x0 002310 682c SETF 0x2c,0x0 002312 c02a MOVFF 0x2a,0xfdf 002314 ffdf 002316 0e01 MOVLW 0x1 002318 c02b MOVFF 0x2b,0xfdb 00231a ffdb 00231c 0e02 MOVLW 0x2 00231e c02c MOVFF 0x2c,0xfdb 002320 ffdb } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 002322 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 002324 2bb9 INCF 0xb9,0x1,0x1 002326 0e40 MOVLW 0x40 002328 0101 MOVLB 0x1 00232a 5db9 SUBWF 0xb9,0x0,0x1 00232c e102 BNZ 0x2332 00232e 0101 MOVLB 0x1 002330 6bb9 CLRF 0xb9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Handle the negative sign C:\Projects\UBW\FW\D_143\user\user.c 002332 0e03 MOVLW 0x3 if (neg) C:\Projects\UBW\FW\D_143\user\user.c 002334 50db MOVF 0xdb,0x0,0x0 002336 e021 BZ 0x237a { C:\Projects\UBW\FW\D_143\user\user.c 002338 cfdf MOVFF 0xfdf,0x2a acc = -acc; C:\Projects\UBW\FW\D_143\user\user.c 00233a f02a 00233c 0e01 MOVLW 0x1 00233e cfdb MOVFF 0xfdb,0x2b 002340 f02b 002342 0e02 MOVLW 0x2 002344 cfdb MOVFF 0xfdb,0x2c 002346 f02c 002348 6822 SETF 0x22,0x0 00234a 6823 SETF 0x23,0x0 00234c 6824 SETF 0x24,0x0 00234e c02a MOVFF 0x2a,0x1d 002350 f01d 002352 c02b MOVFF 0x2b,0x1e 002354 f01e 002356 c02c MOVFF 0x2c,0x1f 002358 f01f 00235a ec33 CALL 0x4066,0x0 00235c f020 00235e c01a MOVFF 0x1a,0x2a 002360 f02a 002362 c01b MOVFF 0x1b,0x2b 002364 f02b 002366 c01c MOVFF 0x1c,0x2c 002368 f02c 00236a c02a MOVFF 0x2a,0xfdf 00236c ffdf 00236e 0e01 MOVLW 0x1 002370 c02b MOVFF 0x2b,0xfdb 002372 ffdb 002374 0e02 MOVLW 0x2 002376 c02c MOVFF 0x2c,0xfdb 002378 ffdb } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c // Range check the new value C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 00237a 0efe MOVLW 0xfe kCHAR == type C:\Projects\UBW\FW\D_143\user\user.c 00237c 50db MOVF 0xdb,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 002380 cfdf MOVFF 0xfdf,0x2a (acc > 127) C:\Projects\UBW\FW\D_143\user\user.c 002382 f02a 002384 0e01 MOVLW 0x1 002386 cfdb MOVFF 0xfdb,0x2b 002388 f02b 00238a 0e02 MOVLW 0x2 00238c cfdb MOVFF 0xfdb,0x2c 00238e f02c 002390 342c RLCF 0x2c,0x0,0x0 002392 0e00 MOVLW 0x0 002394 182c XORWF 0x2c,0x0,0x0 002396 e607 BN 0x23a6 002398 80d8 BSF 0xd8,0x0,0x0 00239a 0e7f MOVLW 0x7f 00239c 542a SUBFWB 0x2a,0x0,0x0 00239e 0e00 MOVLW 0x0 0023a0 542b SUBFWB 0x2b,0x0,0x0 0023a2 0e00 MOVLW 0x0 0023a4 542c SUBFWB 0x2c,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 0023aa cfd9 MOVFF 0xfd9,0xfe9 (acc < -128) C:\Projects\UBW\FW\D_143\user\user.c 0023ac ffe9 0023ae cfda MOVFF 0xfda,0xfea 0023b0 ffea 0023b2 0e02 MOVLW 0x2 0023b4 80d8 BSF 0xd8,0x0,0x0 0023b6 50eb MOVF 0xeb,0x0,0x0 0023b8 0aff XORLW 0xff 0023ba e606 BN 0x23c8 0023bc 0e80 MOVLW 0x80 0023be 5cee SUBWF 0xee,0x0,0x0 0023c0 0eff MOVLW 0xff 0023c2 58ee SUBWFB 0xee,0x0,0x0 0023c4 0eff MOVLW 0xff 0023c6 58ef SUBWFB 0xef,0x0,0x0 0023a6 e201 BC 0x23aa ) C:\Projects\UBW\FW\D_143\user\user.c 0023a8 d08c BRA 0x24c2 0023c8 e201 BC 0x23cc 0023ca d07b BRA 0x24c2 00237e e126 BNZ 0x23cc ) C:\Projects\UBW\FW\D_143\user\user.c || C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c kUCHAR == type C:\Projects\UBW\FW\D_143\user\user.c 0023cc 0efe MOVLW 0xfe && C:\Projects\UBW\FW\D_143\user\user.c 0023ce 04db DECF 0xdb,0x0,0x0 ( C:\Projects\UBW\FW\D_143\user\user.c 0023d2 cfdf MOVFF 0xfdf,0x2d (acc > 255) C:\Projects\UBW\FW\D_143\user\user.c 0023d4 f02d 0023d6 0e01 MOVLW 0x1 0023d8 cfdb MOVFF 0xfdb,0x2e 0023da f02e 0023dc 0e02 MOVLW 0x2 0023de cfdb MOVFF 0xfdb,0x2f 0023e0 f02f 0023e2 342f RLCF 0x2f,0x0,0x0 0023e4 0e00 MOVLW 0x0 0023e6 182f XORWF 0x2f,0x0,0x0 0023e8 e607 BN 0x23f8 0023ea 80d8 BSF 0xd8,0x0,0x0 0023ec 0eff MOVLW 0xff 0023ee 542d SUBFWB 0x2d,0x0,0x0 0023f0 0e00 MOVLW 0x0 0023f2 542e SUBFWB 0x2e,0x0,0x0 0023f4 0e00 MOVLW 0x0 0023f6 542f SUBFWB 0x2f,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 0023fa cfd9 MOVFF 0xfd9,0xfe9 (acc < 0) C:\Projects\UBW\FW\D_143\user\user.c 0023fc ffe9 0023fe cfda MOVFF 0xfda,0xfea 002400 ffea 002402 0e02 MOVLW 0x2 002404 90d8 BCF 0xd8,0x0,0x0 002406 50eb MOVF 0xeb,0x0,0x0 002408 0a00 XORLW 0x0 00240a e606 BN 0x2418 00240c 0e00 MOVLW 0x0 00240e 5cee SUBWF 0xee,0x0,0x0 002410 0e00 MOVLW 0x0 002412 58ee SUBWFB 0xee,0x0,0x0 002414 0e00 MOVLW 0x0 002416 58ef SUBWFB 0xef,0x0,0x0 0023f8 e364 BNC 0x24c2 ) C:\Projects\UBW\FW\D_143\user\user.c 002418 e354 BNC 0x24c2 0023d0 e124 BNZ 0x241a ) C:\Projects\UBW\FW\D_143\user\user.c || C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 00241a 0e02 MOVLW 0x2 kINT == type C:\Projects\UBW\FW\D_143\user\user.c 00241c 6e30 MOVWF 0x30,0x0 00241e 0efe MOVLW 0xfe 002420 50db MOVF 0xdb,0x0,0x0 002422 5c30 SUBWF 0x30,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 002426 cfdf MOVFF 0xfdf,0x31 (acc > 32767) C:\Projects\UBW\FW\D_143\user\user.c 002428 f031 00242a 0e01 MOVLW 0x1 00242c cfdb MOVFF 0xfdb,0x32 00242e f032 002430 0e02 MOVLW 0x2 002432 cfdb MOVFF 0xfdb,0x33 002434 f033 002436 3433 RLCF 0x33,0x0,0x0 002438 0e00 MOVLW 0x0 00243a 1833 XORWF 0x33,0x0,0x0 00243c e607 BN 0x244c 00243e 80d8 BSF 0xd8,0x0,0x0 002440 0eff MOVLW 0xff 002442 5431 SUBFWB 0x31,0x0,0x0 002444 0e7f MOVLW 0x7f 002446 5432 SUBFWB 0x32,0x0,0x0 002448 0e00 MOVLW 0x0 00244a 5433 SUBFWB 0x33,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 00244e cfd9 MOVFF 0xfd9,0xfe9 (acc < -32768) C:\Projects\UBW\FW\D_143\user\user.c 002450 ffe9 002452 cfda MOVFF 0xfda,0xfea 002454 ffea 002456 0e02 MOVLW 0x2 002458 80d8 BSF 0xd8,0x0,0x0 00245a 50eb MOVF 0xeb,0x0,0x0 00245c 0aff XORLW 0xff 00245e e606 BN 0x246c 002460 0e00 MOVLW 0x0 002462 5cee SUBWF 0xee,0x0,0x0 002464 0e80 MOVLW 0x80 002466 58ee SUBWFB 0xee,0x0,0x0 002468 0eff MOVLW 0xff 00246a 58ef SUBWFB 0xef,0x0,0x0 00244c e33a BNC 0x24c2 ) C:\Projects\UBW\FW\D_143\user\user.c 00246c e32a BNC 0x24c2 002424 e124 BNZ 0x246e ) C:\Projects\UBW\FW\D_143\user\user.c || C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 00246e 0e03 MOVLW 0x3 kUINT == type C:\Projects\UBW\FW\D_143\user\user.c 002470 6e34 MOVWF 0x34,0x0 002472 0efe MOVLW 0xfe 002474 50db MOVF 0xdb,0x0,0x0 002476 5c34 SUBWF 0x34,0x0,0x0 && C:\Projects\UBW\FW\D_143\user\user.c ( C:\Projects\UBW\FW\D_143\user\user.c 00247a cfdf MOVFF 0xfdf,0x35 (acc > 65535) C:\Projects\UBW\FW\D_143\user\user.c 00247c f035 00247e 0e01 MOVLW 0x1 002480 cfdb MOVFF 0xfdb,0x36 002482 f036 002484 0e02 MOVLW 0x2 002486 cfdb MOVFF 0xfdb,0x37 002488 f037 00248a 3437 RLCF 0x37,0x0,0x0 00248c 0e00 MOVLW 0x0 00248e 1837 XORWF 0x37,0x0,0x0 002490 e607 BN 0x24a0 002492 80d8 BSF 0xd8,0x0,0x0 002494 0eff MOVLW 0xff 002496 5435 SUBFWB 0x35,0x0,0x0 002498 0eff MOVLW 0xff 00249a 5436 SUBFWB 0x36,0x0,0x0 00249c 0e00 MOVLW 0x0 00249e 5437 SUBFWB 0x37,0x0,0x0 || C:\Projects\UBW\FW\D_143\user\user.c 0024a2 cfd9 MOVFF 0xfd9,0xfe9 (acc < 0) C:\Projects\UBW\FW\D_143\user\user.c 0024a4 ffe9 0024a6 cfda MOVFF 0xfda,0xfea 0024a8 ffea 0024aa 0e02 MOVLW 0x2 0024ac 90d8 BCF 0xd8,0x0,0x0 0024ae 50eb MOVF 0xeb,0x0,0x0 0024b0 0a00 XORLW 0x0 0024b2 e606 BN 0x24c0 0024b4 0e00 MOVLW 0x0 0024b6 5cee SUBWF 0xee,0x0,0x0 0024b8 0e00 MOVLW 0x0 0024ba 58ee SUBWFB 0xee,0x0,0x0 0024bc 0e00 MOVLW 0x0 0024be 58ef SUBWFB 0xef,0x0,0x0 0024a0 e310 BNC 0x24c2 ) C:\Projects\UBW\FW\D_143\user\user.c 0024c0 e205 BC 0x24cc 002478 e129 BNZ 0x24cc ) C:\Projects\UBW\FW\D_143\user\user.c ) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0024c2 8c0d BSF 0xd,0x6,0x0 bitset (error_byte, kERROR_BYTE_PARAMATER_OUTSIDE_LIMIT); C:\Projects\UBW\FW\D_143\user\user.c 0024c4 6a1d CLRF 0x1d,0x0 return (0); C:\Projects\UBW\FW\D_143\user\user.c 0024c6 6a1e CLRF 0x1e,0x0 0024c8 6a1f CLRF 0x1f,0x0 0024ca d00f BRA 0x24ea } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 0024cc cfdf MOVFF 0xfdf,0x2a return(acc); C:\Projects\UBW\FW\D_143\user\user.c 0024ce f02a 0024d0 0e01 MOVLW 0x1 0024d2 cfdb MOVFF 0xfdb,0x2b 0024d4 f02b 0024d6 0e02 MOVLW 0x2 0024d8 cfdb MOVFF 0xfdb,0x2c 0024da f02c 0024dc c02a MOVFF 0x2a,0x1d 0024de f01d 0024e0 c02b MOVFF 0x2b,0x1e 0024e2 f01e 0024e4 c02c MOVFF 0x2c,0x1f 0024e6 f01f 0024e8 d000 BRA 0x24ea 0024ea 0e04 MOVLW 0x4 } C:\Projects\UBW\FW\D_143\user\user.c 0024ec 5ce1 SUBWF 0xe1,0x0,0x0 0024ee e202 BC 0x24f4 0024f0 6ae1 CLRF 0xe1,0x0 0024f2 52e5 MOVF 0xe5,0x1,0x0 0024f4 6ee1 MOVWF 0xe1,0x0 0024f6 52e5 MOVF 0xe5,0x1,0x0 0024f8 cfe7 MOVFF 0xfe7,0xfd9 0024fa ffd9 0024fc 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // Loop 'digits' number of times, looking at the C:\Projects\UBW\FW\D_143\user\user.c // byte in input_buffer index *ptr, and if it is C:\Projects\UBW\FW\D_143\user\user.c // a digit, adding it to acc. Take care of C:\Projects\UBW\FW\D_143\user\user.c // powers of ten as well. If you hit a non-numerical C:\Projects\UBW\FW\D_143\user\user.c // char, then return FALSE, otherwise return TRUE. C:\Projects\UBW\FW\D_143\user\user.c // Store result as you go in *acc. C:\Projects\UBW\FW\D_143\user\user.c 0024fe cfd9 MOVFF 0xfd9,0xfe6 signed char extract_digit(signed short long * acc, unsigned char digits) C:\Projects\UBW\FW\D_143\user\user.c 002500 ffe6 002502 cfe1 MOVFF 0xfe1,0xfd9 002504 ffd9 002506 0e02 MOVLW 0x2 002508 26e1 ADDWF 0xe1,0x1,0x0 { C:\Projects\UBW\FW\D_143\user\user.c unsigned char val; C:\Projects\UBW\FW\D_143\user\user.c unsigned char digit_cnt; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c 00250a 0efd MOVLW 0xfd *acc = 0; C:\Projects\UBW\FW\D_143\user\user.c 00250c cfdb MOVFF 0xfdb,0xfe9 00250e ffe9 002510 0efe MOVLW 0xfe 002512 cfdb MOVFF 0xfdb,0xfea 002514 ffea 002516 6aee CLRF 0xee,0x0 002518 6aee CLRF 0xee,0x0 00251a 6aee CLRF 0xee,0x0 C:\Projects\UBW\FW\D_143\user\user.c 00251c 0e01 MOVLW 0x1 for (digit_cnt = 0; digit_cnt < digits; digit_cnt++) C:\Projects\UBW\FW\D_143\user\user.c 00251e 6adb CLRF 0xdb,0x0 002520 0efc MOVLW 0xfc 002522 50db MOVF 0xdb,0x0,0x0 002524 6ef3 MOVWF 0xf3,0x0 002526 0e01 MOVLW 0x1 002528 cfdb MOVFF 0xfdb,0xff4 00252a fff4 00252c 50f3 MOVF 0xf3,0x0,0x0 00252e 5cf4 SUBWF 0xf4,0x0,0x0 002530 e255 BC 0x25dc 0025d6 0e01 MOVLW 0x1 0025d8 2adb INCF 0xdb,0x1,0x0 0025da d7a2 BRA 0x2520 { C:\Projects\UBW\FW\D_143\user\user.c 002532 0101 MOVLB 0x1 val = g_RX_buf[g_RX_buf_out]; C:\Projects\UBW\FW\D_143\user\user.c 002534 51b9 MOVF 0xb9,0x0,0x1 002536 6aea CLRF 0xea,0x0 002538 0f40 ADDLW 0x40 00253a 6ee9 MOVWF 0xe9,0x0 00253c 0e02 MOVLW 0x2 00253e 22ea ADDWFC 0xea,0x1,0x0 002540 cfef MOVFF 0xfef,0xfdf 002542 ffdf 002544 0e30 MOVLW 0x30 if ((val >= 48) && (val <= 57)) C:\Projects\UBW\FW\D_143\user\user.c 002546 5cdf SUBWF 0xdf,0x0,0x0 002548 e344 BNC 0x25d2 00254a 50df MOVF 0xdf,0x0,0x0 00254c 0839 SUBLW 0x39 00254e e341 BNC 0x25d2 { C:\Projects\UBW\FW\D_143\user\user.c 002550 0efd MOVLW 0xfd *acc = (*acc * 10) + (val - 48); C:\Projects\UBW\FW\D_143\user\user.c 002552 cfdb MOVFF 0xfdb,0xfe9 002554 ffe9 002556 0efe MOVLW 0xfe 002558 cfdb MOVFF 0xfdb,0xfea 00255a ffea 00255c cfee MOVFF 0xfee,0x2d 00255e f02d 002560 cfee MOVFF 0xfee,0x2e 002562 f02e 002564 cfef MOVFF 0xfef,0x2f 002566 f02f 002568 0e0a MOVLW 0xa 00256a 6e22 MOVWF 0x22,0x0 00256c 6a23 CLRF 0x23,0x0 00256e 6a24 CLRF 0x24,0x0 002570 c02d MOVFF 0x2d,0x1d 002572 f01d 002574 c02e MOVFF 0x2e,0x1e 002576 f01e 002578 c02f MOVFF 0x2f,0x1f 00257a f01f 00257c ec33 CALL 0x4066,0x0 00257e f020 002580 c01a MOVFF 0x1a,0x2d 002582 f02d 002584 c01b MOVFF 0x1b,0x2e 002586 f02e 002588 c01c MOVFF 0x1c,0x2f 00258a f02f 00258c 0e30 MOVLW 0x30 00258e 5cdf SUBWF 0xdf,0x0,0x0 002590 6e30 MOVWF 0x30,0x0 002592 6a31 CLRF 0x31,0x0 002594 6a32 CLRF 0x32,0x0 002596 502d MOVF 0x2d,0x0,0x0 002598 2430 ADDWF 0x30,0x0,0x0 00259a 6e2a MOVWF 0x2a,0x0 00259c 502e MOVF 0x2e,0x0,0x0 00259e 2031 ADDWFC 0x31,0x0,0x0 0025a0 6e2b MOVWF 0x2b,0x0 0025a2 502f MOVF 0x2f,0x0,0x0 0025a4 2032 ADDWFC 0x32,0x0,0x0 0025a6 6e2c MOVWF 0x2c,0x0 0025a8 0efd MOVLW 0xfd 0025aa cfdb MOVFF 0xfdb,0xfe9 0025ac ffe9 0025ae 0efe MOVLW 0xfe 0025b0 cfdb MOVFF 0xfdb,0xfea 0025b2 ffea 0025b4 c02a MOVFF 0x2a,0xfee 0025b6 ffee 0025b8 c02b MOVFF 0x2b,0xfee 0025ba ffee 0025bc c02c MOVFF 0x2c,0xfee 0025be ffee // Move to the next character C:\Projects\UBW\FW\D_143\user\user.c 0025c0 0101 MOVLB 0x1 advance_RX_buf_out (); C:\Projects\UBW\FW\D_143\user\user.c 0025c2 2bb9 INCF 0xb9,0x1,0x1 0025c4 0e40 MOVLW 0x40 0025c6 0101 MOVLB 0x1 0025c8 5db9 SUBWF 0xb9,0x0,0x1 0025ca e102 BNZ 0x25d0 0025cc 0101 MOVLB 0x1 0025ce 6bb9 CLRF 0xb9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c 0025d0 d002 BRA 0x25d6 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 0025d2 0e00 MOVLW 0x0 return (FALSE); C:\Projects\UBW\FW\D_143\user\user.c 0025d4 d005 BRA 0x25e0 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0025dc 0e01 MOVLW 0x1 return (TRUE); C:\Projects\UBW\FW\D_143\user\user.c 0025de d000 BRA 0x25e0 0025e0 6e2a MOVWF 0x2a,0x0 } C:\Projects\UBW\FW\D_143\user\user.c 0025e2 0e02 MOVLW 0x2 0025e4 5ce1 SUBWF 0xe1,0x0,0x0 0025e6 e202 BC 0x25ec 0025e8 6ae1 CLRF 0xe1,0x0 0025ea 52e5 MOVF 0xe5,0x1,0x0 0025ec 6ee1 MOVWF 0xe1,0x0 0025ee 502a MOVF 0x2a,0x0,0x0 0025f0 52e5 MOVF 0xe5,0x1,0x0 0025f2 cfe7 MOVFF 0xfe7,0xfd9 0025f4 ffd9 0025f6 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\user\user.c // For debugging, this command will spit out a bunch of values. C:\Projects\UBW\FW\D_143\user\user.c void print_status(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c printf( C:\Projects\UBW\FW\D_143\user\user.c (far rom char*)"Status=%i\r\n" C:\Projects\UBW\FW\D_143\user\user.c 0025f8 5006 MOVF 0x6,0x0,0x0 ,ISR_D_FIFO_length C:\Projects\UBW\FW\D_143\user\user.c 0025fe 0e1c MOVLW 0x1c 002600 6e2a MOVWF 0x2a,0x0 002602 0e3f MOVLW 0x3f 002604 6e2b MOVWF 0x2b,0x0 002606 6a2c CLRF 0x2c,0x0 002608 c02a MOVFF 0x2a,0xfe6 00260a ffe6 00260c c02b MOVFF 0x2b,0xfe6 00260e ffe6 002610 c02c MOVFF 0x2c,0xfe6 002612 ffe6 0025fa 6ee6 MOVWF 0xe6,0x0 ); C:\Projects\UBW\FW\D_143\user\user.c 0025fc 6ae6 CLRF 0xe6,0x0 002614 ec5f CALL 0x42be,0x0 002616 f021 002618 6e2d MOVWF 0x2d,0x0 00261a 0e05 MOVLW 0x5 00261c 5ee1 SUBWF 0xe1,0x1,0x0 00261e 502d MOVF 0x2d,0x0,0x0 002620 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /****************************************************************************** C:\Projects\UBW\FW\D_143\user\user.c * Function: void BlinkUSBStatus(void) C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * PreCondition: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Input: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Output: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Side Effects: None C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Overview: BlinkUSBStatus turns on and off LEDs corresponding to C:\Projects\UBW\FW\D_143\user\user.c * the USB device state. C:\Projects\UBW\FW\D_143\user\user.c * C:\Projects\UBW\FW\D_143\user\user.c * Note: mLED macros can be found in io_cfg.h C:\Projects\UBW\FW\D_143\user\user.c * usb_device_state is declared in usbmmap.c and is modified C:\Projects\UBW\FW\D_143\user\user.c * in usbdrv.c, usbctrltrf.c, and usb9.c C:\Projects\UBW\FW\D_143\user\user.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\user\user.c void BlinkUSBStatus(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c static word LEDCount = 0; C:\Projects\UBW\FW\D_143\user\user.c static unsigned char LEDState = 0; C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c if ( C:\Projects\UBW\FW\D_143\user\user.c 002622 0101 MOVLB 0x1 usb_device_state == DETACHED_STATE C:\Projects\UBW\FW\D_143\user\user.c 002624 51d2 MOVF 0xd2,0x0,0x1 || C:\Projects\UBW\FW\D_143\user\user.c 002628 0e01 MOVLW 0x1 1 == UCONbits.SUSPND C:\Projects\UBW\FW\D_143\user\user.c 00262a 6e2a MOVWF 0x2a,0x0 00262c 506d MOVF 0x6d,0x0,0x0 00262e 0b02 ANDLW 0x2 002630 e001 BZ 0x2634 002632 0e01 MOVLW 0x1 002626 e008 BZ 0x2638 ) C:\Projects\UBW\FW\D_143\user\user.c 002634 5c2a SUBWF 0x2a,0x0,0x0 002636 e122 BNZ 0x267c { C:\Projects\UBW\FW\D_143\user\user.c 002638 0101 MOVLB 0x1 LEDCount--; C:\Projects\UBW\FW\D_143\user\user.c 00263a 07d7 DECF 0xd7,0x1,0x1 00263c 0e00 MOVLW 0x0 00263e 5bd8 SUBWFB 0xd8,0x1,0x1 002640 0101 MOVLB 0x1 if (0 == LEDState) C:\Projects\UBW\FW\D_143\user\user.c 002642 51d9 MOVF 0xd9,0x0,0x1 002644 e10e BNZ 0x2662 { C:\Projects\UBW\FW\D_143\user\user.c 002646 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 002648 51d7 MOVF 0xd7,0x0,0x1 00264a 11d8 IORWF 0xd8,0x0,0x1 00264c e109 BNZ 0x2660 { C:\Projects\UBW\FW\D_143\user\user.c 00264e 808b BSF 0x8b,0x0,0x0 mLED_1_On(); C:\Projects\UBW\FW\D_143\user\user.c 002650 0101 MOVLB 0x1 LEDCount = 2000U; C:\Projects\UBW\FW\D_143\user\user.c 002652 0ed0 MOVLW 0xd0 002654 6fd7 MOVWF 0xd7,0x1 002656 0e07 MOVLW 0x7 002658 6fd8 MOVWF 0xd8,0x1 00265a 0101 MOVLB 0x1 LEDState = 1; C:\Projects\UBW\FW\D_143\user\user.c 00265c 0e01 MOVLW 0x1 00265e 6fd9 MOVWF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 002660 d00c BRA 0x267a else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002662 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 002664 51d7 MOVF 0xd7,0x0,0x1 002666 11d8 IORWF 0xd8,0x0,0x1 002668 e108 BNZ 0x267a { C:\Projects\UBW\FW\D_143\user\user.c 00266a 908b BCF 0x8b,0x0,0x0 mLED_1_Off(); C:\Projects\UBW\FW\D_143\user\user.c 00266c 0101 MOVLB 0x1 LEDCount = 2000U; C:\Projects\UBW\FW\D_143\user\user.c 00266e 0ed0 MOVLW 0xd0 002670 6fd7 MOVWF 0xd7,0x1 002672 0e07 MOVLW 0x7 002674 6fd8 MOVWF 0xd8,0x1 002676 0101 MOVLB 0x1 LEDState = 0; C:\Projects\UBW\FW\D_143\user\user.c 002678 6bd9 CLRF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 00267a d05d BRA 0x2736 else if ( C:\Projects\UBW\FW\D_143\user\user.c usb_device_state == ATTACHED_STATE C:\Projects\UBW\FW\D_143\user\user.c 00267c 0101 MOVLB 0x1 || C:\Projects\UBW\FW\D_143\user\user.c 00267e 05d2 DECF 0xd2,0x0,0x1 002682 0e02 MOVLW 0x2 usb_device_state == POWERED_STATE C:\Projects\UBW\FW\D_143\user\user.c 002680 e00c BZ 0x269a || C:\Projects\UBW\FW\D_143\user\user.c 002684 0101 MOVLB 0x1 002686 5dd2 SUBWF 0xd2,0x0,0x1 002688 e008 BZ 0x269a 00268a 0e03 MOVLW 0x3 usb_device_state == DEFAULT_STATE C:\Projects\UBW\FW\D_143\user\user.c 00268c 0101 MOVLB 0x1 || C:\Projects\UBW\FW\D_143\user\user.c 00268e 5dd2 SUBWF 0xd2,0x0,0x1 002690 e004 BZ 0x269a 002692 0e05 MOVLW 0x5 usb_device_state == ADDRESS_STATE C:\Projects\UBW\FW\D_143\user\user.c 002694 0101 MOVLB 0x1 ) C:\Projects\UBW\FW\D_143\user\user.c 002696 5dd2 SUBWF 0xd2,0x0,0x1 002698 e102 BNZ 0x269e { C:\Projects\UBW\FW\D_143\user\user.c 00269a 808b BSF 0x8b,0x0,0x0 mLED_1_On(); C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 00269c d04c BRA 0x2736 else if (usb_device_state == CONFIGURED_STATE) C:\Projects\UBW\FW\D_143\user\user.c 00269e 0e06 MOVLW 0x6 0026a0 0101 MOVLB 0x1 0026a2 5dd2 SUBWF 0xd2,0x0,0x1 0026a4 e148 BNZ 0x2736 { C:\Projects\UBW\FW\D_143\user\user.c 0026a6 0101 MOVLB 0x1 LEDCount--; C:\Projects\UBW\FW\D_143\user\user.c 0026a8 07d7 DECF 0xd7,0x1,0x1 0026aa 0e00 MOVLW 0x0 0026ac 5bd8 SUBWFB 0xd8,0x1,0x1 0026ae 0101 MOVLB 0x1 if (0 == LEDState) C:\Projects\UBW\FW\D_143\user\user.c 0026b0 51d9 MOVF 0xd9,0x0,0x1 0026b2 e10e BNZ 0x26d0 { C:\Projects\UBW\FW\D_143\user\user.c 0026b4 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 0026b6 51d7 MOVF 0xd7,0x0,0x1 0026b8 11d8 IORWF 0xd8,0x0,0x1 0026ba e109 BNZ 0x26ce { C:\Projects\UBW\FW\D_143\user\user.c 0026bc 808b BSF 0x8b,0x0,0x0 mLED_1_On(); C:\Projects\UBW\FW\D_143\user\user.c 0026be 0101 MOVLB 0x1 LEDCount = 10000U; C:\Projects\UBW\FW\D_143\user\user.c 0026c0 0e10 MOVLW 0x10 0026c2 6fd7 MOVWF 0xd7,0x1 0026c4 0e27 MOVLW 0x27 0026c6 6fd8 MOVWF 0xd8,0x1 0026c8 0101 MOVLB 0x1 LEDState = 1; C:\Projects\UBW\FW\D_143\user\user.c 0026ca 0e01 MOVLW 0x1 0026cc 6fd9 MOVWF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0026ce d033 BRA 0x2736 else if (1 == LEDState) C:\Projects\UBW\FW\D_143\user\user.c 0026d0 0101 MOVLB 0x1 0026d2 05d9 DECF 0xd9,0x0,0x1 0026d4 e10e BNZ 0x26f2 { C:\Projects\UBW\FW\D_143\user\user.c 0026d6 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 0026d8 51d7 MOVF 0xd7,0x0,0x1 0026da 11d8 IORWF 0xd8,0x0,0x1 0026dc e109 BNZ 0x26f0 { C:\Projects\UBW\FW\D_143\user\user.c 0026de 908b BCF 0x8b,0x0,0x0 mLED_1_Off(); C:\Projects\UBW\FW\D_143\user\user.c 0026e0 0101 MOVLB 0x1 LEDCount = 10000U; C:\Projects\UBW\FW\D_143\user\user.c 0026e2 0e10 MOVLW 0x10 0026e4 6fd7 MOVWF 0xd7,0x1 0026e6 0e27 MOVLW 0x27 0026e8 6fd8 MOVWF 0xd8,0x1 0026ea 0101 MOVLB 0x1 LEDState = 2; C:\Projects\UBW\FW\D_143\user\user.c 0026ec 0e02 MOVLW 0x2 0026ee 6fd9 MOVWF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 0026f0 d022 BRA 0x2736 else if (2 == LEDState) C:\Projects\UBW\FW\D_143\user\user.c 0026f2 0e02 MOVLW 0x2 0026f4 0101 MOVLB 0x1 0026f6 5dd9 SUBWF 0xd9,0x0,0x1 0026f8 e10e BNZ 0x2716 { C:\Projects\UBW\FW\D_143\user\user.c 0026fa 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 0026fc 51d7 MOVF 0xd7,0x0,0x1 0026fe 11d8 IORWF 0xd8,0x0,0x1 002700 e109 BNZ 0x2714 { C:\Projects\UBW\FW\D_143\user\user.c 002702 808b BSF 0x8b,0x0,0x0 mLED_1_On(); C:\Projects\UBW\FW\D_143\user\user.c 002704 0101 MOVLB 0x1 LEDCount = 100000U; C:\Projects\UBW\FW\D_143\user\user.c 002706 0ea0 MOVLW 0xa0 002708 6fd7 MOVWF 0xd7,0x1 00270a 0e86 MOVLW 0x86 00270c 6fd8 MOVWF 0xd8,0x1 00270e 0101 MOVLB 0x1 LEDState = 3; C:\Projects\UBW\FW\D_143\user\user.c 002710 0e03 MOVLW 0x3 002712 6fd9 MOVWF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 002714 d010 BRA 0x2736 else if (LEDState >= 3) C:\Projects\UBW\FW\D_143\user\user.c 002716 0e03 MOVLW 0x3 002718 0101 MOVLB 0x1 00271a 5dd9 SUBWF 0xd9,0x0,0x1 00271c e30c BNC 0x2736 { C:\Projects\UBW\FW\D_143\user\user.c 00271e 0101 MOVLB 0x1 if (0 == LEDCount) C:\Projects\UBW\FW\D_143\user\user.c 002720 51d7 MOVF 0xd7,0x0,0x1 002722 11d8 IORWF 0xd8,0x0,0x1 002724 e108 BNZ 0x2736 { C:\Projects\UBW\FW\D_143\user\user.c 002726 908b BCF 0x8b,0x0,0x0 mLED_1_Off(); C:\Projects\UBW\FW\D_143\user\user.c 002728 0101 MOVLB 0x1 LEDCount = 10000U; C:\Projects\UBW\FW\D_143\user\user.c 00272a 0e10 MOVLW 0x10 00272c 6fd7 MOVWF 0xd7,0x1 00272e 0e27 MOVLW 0x27 002730 6fd8 MOVWF 0xd8,0x1 002732 0101 MOVLB 0x1 LEDState = 0; C:\Projects\UBW\FW\D_143\user\user.c 002734 6bd9 CLRF 0xd9,0x1 } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c } C:\Projects\UBW\FW\D_143\user\user.c 002736 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c BOOL SwitchIsPressed(void) C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002738 b482 BTFSC 0x82,0x2,0x0 if( 0 == UserSW) // If pressed C:\Projects\UBW\FW\D_143\user\user.c 00273a d003 BRA 0x2742 { C:\Projects\UBW\FW\D_143\user\user.c 00273c 0e01 MOVLW 0x1 return (TRUE); // Was pressed C:\Projects\UBW\FW\D_143\user\user.c 00273e d003 BRA 0x2746 } C:\Projects\UBW\FW\D_143\user\user.c 002740 d002 BRA 0x2746 else C:\Projects\UBW\FW\D_143\user\user.c { C:\Projects\UBW\FW\D_143\user\user.c 002742 0e00 MOVLW 0x0 return (FALSE); // Was not pressed C:\Projects\UBW\FW\D_143\user\user.c 002744 d000 BRA 0x2746 } C:\Projects\UBW\FW\D_143\user\user.c 002746 0012 RETURN 0x0 } C:\Projects\UBW\FW\D_143\user\user.c C:\Projects\UBW\FW\D_143\user\user.c /** EOF user.c ***************************************************************/ C:\Projects\UBW\FW\D_143\user\user.c /********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Microchip USB C18 Firmware - CDC Version 1.0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c ********************************************************************* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * FileName: cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Dependencies: See INCLUDES section below C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Processor: PIC18 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Compiler: C18 2.30.01+ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Company: Microchip Technology, Inc. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Software License Agreement C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The software supplied herewith by Microchip Technology Incorporated C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * (the “Company”) for its PICmicro® Microcontroller is intended and C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * supplied to you, the Company’s customer, for use solely and C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * exclusively on Microchip PICmicro Microcontroller products. The C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * software is owned by the Company and/or its supplier, and is C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * protected under applicable copyright laws. All rights are reserved. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Any use in violation of the foregoing restrictions may subject the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * user to criminal sanctions under applicable laws, as well as to C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * civil liability for the breach of the terms and conditions of this C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * license. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * THIS SOFTWARE IS PROVIDED IN AN “AS IS” CONDITION. NO WARRANTIES, C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT, C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Author Date Comment C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Rawin Rojvanit 11/19/04 Original. RS-232 Emulation Subset C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c ********************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** I N C L U D E S **********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #include C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #include "system\typedefs.h" C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #include "system\usb\usb.h" C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #ifdef USB_USE_CDC C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** V A R I A B L E S ********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #pragma udata C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte cdc_rx_len; // total rx length C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte cdc_trf_state; // States are defined cdc.h C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c POINTER pCDCSrc; // Dedicated source pointer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c POINTER pCDCDst; // Dedicated destination pointer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte cdc_tx_len; // total tx length C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte cdc_mem_type; // _ROM, _RAM C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c LINE_CODING line_coding; // Buffer to store line coding information C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c CONTROL_SIGNAL_BITMAP control_signal_bitmap; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * SEND_ENCAPSULATED_COMMAND and GET_ENCAPSULATED_RESPONSE are required C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * requests according to the CDC specification. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * However, it is not really being used here, therefore a dummy buffer is C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * used for conformance. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #define dummy_length 0x08 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte dummy_encapsulated_cmd_response[dummy_length]; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** P R I V A T E P R O T O T Y P E S ***************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** D E C L A R A T I O N S **************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #pragma code C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** C L A S S S P E C I F I C R E Q ****************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: void USBCheckCDCRequest(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: This routine checks the setup data packet to see if it C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * knows how to handle it C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c void USBCheckCDCRequest(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If request recipient is not an interface then return C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00336a 0104 MOVLB 0x4 if(SetupPkt.Recipient != RCPT_INTF) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00336c 5120 MOVF 0x20,0x0,0x1 00336e 0b1f ANDLW 0x1f 003370 0801 SUBLW 0x1 003372 e001 BZ 0x3376 003374 d060 BRA 0x3436 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If request type is not class-specific then return C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003376 0104 MOVLB 0x4 if(SetupPkt.RequestType != CLASS) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003378 5120 MOVF 0x20,0x0,0x1 00337a 0b60 ANDLW 0x60 00337c 42e8 RRNCF 0xe8,0x1,0x0 00337e 42e8 RRNCF 0xe8,0x1,0x0 003380 42e8 RRNCF 0xe8,0x1,0x0 003382 42e8 RRNCF 0xe8,0x1,0x0 003384 42e8 RRNCF 0xe8,0x1,0x0 003386 0801 SUBLW 0x1 003388 e001 BZ 0x338c 00338a d055 BRA 0x3436 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Interface ID must match interface numbers associated with C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * CDC class, else return C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00338c 0104 MOVLB 0x4 if((SetupPkt.bIntfID != CDC_COMM_INTF_ID)&& C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00338e 5124 MOVF 0x24,0x0,0x1 003390 e004 BZ 0x339a (SetupPkt.bIntfID != CDC_DATA_INTF_ID)) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003392 0104 MOVLB 0x4 003394 0524 DECF 0x24,0x0,0x1 003396 e001 BZ 0x339a 003398 d04e BRA 0x3436 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00339a 0104 MOVLB 0x4 switch(SetupPkt.bRequest) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00339c 5121 MOVF 0x21,0x0,0x1 00339e 0a23 XORLW 0x23 0033a0 e048 BZ 0x3432 0033a2 0a01 XORLW 0x1 0033a4 e040 BZ 0x3426 0033a6 0a03 XORLW 0x3 0033a8 e030 BZ 0x340a 0033aa 0a01 XORLW 0x1 0033ac e025 BZ 0x33f8 0033ae 0a24 XORLW 0x24 0033b0 e022 BZ 0x33f6 0033b2 0a07 XORLW 0x7 0033b4 e01f BZ 0x33f4 0033b6 0a01 XORLW 0x1 0033b8 e01c BZ 0x33f2 0033ba 0a03 XORLW 0x3 0033bc e011 BZ 0x33e0 0033be 0a01 XORLW 0x1 0033c0 e001 BZ 0x33c4 0033c2 d038 BRA 0x3434 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case SEND_ENCAPSULATED_COMMAND: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033c4 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_CDC; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033c6 0e03 MOVLW 0x3 0033c8 6fcb MOVWF 0xcb,0x1 0033ca 0101 MOVLB 0x1 pSrc.bRam = (byte*)&dummy_encapsulated_cmd_response; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033cc 0ea9 MOVLW 0xa9 0033ce 6fcc MOVWF 0xcc,0x1 0033d0 0e01 MOVLW 0x1 0033d2 6fcd MOVWF 0xcd,0x1 0033d4 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _RAM; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033d6 93d3 BCF 0xd3,0x1,0x1 0033d8 0101 MOVLB 0x1 LSB(wCount) = dummy_length; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033da 0e08 MOVLW 0x8 0033dc 6fd0 MOVWF 0xd0,0x1 0033de d02b BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case GET_ENCAPSULATED_RESPONSE: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033e0 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_CDC; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033e2 0e03 MOVLW 0x3 0033e4 6fcb MOVWF 0xcb,0x1 // Populate dummy_encapsulated_cmd_response first. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033e6 0101 MOVLB 0x1 pDst.bRam = (byte*)&dummy_encapsulated_cmd_response; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033e8 0ea9 MOVLW 0xa9 0033ea 6fce MOVWF 0xce,0x1 0033ec 0e01 MOVLW 0x1 0033ee 6fcf MOVWF 0xcf,0x1 0033f0 d022 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case SET_COMM_FEATURE: // Optional C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033f2 d021 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case GET_COMM_FEATURE: // Optional C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033f4 d020 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case CLEAR_COMM_FEATURE: // Optional C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033f6 d01f BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case SET_LINE_CODING: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033f8 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_CDC; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0033fa 0e03 MOVLW 0x3 0033fc 6fcb MOVWF 0xcb,0x1 0033fe 0101 MOVLB 0x1 pDst.bRam = (byte*)&line_coding; // Set destination C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003400 0ea1 MOVLW 0xa1 003402 6fce MOVWF 0xce,0x1 003404 0e01 MOVLW 0x1 003406 6fcf MOVWF 0xcf,0x1 003408 d016 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case GET_LINE_CODING: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00340a 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_CDC; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00340c 0e03 MOVLW 0x3 00340e 6fcb MOVWF 0xcb,0x1 003410 0101 MOVLB 0x1 pSrc.bRam = (byte*)&line_coding; // Set source C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003412 0ea1 MOVLW 0xa1 003414 6fcc MOVWF 0xcc,0x1 003416 0e01 MOVLW 0x1 003418 6fcd MOVWF 0xcd,0x1 00341a 0101 MOVLB 0x1 usb_stat.ctrl_trf_mem = _RAM; // Set memory type C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00341c 93d3 BCF 0xd3,0x1,0x1 00341e 0101 MOVLB 0x1 LSB(wCount) = LINE_CODING_LENGTH; // Set data count C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003420 0e07 MOVLW 0x7 003422 6fd0 MOVWF 0xd0,0x1 003424 d008 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case SET_CONTROL_LINE_STATE: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003426 0101 MOVLB 0x1 ctrl_trf_session_owner = MUID_CDC; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003428 0e03 MOVLW 0x3 00342a 6fcb MOVWF 0xcb,0x1 00342c c422 MOVFF 0x422,0x1a8 control_signal_bitmap._byte = LSB(SetupPkt.W_Value); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00342e f1a8 003430 d002 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c case SEND_BREAK: // Optional C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003432 d001 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c default: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003434 d000 BRA 0x3436 break; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c }//end switch(SetupPkt.bRequest) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003436 0012 RETURN 0x0 }//end USBCheckCDCRequest C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** U S E R A P I ***********************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: void CDCInitEP(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: CDCInitEP initializes CDC endpoints, buffer descriptors, C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * internal state-machine, and variables. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * It should be called after the USB host has sent out a C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * SET_CONFIGURATION request. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * See USBStdSetCfgHandler() in usb9.c for examples. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c void CDCInitEP(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c //Abstract line coding information C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003438 0101 MOVLB 0x1 line_coding.dwDTERate._dword = 115200; // baud rate C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00343a 6ba1 CLRF 0xa1,0x1 00343c 0ec2 MOVLW 0xc2 00343e 6fa2 MOVWF 0xa2,0x1 003440 0e01 MOVLW 0x1 003442 6fa3 MOVWF 0xa3,0x1 003444 6ba4 CLRF 0xa4,0x1 003446 0101 MOVLB 0x1 line_coding.bCharFormat = 0x00; // 1 stop bit C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003448 6ba5 CLRF 0xa5,0x1 00344a 0101 MOVLB 0x1 line_coding.bParityType = 0x00; // None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00344c 6ba6 CLRF 0xa6,0x1 00344e 0101 MOVLB 0x1 line_coding.bDataBits = 0x08; // 5,6,7,8, or 16 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003450 0e08 MOVLW 0x8 003452 6fa7 MOVWF 0xa7,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003454 0101 MOVLB 0x1 cdc_trf_state = CDC_TX_READY; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003456 6b9a CLRF 0x9a,0x1 003458 0101 MOVLB 0x1 cdc_rx_len = 0; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00345a 6b99 CLRF 0x99,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00345c 0e1a MOVLW 0x1a CDC_COMM_UEP = EP_IN|HSHK_EN; // Enable 1 Comm pipe C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00345e 6e72 MOVWF 0x72,0x0 003460 0e1e MOVLW 0x1e CDC_DATA_UEP = EP_OUT_IN|HSHK_EN; // Enable 2 data pipes C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003462 6e73 MOVWF 0x73,0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Do not have to init Cnt of IN pipes here. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Reason: Number of bytes to send to the host C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * varies from one transaction to C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * another. Cnt should equal the exact C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * number of bytes to transmit for C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * a given IN transaction. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * This number of bytes will only C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * be known right before the data is C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * sent. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003464 0104 MOVLB 0x4 CDC_INT_BD_IN.ADR = (byte*)&cdc_notice; // Set buffer address C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003466 0e00 MOVLW 0x0 003468 6f16 MOVWF 0x16,0x1 00346a 0e05 MOVLW 0x5 00346c 6f17 MOVWF 0x17,0x1 00346e 0104 MOVLB 0x4 CDC_INT_BD_IN.Stat._byte = _UCPU|_DAT1; // Set status C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003470 0e40 MOVLW 0x40 003472 6f14 MOVWF 0x14,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003474 0104 MOVLB 0x4 CDC_BULK_BD_OUT.Cnt = sizeof(cdc_data_rx); // Set buffer size C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003476 0e40 MOVLW 0x40 003478 6f19 MOVWF 0x19,0x1 00347a 0104 MOVLB 0x4 CDC_BULK_BD_OUT.ADR = (byte*)&cdc_data_rx; // Set buffer address C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00347c 0e08 MOVLW 0x8 00347e 6f1a MOVWF 0x1a,0x1 003480 0e05 MOVLW 0x5 003482 6f1b MOVWF 0x1b,0x1 003484 0104 MOVLB 0x4 CDC_BULK_BD_OUT.Stat._byte = _USIE|_DAT0|_DTSEN;// Set status C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003486 0e88 MOVLW 0x88 003488 6f18 MOVWF 0x18,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00348a 0104 MOVLB 0x4 CDC_BULK_BD_IN.ADR = (byte*)&cdc_data_tx; // Set buffer size C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00348c 0e48 MOVLW 0x48 00348e 6f1e MOVWF 0x1e,0x1 003490 0e05 MOVLW 0x5 003492 6f1f MOVWF 0x1f,0x1 003494 0104 MOVLB 0x4 CDC_BULK_BD_IN.Stat._byte = _UCPU|_DAT1; // Set buffer address C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003496 0e40 MOVLW 0x40 003498 6f1c MOVWF 0x1c,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00349a 0012 RETURN 0x0 }//end CDCInitEP C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: byte getsUSBUSART(char *buffer, C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * byte len) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: Value of input argument 'len' should be smaller than the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * maximum endpoint size responsible for receiving bulk C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * data from USB host for CDC class. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input argument 'buffer' should point to a buffer area that C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * is bigger or equal to the size specified by 'len'. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: buffer : Pointer to where received bytes are to be stored C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * len : The number of bytes expected. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: The number of bytes copied to buffer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: Publicly accessible variable cdc_rx_len is updated with C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * the number of bytes copied to buffer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Once getsUSBUSART is called, subsequent retrieval of C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * cdc_rx_len can be done by calling macro mCDCGetRxLength(). C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: getsUSBUSART copies a string of bytes received through C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * USB CDC Bulk OUT endpoint to a user's specified location. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * It is a non-blocking function. It does not wait C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * for data if there is no data available. Instead it returns C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * '0' to notify the caller that there is no data available. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: If the actual number of bytes received is larger than the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * number of bytes expected (len), only the expected number C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * of bytes specified will be copied to buffer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If the actual number of bytes received is smaller than the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * number of bytes expected (len), only the actual number C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * of bytes received will be copied to buffer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00349c cfd9 MOVFF 0xfd9,0xfe6 byte getsUSBUSART(unsigned char *buffer, byte len) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00349e ffe6 0034a0 cfe1 MOVFF 0xfe1,0xfd9 0034a2 ffd9 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034a4 0101 MOVLB 0x1 cdc_rx_len = 0; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034a6 6b99 CLRF 0x99,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034a8 0104 MOVLB 0x4 if(!mCDCUsartRxIsBusy()) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034aa bf18 BTFSC 0x18,0x7,0x1 0034ac d039 BRA 0x3520 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Adjust the expected number of bytes to equal C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * the actual number of bytes received. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034ae 0efc MOVLW 0xfc if(len > CDC_BULK_BD_OUT.Cnt) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034b0 cfdb MOVFF 0xfdb,0x2a 0034b2 f02a 0034b4 0104 MOVLB 0x4 0034b6 5119 MOVF 0x19,0x0,0x1 0034b8 80d8 BSF 0xd8,0x0,0x0 0034ba 542a SUBFWB 0x2a,0x0,0x0 0034bc e203 BC 0x34c4 0034be 0efc MOVLW 0xfc len = CDC_BULK_BD_OUT.Cnt; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034c0 c419 MOVFF 0x419,0xfdb 0034c2 ffdb C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Copy data from dual-ram buffer to user's buffer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034c4 0101 MOVLB 0x1 for(cdc_rx_len = 0; cdc_rx_len < len; cdc_rx_len++) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034c6 6b99 CLRF 0x99,0x1 0034c8 0efc MOVLW 0xfc 0034ca 50db MOVF 0xdb,0x0,0x0 0034cc 0101 MOVLB 0x1 0034ce 5d99 SUBWF 0x99,0x0,0x1 0034d0 e21c BC 0x350a 003504 0101 MOVLB 0x1 003506 2b99 INCF 0x99,0x1,0x1 003508 d7df BRA 0x34c8 0034d2 0101 MOVLB 0x1 buffer[cdc_rx_len] = cdc_data_rx[cdc_rx_len]; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0034d4 5199 MOVF 0x99,0x0,0x1 0034d6 6aea CLRF 0xea,0x0 0034d8 0f08 ADDLW 0x8 0034da 6ee9 MOVWF 0xe9,0x0 0034dc 0e05 MOVLW 0x5 0034de 22ea ADDWFC 0xea,0x1,0x0 0034e0 50ef MOVF 0xef,0x0,0x0 0034e2 6ee6 MOVWF 0xe6,0x0 0034e4 0101 MOVLB 0x1 0034e6 5199 MOVF 0x99,0x0,0x1 0034e8 6ee7 MOVWF 0xe7,0x0 0034ea 0efd MOVLW 0xfd 0034ec cfdb MOVFF 0xfdb,0xfe9 0034ee ffe9 0034f0 0efe MOVLW 0xfe 0034f2 cfdb MOVFF 0xfdb,0xfea 0034f4 ffea 0034f6 50e7 MOVF 0xe7,0x0,0x0 0034f8 26e9 ADDWF 0xe9,0x1,0x0 0034fa 0e00 MOVLW 0x0 0034fc 22ea ADDWFC 0xea,0x1,0x0 0034fe 52e5 MOVF 0xe5,0x1,0x0 003500 50e7 MOVF 0xe7,0x0,0x0 003502 6eef MOVWF 0xef,0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Prepare dual-ram buffer for next OUT transaction C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00350a 0104 MOVLB 0x4 CDC_BULK_BD_OUT.Cnt = sizeof(cdc_data_rx); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00350c 0e40 MOVLW 0x40 00350e 6f19 MOVWF 0x19,0x1 003510 0e40 MOVLW 0x40 mUSBBufferReady(CDC_BULK_BD_OUT); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003512 0104 MOVLB 0x4 003514 1718 ANDWF 0x18,0x1,0x1 003516 0104 MOVLB 0x4 003518 7d18 BTG 0x18,0x6,0x1 00351a 0e88 MOVLW 0x88 00351c 0104 MOVLB 0x4 00351e 1318 IORWF 0x18,0x1,0x1 }//end if C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003520 0101 MOVLB 0x1 return cdc_rx_len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003522 5199 MOVF 0x99,0x0,0x1 003524 d000 BRA 0x3526 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003526 52e5 MOVF 0xe5,0x1,0x0 }//end getsUSBUSART C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003528 cfe7 MOVFF 0xfe7,0xfd9 00352a ffd9 00352c 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: void putsUSBUSART(char *data) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: cdc_trf_state must be in the CDC_TX_READY state. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The string of characters pointed to by 'data' must equal C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to or smaller than 255 bytes. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: data : Pointer to a null-terminated string of data. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If a null character is not found, 255 bytes C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * of data will be transferred to the host. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: putsUSBUSART writes a string of data to the USB including C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * the null character. Use this version, 'puts', to transfer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * data located in data memory. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: The transfer mechanism for device-to-host(put) is more C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * flexible than host-to-device(get). It can handle C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * a string of data larger than the maximum size of bulk IN C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * endpoint. A state machine is used to transfer a long C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * string of data over multiple USB transactions. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * See CDCTxService() for more details. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00352e cfd9 MOVFF 0xfd9,0xfe6 void putsUSBUSART(unsigned char *data) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003530 ffe6 003532 cfe1 MOVFF 0xfe1,0xfd9 003534 ffd9 003536 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * User should have checked that cdc_trf_state is in CDC_TX_READY state C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * before calling this function. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * As a safety precaution, this fuction checks the state one more time C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to make sure it does not override any pending transactions. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Currently it just quits the routine without reporting any errors back C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to the user. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Bottomline: User MUST make sure that mUSBUSARTIsTxTrfReady()==1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * before calling this function! C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Example: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * if(mUSBUSARTIsTxTrfReady()) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * putsUSBUSART(pData); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * IMPORTANT: Never use the following blocking while loop to wait: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * while(!mUSBUSARTIsTxTrfReady()) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * putsUSBUSART(pData); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The whole firmware framework is written based on cooperative C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * multi-tasking and a blocking code is not acceptable. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Use a state machine instead. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003538 0101 MOVLB 0x1 if(cdc_trf_state != CDC_TX_READY) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00353a 519a MOVF 0x9a,0x0,0x1 00353c e001 BZ 0x3540 00353e d031 BRA 0x35a2 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * While loop counts the number of bytes to send including the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * null character. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003540 6adf CLRF 0xdf,0x0 len = 0; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c do C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003542 2adf INCF 0xdf,0x1,0x0 len++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003544 50df MOVF 0xdf,0x0,0x0 if(len == 256) break; // Break loop once max len is reached. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003546 6e2a MOVWF 0x2a,0x0 003548 6a2b CLRF 0x2b,0x0 00354a 502a MOVF 0x2a,0x0,0x0 00354c e102 BNZ 0x3552 00354e 0e01 MOVLW 0x1 003550 182b XORWF 0x2b,0x0,0x0 003552 e101 BNZ 0x3556 003554 d00b BRA 0x356c 003556 0efd MOVLW 0xfd }while(*data++); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003558 cfdb MOVFF 0xfdb,0xfe9 00355a ffe9 00355c 2adb INCF 0xdb,0x1,0x0 00355e 0efe MOVLW 0xfe 003560 cfdb MOVFF 0xfdb,0xfea 003562 ffea 003564 e301 BNC 0x3568 003566 2adb INCF 0xdb,0x1,0x0 003568 50ef MOVF 0xef,0x0,0x0 00356a e1eb BNZ 0x3542 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Re-adjust pointer to its initial location C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00356c 50df MOVF 0xdf,0x0,0x0 data-=len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00356e 6e2a MOVWF 0x2a,0x0 003570 6a2b CLRF 0x2b,0x0 003572 50d9 MOVF 0xd9,0x0,0x0 003574 0ffd ADDLW 0xfd 003576 6ee9 MOVWF 0xe9,0x0 003578 0eff MOVLW 0xff 00357a 20da ADDWFC 0xda,0x0,0x0 00357c 6eea MOVWF 0xea,0x0 00357e 502a MOVF 0x2a,0x0,0x0 003580 5eee SUBWF 0xee,0x1,0x0 003582 502b MOVF 0x2b,0x0,0x0 003584 5aed SUBWFB 0xed,0x1,0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c // BPS - 05/04/2006 I don't want the NULL at the end. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003586 06df DECF 0xdf,0x1,0x0 len--; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Second piece of information (length of data to send) is ready. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Call mUSBUSARTTxRam to setup the transfer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The actual transfer process will be handled by CDCTxService(), C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * which should be called once per Main Program loop. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003588 0efd MOVLW 0xfd mUSBUSARTTxRam((byte*)data,len); // See cdc.h C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00358a cfdb MOVFF 0xfdb,0x19b 00358c f19b 00358e 0efe MOVLW 0xfe 003590 cfdb MOVFF 0xfdb,0x19c 003592 f19c 003594 cfdf MOVFF 0xfdf,0x19f 003596 f19f 003598 0101 MOVLB 0x1 00359a 6ba0 CLRF 0xa0,0x1 00359c 0101 MOVLB 0x1 00359e 0e01 MOVLW 0x1 0035a0 6f9a MOVWF 0x9a,0x1 0035a2 52e5 MOVF 0xe5,0x1,0x0 }//end putsUSBUSART C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035a4 52e5 MOVF 0xe5,0x1,0x0 0035a6 cfe7 MOVFF 0xfe7,0xfd9 0035a8 ffd9 0035aa 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: void putrsUSBUSART(const rom char *data) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: cdc_trf_state must be in the CDC_TX_READY state. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The string of characters pointed to by 'data' must equal C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to or smaller than 255 bytes. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: data : Pointer to a null-terminated string of data. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If a null character is not found, 255 bytes C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * of data will be transferred to the host. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: putrsUSBUSART writes a string of data to the USB including C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * the null character. Use this version, 'putrs', to transfer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * data literals and data located in program memory. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: The transfer mechanism for device-to-host(put) is more C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * flexible than host-to-device(get). It can handle C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * a string of data larger than the maximum size of bulk IN C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * endpoint. A state machine is used to transfer a long C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * string of data over multiple USB transactions. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * See CDCTxService() for more details. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035ac cfd9 MOVFF 0xfd9,0xfe6 void putrsUSBUSART(const rom unsigned char *data) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035ae ffe6 0035b0 cfe1 MOVFF 0xfe1,0xfd9 0035b2 ffd9 0035b4 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * User should have checked that cdc_trf_state is in CDC_TX_READY state C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * before calling this function. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * As a safety precaution, this fuction checks the state one more time C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to make sure it does not override any pending transactions. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Currently it just quits the routine without reporting any errors back C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * to the user. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Bottomline: User MUST make sure that mUSBUSARTIsTxTrfReady() C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * before calling this function! C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Example: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * if(mUSBUSARTIsTxTrfReady()) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * putsUSBUSART(pData); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * IMPORTANT: Never use the following blocking while loop to wait: C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * while(cdc_trf_state != CDC_TX_READY) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * putsUSBUSART(pData); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The whole firmware framework is written based on cooperative C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * multi-tasking and a blocking code is not acceptable. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Use a state machine instead. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035b6 0101 MOVLB 0x1 if(cdc_trf_state != CDC_TX_READY) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035b8 519a MOVF 0x9a,0x0,0x1 0035ba e001 BZ 0x35be 0035bc d033 BRA 0x3624 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * While loop counts the number of bytes to send including the C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * null character. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035be 6adf CLRF 0xdf,0x0 len = 0; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c do C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035c0 2adf INCF 0xdf,0x1,0x0 len++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035c2 50df MOVF 0xdf,0x0,0x0 if(len == 255) break; // Break loop once max len is reached. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035c4 6e2a MOVWF 0x2a,0x0 0035c6 6a2b CLRF 0x2b,0x0 0035c8 0eff MOVLW 0xff 0035ca 182a XORWF 0x2a,0x0,0x0 0035cc e101 BNZ 0x35d0 0035ce 502b MOVF 0x2b,0x0,0x0 0035d0 e101 BNZ 0x35d4 0035d2 d00c BRA 0x35ec 0035d4 0efd MOVLW 0xfd }while(*data++); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035d6 cfdb MOVFF 0xfdb,0xff6 0035d8 fff6 0035da 2adb INCF 0xdb,0x1,0x0 0035dc 0efe MOVLW 0xfe 0035de cfdb MOVFF 0xfdb,0xff7 0035e0 fff7 0035e2 e301 BNC 0x35e6 0035e4 2adb INCF 0xdb,0x1,0x0 0035e6 0008 TBLRD 0035e8 50f5 MOVF 0xf5,0x0,0x0 0035ea e1ea BNZ 0x35c0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Re-adjust pointer to its initial location C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035ec 50df MOVF 0xdf,0x0,0x0 data-=len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0035ee 6e2a MOVWF 0x2a,0x0 0035f0 6a2b CLRF 0x2b,0x0 0035f2 50d9 MOVF 0xd9,0x0,0x0 0035f4 0ffd ADDLW 0xfd 0035f6 6ee9 MOVWF 0xe9,0x0 0035f8 0eff MOVLW 0xff 0035fa 20da ADDWFC 0xda,0x0,0x0 0035fc 6eea MOVWF 0xea,0x0 0035fe 502a MOVF 0x2a,0x0,0x0 003600 5eee SUBWF 0xee,0x1,0x0 003602 502b MOVF 0x2b,0x0,0x0 003604 5aed SUBWFB 0xed,0x1,0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c // BPS - 05/04/2006 I don't want the NULL at the end. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003606 06df DECF 0xdf,0x1,0x0 len--; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Second piece of information (length of data to send) is ready. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Call mUSBUSARTTxRom to setup the transfer. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * The actual transfer process will be handled by CDCTxService(), C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * which should be called once per Main Program loop. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * (BPS 5/16/2006) Don't add the zero byte at the end. Send len-1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * bytes intead of len bytes. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003608 0efd MOVLW 0xfd mUSBUSARTTxRom((rom byte*)data,len); // See cdc.h C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00360a cfdb MOVFF 0xfdb,0x19b 00360c f19b 00360e 0efe MOVLW 0xfe 003610 cfdb MOVFF 0xfdb,0x19c 003612 f19c 003614 cfdf MOVFF 0xfdf,0x19f 003616 f19f 003618 0101 MOVLB 0x1 00361a 0e01 MOVLW 0x1 00361c 6fa0 MOVWF 0xa0,0x1 00361e 0101 MOVLB 0x1 003620 0e01 MOVLW 0x1 003622 6f9a MOVWF 0x9a,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003624 52e5 MOVF 0xe5,0x1,0x0 }//end putrsUSBUSART C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003626 52e5 MOVF 0xe5,0x1,0x0 003628 cfe7 MOVFF 0xfe7,0xfd9 00362a ffd9 00362c 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /****************************************************************************** C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Function: void CDCTxService(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * PreCondition: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Input: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Output: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Side Effects: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Overview: CDCTxService handles device-to-host transaction(s). C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * This function should be called once per Main Program loop. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Note: None C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c *****************************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00362e cfd9 MOVFF 0xfd9,0xfe6 void CDCTxService(void) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003630 ffe6 003632 cfe1 MOVFF 0xfe1,0xfd9 003634 ffd9 003636 52e6 MOVF 0xe6,0x1,0x0 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c byte byte_to_send; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003638 0104 MOVLB 0x4 if(mCDCUsartTxIsBusy()) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00363a bf1c BTFSC 0x1c,0x7,0x1 00363c d07d BRA 0x3738 /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Completing stage is necessary while [ mCDCUSartTxIsBusy()==1 ]. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * By having this stage, user can always check cdc_trf_state, C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * and not having to call mCDCUsartTxIsBusy() directly. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00363e 0e03 MOVLW 0x3 if(cdc_trf_state == CDC_TX_COMPLETING) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003640 0101 MOVLB 0x1 003642 5d9a SUBWF 0x9a,0x0,0x1 003644 e102 BNZ 0x364a 003646 0101 MOVLB 0x1 cdc_trf_state = CDC_TX_READY; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003648 6b9a CLRF 0x9a,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If CDC_TX_READY state, nothing to do, just return. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00364a 0101 MOVLB 0x1 if(cdc_trf_state == CDC_TX_READY) return; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00364c 519a MOVF 0x9a,0x0,0x1 00364e e101 BNZ 0x3652 003650 d073 BRA 0x3738 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * If CDC_TX_BUSY_ZLP state, send zero length packet C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003652 0e02 MOVLW 0x2 if(cdc_trf_state == CDC_TX_BUSY_ZLP) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003654 0101 MOVLB 0x1 003656 5d9a SUBWF 0x9a,0x0,0x1 003658 e106 BNZ 0x3666 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00365a 0104 MOVLB 0x4 CDC_BULK_BD_IN.Cnt = 0; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00365c 6b1d CLRF 0x1d,0x1 00365e 0101 MOVLB 0x1 cdc_trf_state = CDC_TX_COMPLETING; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003660 0e03 MOVLW 0x3 003662 6f9a MOVWF 0x9a,0x1 } C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003664 d061 BRA 0x3728 else if(cdc_trf_state == CDC_TX_BUSY) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003666 0101 MOVLB 0x1 003668 059a DECF 0x9a,0x0,0x1 00366a e15e BNZ 0x3728 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * First, have to figure out how many byte of data to send. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00366c 0e40 MOVLW 0x40 if(cdc_tx_len > sizeof(cdc_data_tx)) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00366e 6e2a MOVWF 0x2a,0x0 003670 6a2b CLRF 0x2b,0x0 003672 0101 MOVLB 0x1 003674 519f MOVF 0x9f,0x0,0x1 003676 5c2a SUBWF 0x2a,0x0,0x0 003678 0e00 MOVLW 0x0 00367a 582b SUBWFB 0x2b,0x0,0x0 00367c e203 BC 0x3684 00367e 0e40 MOVLW 0x40 byte_to_send = sizeof(cdc_data_tx); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003680 6edf MOVWF 0xdf,0x0 003682 d002 BRA 0x3688 else C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003684 c19f MOVFF 0x19f,0xfdf byte_to_send = cdc_tx_len; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003686 ffdf C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Next, load the number of bytes to send to Cnt in buffer descriptor C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003688 cfdf MOVFF 0xfdf,0x41d CDC_BULK_BD_IN.Cnt = byte_to_send; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00368a f41d C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Subtract the number of bytes just about to be sent from the total. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00368c 50df MOVF 0xdf,0x0,0x0 cdc_tx_len = cdc_tx_len - byte_to_send; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00368e 0101 MOVLB 0x1 003690 5d9f SUBWF 0x9f,0x0,0x1 003692 0101 MOVLB 0x1 003694 6f9f MOVWF 0x9f,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003696 0101 MOVLB 0x1 pCDCDst.bRam = (byte*)&cdc_data_tx; // Set destination pointer C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003698 0e48 MOVLW 0x48 00369a 6f9d MOVWF 0x9d,0x1 00369c 0e05 MOVLW 0x5 00369e 6f9e MOVWF 0x9e,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036a0 0101 MOVLB 0x1 if(cdc_mem_type == _ROM) // Determine type of memory source C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036a2 05a0 DECF 0xa0,0x0,0x1 0036a4 e118 BNZ 0x36d6 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036a6 50df MOVF 0xdf,0x0,0x0 while(byte_to_send) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036a8 e015 BZ 0x36d4 0036d2 d7e9 BRA 0x36a6 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036aa c19b MOVFF 0x19b,0xff6 *pCDCDst.bRam = *pCDCSrc.bRom; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036ac fff6 0036ae c19c MOVFF 0x19c,0xff7 0036b0 fff7 0036b2 0008 TBLRD 0036b4 50f5 MOVF 0xf5,0x0,0x0 0036b6 c19d MOVFF 0x19d,0xfe9 0036b8 ffe9 0036ba c19e MOVFF 0x19e,0xfea 0036bc ffea 0036be 6eef MOVWF 0xef,0x0 0036c0 0101 MOVLB 0x1 pCDCDst.bRam++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036c2 2b9d INCF 0x9d,0x1,0x1 0036c4 0e00 MOVLW 0x0 0036c6 239e ADDWFC 0x9e,0x1,0x1 0036c8 0101 MOVLB 0x1 pCDCSrc.bRom++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036ca 2b9b INCF 0x9b,0x1,0x1 0036cc 0e00 MOVLW 0x0 0036ce 239c ADDWFC 0x9c,0x1,0x1 0036d0 06df DECF 0xdf,0x1,0x0 byte_to_send--; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c }//end while(byte_to_send) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c } C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036d4 d016 BRA 0x3702 else // _RAM C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036d6 50df MOVF 0xdf,0x0,0x0 while(byte_to_send) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036d8 e014 BZ 0x3702 003700 d7ea BRA 0x36d6 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036da c19b MOVFF 0x19b,0xfe9 *pCDCDst.bRam = *pCDCSrc.bRam; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036dc ffe9 0036de c19c MOVFF 0x19c,0xfea 0036e0 ffea 0036e2 50ef MOVF 0xef,0x0,0x0 0036e4 c19d MOVFF 0x19d,0xfe9 0036e6 ffe9 0036e8 c19e MOVFF 0x19e,0xfea 0036ea ffea 0036ec 6eef MOVWF 0xef,0x0 0036ee 0101 MOVLB 0x1 pCDCDst.bRam++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036f0 2b9d INCF 0x9d,0x1,0x1 0036f2 0e00 MOVLW 0x0 0036f4 239e ADDWFC 0x9e,0x1,0x1 0036f6 0101 MOVLB 0x1 pCDCSrc.bRam++; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 0036f8 2b9b INCF 0x9b,0x1,0x1 0036fa 0e00 MOVLW 0x0 0036fc 239c ADDWFC 0x9c,0x1,0x1 0036fe 06df DECF 0xdf,0x1,0x0 byte_to_send--; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c }//end while(byte_to_send._word) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c }//end if(cdc_mem_type...) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Lastly, determine if a zero length packet state is necessary. C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * See explanation in USB Specification 2.0: Section 5.8.3 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003702 0101 MOVLB 0x1 if(cdc_tx_len == 0) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003704 519f MOVF 0x9f,0x0,0x1 003706 e110 BNZ 0x3728 { C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003708 0104 MOVLB 0x4 if(CDC_BULK_BD_IN.Cnt == sizeof(cdc_data_tx)) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00370a 511d MOVF 0x1d,0x0,0x1 00370c 6e2a MOVWF 0x2a,0x0 00370e 6a2b CLRF 0x2b,0x0 003710 0e40 MOVLW 0x40 003712 182a XORWF 0x2a,0x0,0x0 003714 e101 BNZ 0x3718 003716 502b MOVF 0x2b,0x0,0x0 003718 e104 BNZ 0x3722 00371a 0101 MOVLB 0x1 cdc_trf_state = CDC_TX_BUSY_ZLP; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00371c 0e02 MOVLW 0x2 00371e 6f9a MOVWF 0x9a,0x1 003720 d003 BRA 0x3728 else C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003722 0101 MOVLB 0x1 cdc_trf_state = CDC_TX_COMPLETING; C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003724 0e03 MOVLW 0x3 003726 6f9a MOVWF 0x9a,0x1 }//end if(cdc_tx_len...) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c }//end if(cdc_tx_sate == CDC_TX_BUSY) C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /* C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c * Both CDC_TX_BUSY and CDC_TX_BUSY_ZLP states use the following macro C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c */ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003728 0e40 MOVLW 0x40 mUSBBufferReady(CDC_BULK_BD_IN); C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00372a 0104 MOVLB 0x4 00372c 171c ANDWF 0x1c,0x1,0x1 00372e 0104 MOVLB 0x4 003730 7d1c BTG 0x1c,0x6,0x1 003732 0e88 MOVLW 0x88 003734 0104 MOVLB 0x4 003736 131c IORWF 0x1c,0x1,0x1 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 003738 52e5 MOVF 0xe5,0x1,0x0 }//end CDCTxService C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c 00373a 52e5 MOVF 0xe5,0x1,0x0 00373c cfe7 MOVFF 0xfe7,0xfd9 00373e ffd9 003740 0012 RETURN 0x0 C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c #endif //USB_USE_CDC C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c /** EOF cdc.c ****************************************************************/ C:\Projects\UBW\FW\D_143\system\usb\class\cdc\cdc.c LIST P=18F2455 C:\MCC18\SRC\TRADIT~1\PROC\p18f2455.asm LIST C:\MCC18\SRC\TRADIT~1\PROC\p18f2455.asm END C:\MCC18\SRC\TRADIT~1\PROC\p18f2455.asm #include "p18cxxx.inc" C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm LIST C:\MCC18\MPASM\p18cxxx.inc ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\p18cxxx.inc LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C242 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C252 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C442 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C452 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C601 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C658 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C801 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18C858 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F1220 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F1230 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F1320 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F1330 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2220 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2221 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2320 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2321 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2331 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2410 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F242 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2420 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2423 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2431 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2439 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2450 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2455 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2458 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F248 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2480 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F24J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F24K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2510 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2515 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F252 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2520 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2523 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2525 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2539 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2550 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2553 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F258 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2580 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2585 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F25J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F25K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2610 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2620 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2680 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2682 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F2685 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F26K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4220 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4221 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4320 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4321 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4331 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4410 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F442 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4420 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4423 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4431 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4439 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4450 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4455 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4458 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F448 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4480 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F44J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F44K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4510 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4515 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F452 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4520 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4523 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4525 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4539 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4550 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4553 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F458 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4580 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4585 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F45J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F45K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4610 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4620 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4680 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4682 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F4685 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F46K20 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6310 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6390 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F63J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F63J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6410 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6490 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F64J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F64J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6520 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6525 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6527 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6585 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F65J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F65J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F65J15 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F65J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F65J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6620 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6621 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6622 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6627 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6628 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6680 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J15 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J16 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J55 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F66J65 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6720 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6722 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F6723 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F67J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F67J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F67J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F67J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8310 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8390 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F83J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F83J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8410 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8490 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F84J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F84J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8520 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8525 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8527 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8585 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F85J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F85J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F85J15 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F85J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F85J90 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8620 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8621 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8622 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8627 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8628 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8680 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J15 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J16 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J55 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F86J65 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8720 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8722 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F8723 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F87J10 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F87J11 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F87J50 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F87J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F96J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F96J65 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc IFDEF __18F97J60 C:\MCC18\MPASM\p18cxxx.inc INCLUDE C:\MCC18\MPASM\p18cxxx.inc ENDIF C:\MCC18\MPASM\p18cxxx.inc C:\MCC18\MPASM\p18cxxx.inc C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;/******************************************************************** C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* Function Name: Delay10TCYx * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* Return Value: void * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* Parameters: unit: * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* Description: This routine delays for multiples of 10 * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* instruction cycles that is specified in unit. * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* Special Note: This routine provides multiples of 10 Tcy. * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* A value of 1 to 255 provides 10 to 2550 Tcy * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* delay. A value of 0 will provide a delay of * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;* 2560 Tcy. * C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ;********************************************************************/ C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm D10TCYXCODE CODE C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm Delay10TCYx C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045d2 0eff MOVLW 0xff movlw 0xff C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045d4 50e3 MOVF 0xe3,0x0,0x0 movf PLUSW1,0 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045d6 4ee8 DCFSNZ 0xe8,0x1,0x0 dcfsnz WREG,1 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045d8 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm D10x C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045da 0000 NOP nop C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045dc d000 BRA 0x45de bra $+2 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045de d000 BRA 0x45e0 bra $+2 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045e0 d000 BRA 0x45e2 bra $+2 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm D10_1 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045e2 2ee8 DECFSZ 0xe8,0x1,0x0 decfsz WREG,1 C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045e4 d7fa BRA 0x45da bra D10x C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm 0045e6 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm GLOBAL Delay10TCYx C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm END C:\MCC18\SRC\TRADIT~1\DELAYS\d10tcyx.asm ; RCS Header $Id: fxm2424u.asm,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; $Revision: 1.3 $ C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm include ; general Golden Gate definitions C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm include ; Math library definitions C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; RCS Header $Id: cmath18.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC ; $Revision: 1.3 $ C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC LIST C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC ; CMATH18.INC v1.0 Microchip Technology, Inc. / F.J. Testa C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC LIST C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm include ; AARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; RCS Header $Id: aarg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AARGB0, __AARGB1, __AARGB2, __AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AARGB4, __AARGB5, __AARGB6, __AARGB7 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AEXP C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __REMB3, __REMB2, __REMB1, __REMB0 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm include ; BARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; RCS Header $Id: barg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC EXTERN __BARGB3, __BARGB2, __BARGB1, __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC EXTERN __BEXP C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm include ; TEMPARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; RCS Header $Id: temparg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC EXTERN __TEMPB3, __TEMPB2, __TEMPB1, __TEMPB0, __TEMP C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ;********************************************************************************************** C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ;********************************************************************************************** C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; 24x24 Bit Unsigned Fixed Point Multiply 24 x 24 -> 48 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Input: 24 bit unsigned fixed point multiplicand in AARGB0, AARGB1, C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; AARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; 24 bit unsigned fixed point multiplier in BARGB0, BARGB1, C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; BARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Use: CALL FXM2424U C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Output: 48 bit unsigned fixed point product in AARGB0, AARGB1, C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; AARGB2, AARGB3, AARGB4, AARGB5 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Result: AARG <-- AARG * BARG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Max Timing: 65 clks C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; Min Timing: 65 clks C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; PM: 64 DM: 12 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm PROG CODE C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm FXM2424U C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm GLOBAL FXM2424U C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004066 c01f MOVFF 0x1f,0x29 MOVFF __AARGB0,__TEMPB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004068 f029 00406a c01e MOVFF 0x1e,0x28 MOVFF __AARGB1,__TEMPB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00406c f028 00406e c01d MOVFF 0x1d,0x27 MOVFF __AARGB2,__TEMPB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004070 f027 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004072 501d MOVF 0x1d,0x0,0x0 MOVF __AARGB2,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004074 0222 MULWF 0x22,0x0 MULWF __BARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004076 cff4 MOVFF 0xff4,0x1b MOVFF PRODH,__AARGB4 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004078 f01b 00407a cff3 MOVFF 0xff3,0x1a MOVFF PRODL,__AARGB5 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00407c f01a C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00407e 501e MOVF 0x1e,0x0,0x0 MOVF __AARGB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004080 0223 MULWF 0x23,0x0 MULWF __BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004082 cff4 MOVFF 0xff4,0x1d MOVFF PRODH,__AARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004084 f01d 004086 cff3 MOVFF 0xff3,0x1c MOVFF PRODL,__AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004088 f01c C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00408a 0222 MULWF 0x22,0x0 MULWF __BARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00408c 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00408e 261b ADDWF 0x1b,0x1,0x0 ADDWF __AARGB4,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004090 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004092 221c ADDWFC 0x1c,0x1,0x0 ADDWFC __AARGB3,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004094 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004096 221d ADDWFC 0x1d,0x1,0x0 ADDWFC __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 004098 5027 MOVF 0x27,0x0,0x0 MOVF __TEMPB2,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00409a 0223 MULWF 0x23,0x0 MULWF __BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00409c 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 00409e 261b ADDWF 0x1b,0x1,0x0 ADDWF __AARGB4,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040a0 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040a2 221c ADDWFC 0x1c,0x1,0x0 ADDWFC __AARGB3,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040a4 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040a6 221d ADDWFC 0x1d,0x1,0x0 ADDWFC __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040a8 501f MOVF 0x1f,0x0,0x0 MOVF __AARGB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040aa 0222 MULWF 0x22,0x0 MULWF __BARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ac 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ae 261c ADDWF 0x1c,0x1,0x0 ADDWF __AARGB3,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040b0 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040b2 221d ADDWFC 0x1d,0x1,0x0 ADDWFC __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040b4 501f MOVF 0x1f,0x0,0x0 MOVF __AARGB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040b6 0223 MULWF 0x23,0x0 MULWF __BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040b8 6a1e CLRF 0x1e,0x0 CLRF __AARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ba 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040bc 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040be 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040c0 261d ADDWF 0x1d,0x1,0x0 ADDWF __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040c2 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040c4 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040c6 5027 MOVF 0x27,0x0,0x0 MOVF __TEMPB2,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040c8 0224 MULWF 0x24,0x0 MULWF __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ca 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040cc 261c ADDWF 0x1c,0x1,0x0 ADDWF __AARGB3,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ce 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040d0 221d ADDWFC 0x1d,0x1,0x0 ADDWFC __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040d2 6a1f CLRF 0x1f,0x0 CLRF __AARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040d4 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040d6 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040d8 221f ADDWFC 0x1f,0x1,0x0 ADDWFC __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040da 5028 MOVF 0x28,0x0,0x0 MOVF __TEMPB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040dc 0224 MULWF 0x24,0x0 MULWF __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040de 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040e0 261d ADDWF 0x1d,0x1,0x0 ADDWF __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040e2 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040e4 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040e6 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040e8 221f ADDWFC 0x1f,0x1,0x0 ADDWFC __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ea 5029 MOVF 0x29,0x0,0x0 MOVF __TEMPB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ec 0224 MULWF 0x24,0x0 MULWF __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040ee 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040f0 261e ADDWF 0x1e,0x1,0x0 ADDWF __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040f2 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040f4 221f ADDWFC 0x1f,0x1,0x0 ADDWFC __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm 0040f6 0c00 RETLW 0x0 RETLW 0x00 C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm END C:\MCC18\SRC\TRADIT~1\MATH\fxm2424u.asm ; RCS Header $Id: cmath18.asm,v 1.5 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm ; CMATH18 DATA DEFINITION FILE C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm ; VARIABLE ALLOCATION - Core math library routines C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm MATH_DATA UDATA_ACS C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm SIGN RES 1 ; save location for sign in MSB C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm __FPFLAGSbits C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm __FPFLAGS RES 1 ; floating point library exception flags C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm GLOBAL SIGN, __FPFLAGS, __FPFLAGSbits C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm END C:\MCC18\SRC\TRADIT~1\MATH\cmath18.asm ; RCS Header $Id: aarg.asm,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm ; CMATH18 DATA DEFINITION FILE C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm ; VARIABLE ALLOCATION - Core math library routines C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm MATH_DATA UDATA_ACS C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __REMB3 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB7 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __REMB2 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB6 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __REMB1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB5 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __REMB0 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB4 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB3 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB2 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB1 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AARGB0 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm __AEXP RES 1 ; 8 bit biased exponent for argument A C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm GLOBAL __AARGB0, __AARGB1, __AARGB2, __AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm GLOBAL __AARGB4, __AARGB5, __AARGB6, __AARGB7 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm GLOBAL __AEXP C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm GLOBAL __REMB3, __REMB2, __REMB1, __REMB0 C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm END C:\MCC18\SRC\TRADIT~1\MATH\aarg.asm ; RCS Header $Id: barg.asm,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm ; CMATH18 DATA DEFINITION FILE C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\barg.asm ; VARIABLE ALLOCATION - Core math library routines C:\MCC18\SRC\TRADIT~1\MATH\barg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm MATH_DATA UDATA_ACS C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm __BARGB3 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\barg.asm __BARGB2 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\barg.asm __BARGB1 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\barg.asm __BARGB0 RES 1 ; most significant byte of argument B C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm __BEXP RES 1 ; 8 bit biased exponent for argument B C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm GLOBAL __BARGB3, __BARGB2, __BARGB1, __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\barg.asm GLOBAL __BEXP C:\MCC18\SRC\TRADIT~1\MATH\barg.asm C:\MCC18\SRC\TRADIT~1\MATH\barg.asm END C:\MCC18\SRC\TRADIT~1\MATH\barg.asm ; RCS Header $Id: temparg.asm,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm ; CMATH18 DATA DEFINITION FILE C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm ; VARIABLE ALLOCATION - Core math library routines C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm ;******************************************************************************* C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm MATH_DATA UDATA_ACS C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm __TEMPB3 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm __TEMPB2 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm __TEMPB1 RES 1 C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm __TEMP C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm __TEMPB0 RES 1 ; temporary storage C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm GLOBAL __TEMPB3, __TEMPB2, __TEMPB1, __TEMPB0, __TEMP C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm END C:\MCC18\SRC\TRADIT~1\MATH\temparg.asm #include C:\MCC18\src\TRADIT~1\stdclib\printf.c C:\MCC18\src\TRADIT~1\stdclib\printf.c /* printf() is a wrapper function which calls vfprintf() with stdout as the C:\MCC18\src\TRADIT~1\stdclib\printf.c destination output stream. EOF is returned on error, else the number C:\MCC18\src\TRADIT~1\stdclib\printf.c of characters output. */ C:\MCC18\src\TRADIT~1\stdclib\printf.c int C:\MCC18\src\TRADIT~1\stdclib\printf.c 0042be cfd9 MOVFF 0xfd9,0xfe6 printf (const rom char *fmt, ...) C:\MCC18\src\TRADIT~1\stdclib\printf.c 0042c0 ffe6 0042c2 cfda MOVFF 0xfda,0xfe6 0042c4 ffe6 0042c6 cfe1 MOVFF 0xfe1,0xfd9 0042c8 ffd9 0042ca cfe2 MOVFF 0xfe2,0xfda 0042cc ffda 0042ce 52e6 MOVF 0xe6,0x1,0x0 0042d0 52e6 MOVF 0xe6,0x1,0x0 0042d2 52e6 MOVF 0xe6,0x1,0x0 0042d4 52e6 MOVF 0xe6,0x1,0x0 { C:\MCC18\src\TRADIT~1\stdclib\printf.c va_list ap; C:\MCC18\src\TRADIT~1\stdclib\printf.c int n; C:\MCC18\src\TRADIT~1\stdclib\printf.c 0042d6 50d9 MOVF 0xd9,0x0,0x0 va_start (ap, fmt); C:\MCC18\src\TRADIT~1\stdclib\printf.c 0042d8 0ffb ADDLW 0xfb 0042da 6e2a MOVWF 0x2a,0x0 0042dc 0eff MOVLW 0xff 0042de 20da ADDWFC 0xda,0x0,0x0 0042e0 6e2b MOVWF 0x2b,0x0 0042e2 c02a MOVFF 0x2a,0xfde 0042e4 ffde 0042e6 6edd MOVWF 0xdd,0x0 0042e8 cfde MOVFF 0xfde,0xfe6 n = vfprintf (stdout, fmt, ap); C:\MCC18\src\TRADIT~1\stdclib\printf.c 0042ea ffe6 0042ec cfdd MOVFF 0xfdd,0xfe6 0042ee ffe6 0042f0 0efb MOVLW 0xfb 0042f2 cfdb MOVFF 0xfdb,0xfe6 0042f4 ffe6 0042f6 0efc MOVLW 0xfc 0042f8 cfdb MOVFF 0xfdb,0xfe6 0042fa ffe6 0042fc 0efd MOVLW 0xfd 0042fe cfdb MOVFF 0xfdb,0xfe6 004300 ffe6 004302 c1dc MOVFF 0x1dc,0xfe6 004304 ffe6 004306 c1dd MOVFF 0x1dd,0xfe6 004308 ffe6 00430a ecba CALL 0x2774,0x0 00430c f013 00430e 6e2a MOVWF 0x2a,0x0 004310 0e07 MOVLW 0x7 004312 5ce1 SUBWF 0xe1,0x0,0x0 004314 e202 BC 0x431a 004316 6ae1 CLRF 0xe1,0x0 004318 52e5 MOVF 0xe5,0x1,0x0 00431a 6ee1 MOVWF 0xe1,0x0 00431c 502a MOVF 0x2a,0x0,0x0 00431e 0e02 MOVLW 0x2 004320 cff3 MOVFF 0xff3,0xfdb 004322 ffdb 004324 0e03 MOVLW 0x3 004326 cff4 MOVFF 0xff4,0xfdb 004328 ffdb va_end (ap); C:\MCC18\src\TRADIT~1\stdclib\printf.c 00432a 0e02 MOVLW 0x2 return n; C:\MCC18\src\TRADIT~1\stdclib\printf.c 00432c cfdb MOVFF 0xfdb,0x2a 00432e f02a 004330 0e03 MOVLW 0x3 004332 cfdb MOVFF 0xfdb,0x2b 004334 f02b 004336 c02a MOVFF 0x2a,0xff3 004338 fff3 00433a c02b MOVFF 0x2b,0xff4 00433c fff4 00433e 0e04 MOVLW 0x4 } C:\MCC18\src\TRADIT~1\stdclib\printf.c 004340 5ce1 SUBWF 0xe1,0x0,0x0 004342 e202 BC 0x4348 004344 6ae1 CLRF 0xe1,0x0 004346 52e5 MOVF 0xe5,0x1,0x0 004348 6ee1 MOVWF 0xe1,0x0 00434a 52e5 MOVF 0xe5,0x1,0x0 00434c cfe5 MOVFF 0xfe5,0xfda 00434e ffda 004350 cfe7 MOVFF 0xfe7,0xfd9 004352 ffd9 004354 0012 RETURN 0x0 #include C:\MCC18\src\TRADIT~1\stdclib\stdout.c C:\MCC18\src\TRADIT~1\stdclib\stdout.c /* by default stdout issues to the USART */ C:\MCC18\src\TRADIT~1\stdclib\stdout.c FILE *stdout = _H_USART; C:\MCC18\src\TRADIT~1\stdclib\stdout.c #include "P18CXXX.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC #include "P18MACRO.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; $Id: p18macro.inc,v 1.2 2005/05/20 15:34:54 GrosbaJ Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; MACROS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC LIST C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkSetPtrToOffset macro Ptr,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Set pointer Ptr to argument in stack frame at Offset. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkPushPtrToOffset macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Push pointer onto stack to point to Offset location in stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Offset defined before push. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf INDF1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf PREINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTINC1,F,ACCESS ; increment FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkAddStackPtr macro N C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add N to FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(N) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(N&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS ; restore FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS ; restore FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+3) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 1 byte at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 2 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 3 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytesin stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytes at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;====== These branches are short ============== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWeqZ macro Label ; jmp if W == 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf WREG,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWneZ macro Label ; jmp if W != 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC tstfsz WREG,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFleL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfsgt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFgeL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfslt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpClr macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfss Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpSet macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; @name toupper C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ;The {\bf toupper} function converts a lower case character to the C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ;corresponding upper case character. C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ;@return If {\bf islower} is true for the value of {\bf c}, the corresponding C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ;upper case equivalent is returned, else the value of {\bf c} is returned C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ;unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; int toupper (int c); C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm CTYPE CODE C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm toupper C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm global toupper C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Proceedure: Use FSR0 as pointer to 'c' C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Return with result in PROD C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Set FSR0 = FSR1 - 2 ( location of 'c') after checking upper byte for 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044b0 0eff MOVLW 0xff StkSetPtrToOffset FSR0L,-1 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044b2 24e1 ADDWF 0xe1,0x0,0x0 0044b4 6ee9 MOVWF 0xe9,0x0 0044b6 0eff MOVLW 0xff 0044b8 20e2 ADDWFC 0xe2,0x0,0x0 0044ba 6eea MOVWF 0xea,0x0 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Copy 'c' into target location C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044bc cfed MOVFF 0xfed,0xff4 movff POSTDEC0, PRODH C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044be fff4 0044c0 cfef MOVFF 0xfef,0xff3 movff INDF0, PRODL C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044c2 fff3 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044c4 66f4 TSTFSZ 0xf4,0x0 tstfsz PRODH,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044c6 d007 BRA 0x44d6 bra jNoMatch ; upper byte must be 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Test for lower case condition C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044c8 0e60 MOVLW 0x60 jmpFleL PRODL,ACCESS,'a'-1,jNoMatch C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044ca 64f3 CPFSGT 0xf3,0x0 0044cc d004 BRA 0x44d6 0044ce 0e7b MOVLW 0x7b jmpFgeL PRODL,ACCESS,'z'+1,jNoMatch C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044d0 60f3 CPFSLT 0xf3,0x0 0044d2 d001 BRA 0x44d6 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm ; Convert char from lower to upper by clearing bit 5 C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044d4 9af3 BCF 0xf3,0x5,0x0 bcf PRODL,5,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm jNoMatch: C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm 0044d6 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm end C:\MCC18\SRC\TRADIT~1\STDCLIB\toupper.asm #include C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #include C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #include C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_MINUS 0x1 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_PLUS 0x2 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_SPACE 0x4 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_OCTO 0x8 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_ZERO 0x10 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FLAG_SIGNED 0x80 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c static const rom char s_digits[] = "0123456789abcdef"; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c static unsigned char C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002748 ece0 CALL 0x31c0,0x0 s_put_n_chars (FILE * handle, unsigned char n, char c) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00274a f018 0031c0 cfd9 MOVFF 0xfd9,0xfe6 0031c2 ffe6 0031c4 cfda MOVFF 0xfda,0xfe6 0031c6 ffe6 0031c8 cfe1 MOVFF 0xfe1,0xfd9 0031ca ffd9 0031cc cfe2 MOVFF 0xfe2,0xfda 0031ce ffda 0031d0 0012 RETURN 0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00274c 0efb MOVLW 0xfb while (n--) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00274e cfdb MOVFF 0xfdb,0xff3 002750 fff3 002752 06db DECF 0xdb,0x1,0x0 002754 50f3 MOVF 0xf3,0x0,0x0 002756 0900 IORLW 0x0 002758 e00a BZ 0x276e 00275a ec2e CALL 0x325c,0x0 if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00275c f019 00275e 0efa MOVLW 0xfa 002760 ec99 CALL 0x3332,0x0 002762 f019 002764 e1f3 BNZ 0x274c 002766 1c2b COMF 0x2b,0x0,0x0 002768 e1f1 BNZ 0x274c 00276a 0e01 MOVLW 0x1 return 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00276c d001 BRA 0x2770 00276e 0e00 MOVLW 0x0 return 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002770 ef0f GOTO 0x321e } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002772 f019 00321e 52e5 MOVF 0xe5,0x1,0x0 003220 cfe5 MOVFF 0xfe5,0xfda 003222 ffda 003224 cfe7 MOVFF 0xfe7,0xfd9 003226 ffd9 003228 0012 RETURN 0x0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FMT_UNSPECIFIED 0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FMT_LONG 1 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FMT_SHLONG 2 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c #define _FMT_BYTE 3 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c int C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002774 ece0 CALL 0x31c0,0x0 vfprintf (auto FILE *handle, auto const rom char *f, auto va_list ap) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002776 f018 002778 0e3b MOVLW 0x3b 00277a 24e1 ADDWF 0xe1,0x0,0x0 00277c e302 BNC 0x2782 00277e 68e1 SETF 0xe1,0x0 002780 52e6 MOVF 0xe6,0x1,0x0 002782 6ee1 MOVWF 0xe1,0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c unsigned char c; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002784 0e01 MOVLW 0x1 int count = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002786 6adb CLRF 0xdb,0x0 002788 0e02 MOVLW 0x2 00278a 6adb CLRF 0xdb,0x0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00278c 0ef9 MOVLW 0xf9 for (c = *f; c; c = *++f) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00278e cfdb MOVFF 0xfdb,0xff6 002790 fff6 002792 0efa MOVLW 0xfa 002794 cfdb MOVFF 0xfdb,0xff7 002796 fff7 002798 0efb MOVLW 0xfb 00279a cfdb MOVFF 0xfdb,0xff8 00279c fff8 00279e 0008 TBLRD 0027a0 50f5 MOVF 0xf5,0x0,0x0 0027a2 6edf MOVWF 0xdf,0x0 0027a4 50df MOVF 0xdf,0x0,0x0 0027a6 e102 BNZ 0x27ac 0027a8 ef33 GOTO 0x3066 0027aa f018 003060 d979 RCALL 0x3354 003062 efcf GOTO 0x279e 003064 f013 003354 50d9 MOVF 0xd9,0x0,0x0 003356 0ff9 ADDLW 0xf9 003358 6ee9 MOVWF 0xe9,0x0 00335a 0eff MOVLW 0xff 00335c ef43 GOTO 0x3286 00335e f019 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ac 0e25 MOVLW 0x25 if (c == '%') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ae 5cdf SUBWF 0xdf,0x0,0x0 0027b0 e002 BZ 0x27b6 0027b2 ef26 GOTO 0x304c 0027b4 f018 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027b6 0e03 MOVLW 0x3 unsigned char flags = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027b8 6adb CLRF 0xdb,0x0 0027ba 0e04 MOVLW 0x4 unsigned char width = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027bc 6adb CLRF 0xdb,0x0 0027be 0e05 MOVLW 0x5 unsigned char precision = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027c0 6adb CLRF 0xdb,0x0 0027c2 0e06 MOVLW 0x6 unsigned char have_precision = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027c4 6adb CLRF 0xdb,0x0 0027c6 0e07 MOVLW 0x7 unsigned char size = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027c8 6adb CLRF 0xdb,0x0 unsigned char space_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c unsigned char cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c unsigned long larg; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c far rom char *romstring; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c char *ramstring; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c int n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* get the first character of the conversion specifier */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ca ec48 CALL 0x3090,0x0 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027cc f018 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /** The conversion specification has, after the '%' character: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 7.9.6.1 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c * Zero or more flags (in any order) that modify the meaning of the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversion specification. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c * An optional minimum field width. If the converted value has C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c fewer characters than the field width, it will be padded with C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c spaces (by default) on the left (or right, if the left C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c adjustment flag, described later, has been given) to the field C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c width. The field width takes the form of an asterisk * C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c (described later) or a decimal integer. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c * An optional precision that gives the minimum number of digits C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c to appear for the d, i, o, u, x, and X conversions, the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c maximum number of digits to appear after the decimal point C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c character for e, E, and f conversions, the maximum number C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c of significant digits for the g and G conversions, or the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c maximum number of characters to be written from a string in C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c s conversion. The precision takes the form of a period (.) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c followed by an asterisk * (described later) or by an optional C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c decimal integer; if only the period is specified, the precision C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c is taken as zero. If a precision appears with any other C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversion specifier, the behaviour is undefined. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c * An optional h specifying that a following d, i, o, u, x, or X C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversion specifier applies to a short int or unsigned short C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c int argument (the argument will have been promoted according C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c to the integer promotions, and its value shall be converted C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c to short int or unsigned short int before printing); an C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c optional h specifying that a following n conversion specifier C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c applies to a pointer to a short int argument; an optional l C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c (ell) specifying that a following d, i, o, u, x, or X C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversion specifier applies to a long int or unsigned long int C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c argument; or an optional L specifying that a following e, E, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c f, g, or G conversion specifier applies to a long double C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c argument. If an h, l, or L appears with any other conversion C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specifier, the behaviour is undefined. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c * A character that specifies the type of conversion to be applied. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /** check for a flag. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 7.9.6.1 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c The flag characters and their meanings are: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c - The result of the conversion will be left-justified within C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the field. (It will be right justified if this flag is not C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specified.) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c + The result of a signed conversion will always begin with a C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c plus or a minus sign. (It will begin with a sign only when C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c a negative value is converted if this flag is not specified.) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c space If the first character of a signed conversion is not a C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c sign, or if a signed conversion results in no characters, a C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c space will be prefixed to the result. If the space and + flags C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c both appear, the space flag will be ignored. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c # The result is to be converted to an "alternate form." For o C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversion, it increases the precision to force the first digit C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c of the result to be a zero. For x (or X) conversion, a nonzero C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c result will have 0x (or 0X) prefixed to it. For e, E, f, g, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c and G conversions, the result will always contain a decimal- C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c point character, even if no digits follow it. (Normally, a C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c decimal point character appears in the result of these C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversions only if a digit follows it.) For g and G C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c conversions, trailing zeros will not be removed from the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c result. For other conversions the behaviour is undefined. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0 For d, i, o, u, x, X, e, E, f, g, and G conversions, leading C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c zeros (following any indication of sign or base) are used to C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c pad to the field width; no space padding is performed. If C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the 0 and - flags both appear, the 0 flag will be ignored. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c For other conversions, the behaviour is undefined. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ce 0e2d MOVLW 0x2d while (c == '-' || c == '+' || c == ' ' || c == '#' C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027d0 5cdf SUBWF 0xdf,0x0,0x0 0027d2 e00c BZ 0x27ec 0027d4 0e2b MOVLW 0x2b 0027d6 5cdf SUBWF 0xdf,0x0,0x0 0027d8 e009 BZ 0x27ec 0027da 0e20 MOVLW 0x20 0027dc 5cdf SUBWF 0xdf,0x0,0x0 0027de e006 BZ 0x27ec 0027e0 0e23 MOVLW 0x23 00281e d7d5 BRA 0x27ca 0027e2 5cdf SUBWF 0xdf,0x0,0x0 || c == '0') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027e4 e003 BZ 0x27ec 0027e6 0e30 MOVLW 0x30 0027e8 5cdf SUBWF 0xdf,0x0,0x0 0027ea e11a BNZ 0x2820 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ec 50df MOVF 0xdf,0x0,0x0 switch (c) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0027ee 0a30 XORLW 0x30 0027f0 e014 BZ 0x281a 0027f2 0a13 XORLW 0x13 0027f4 e00f BZ 0x2814 0027f6 0a03 XORLW 0x3 0027f8 e00a BZ 0x280e 0027fa 0a0b XORLW 0xb 0027fc e005 BZ 0x2808 0027fe 0a06 XORLW 0x6 002800 e1e4 BNZ 0x27ca { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '-': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002802 0e03 MOVLW 0x3 flags |= _FLAG_MINUS; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002804 80db BSF 0xdb,0x0,0x0 002806 d7e1 BRA 0x27ca break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '+': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002808 0e03 MOVLW 0x3 flags |= _FLAG_PLUS; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00280a 82db BSF 0xdb,0x1,0x0 00280c d7de BRA 0x27ca break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case ' ': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00280e 0e03 MOVLW 0x3 flags |= _FLAG_SPACE; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002810 84db BSF 0xdb,0x2,0x0 002812 d7db BRA 0x27ca break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '#': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002814 0e03 MOVLW 0x3 flags |= _FLAG_OCTO; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002816 86db BSF 0xdb,0x3,0x0 002818 d7d8 BRA 0x27ca break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '0': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00281a 0e03 MOVLW 0x3 flags |= _FLAG_ZERO; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00281c 88db BSF 0xdb,0x4,0x0 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* the optional width field is next */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002820 0e2a MOVLW 0x2a if (c == '*') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002822 5cdf SUBWF 0xdf,0x0,0x0 002824 e11b BNZ 0x285c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002826 ec44 CALL 0x3088,0x0 n = va_arg (ap, int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002828 f018 00282a ec92 CALL 0x3124,0x0 00282c f018 003124 0e13 MOVLW 0x13 003126 cfee MOVFF 0xfee,0xfdb 003128 ffdb 00312a 0e14 MOVLW 0x14 00312c cfed MOVFF 0xfed,0xfdb 00312e ffdb 00282e e010 BZ 0x2850 if (n < 0) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003130 0e13 MOVLW 0x13 003132 cfdb MOVFF 0xfdb,0x2a 003134 f02a 003136 0e14 MOVLW 0x14 003138 cfdb MOVFF 0xfdb,0x2b 00313a f02b 00313c 0100 MOVLB 0x0 00313e 0e80 MOVLW 0x80 003140 142b ANDWF 0x2b,0x0,0x0 003142 0012 RETURN 0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002830 0e03 MOVLW 0x3 flags |= _FLAG_MINUS; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002832 80db BSF 0xdb,0x0,0x0 002834 681e SETF 0x1e,0x0 width = -n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002836 681f SETF 0x1f,0x0 002838 0e13 MOVLW 0x13 00283a cfdb MOVFF 0xfdb,0x23 00283c f023 00283e 0e14 MOVLW 0x14 002840 cfdb MOVFF 0xfdb,0x24 002842 f024 002844 ec7c CALL 0x40f8,0x0 002846 f020 002848 0e04 MOVLW 0x4 00284a c01c MOVFF 0x1c,0xfdb 00284c ffdb } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00284e d003 BRA 0x2856 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002850 0e13 MOVLW 0x13 width = n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002852 ec7b CALL 0x30f6,0x0 002854 f018 002856 ec48 CALL 0x3090,0x0 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002858 f018 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00285a d00b BRA 0x2872 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00285c 0e09 MOVLW 0x9 cval = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00285e 6adb CLRF 0xdb,0x0 002860 ece9 CALL 0x31d2,0x0 while ((unsigned char) isdigit (c)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002862 f018 002864 e003 BZ 0x286c 00286a d7fa BRA 0x2860 0031d2 cfdf MOVFF 0xfdf,0xfe6 0031d4 ffe6 0031d6 6ae6 CLRF 0xe6,0x0 0031d8 ec6c CALL 0x44d8,0x0 0031da f022 0031dc 52e5 MOVF 0xe5,0x1,0x0 0031de 52e5 MOVF 0xe5,0x1,0x0 0031e0 50f3 MOVF 0xf3,0x0,0x0 0031e2 0012 RETURN 0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002866 ec5d CALL 0x32ba,0x0 cval = cval * 10 + c - '0'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002868 f019 0032ba 0e09 MOVLW 0x9 0032bc 50db MOVF 0xdb,0x0,0x0 0032be 0d0a MULLW 0xa 0032c0 50f3 MOVF 0xf3,0x0,0x0 0032c2 24df ADDWF 0xdf,0x0,0x0 0032c4 0fd0 ADDLW 0xd0 0032c6 6ee7 MOVWF 0xe7,0x0 0032c8 0e09 MOVLW 0x9 0032ca cfe7 MOVFF 0xfe7,0xfdb 0032cc ffdb 0032ce ef48 GOTO 0x3090 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0032d0 f018 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00286c 0e09 MOVLW 0x9 width = cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00286e ec7b CALL 0x30f6,0x0 002870 f018 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if '-' is specified, '0' is ignored */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002872 0e03 MOVLW 0x3 if (flags & _FLAG_MINUS) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002874 b0db BTFSC 0xdb,0x0,0x0 002876 98db BCF 0xdb,0x4,0x0 flags &= ~_FLAG_ZERO; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* the optional precision field is next */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002878 0e2e MOVLW 0x2e if (c == '.') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00287a 5cdf SUBWF 0xdf,0x0,0x0 00287c e11b BNZ 0x28b4 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00287e ec48 CALL 0x3090,0x0 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002880 f018 002882 0e2a MOVLW 0x2a if (c == '*') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002884 5cdf SUBWF 0xdf,0x0,0x0 002886 e10b BNZ 0x289e { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002888 ec44 CALL 0x3088,0x0 n = va_arg (ap, int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00288a f018 00288c ec92 CALL 0x3124,0x0 00288e f018 003088 d929 RCALL 0x32dc 00308a 0e02 MOVLW 0x2 00308c ef35 GOTO 0x326a 00308e f019 00326a 5e2a SUBWF 0x2a,0x1,0x0 00326c 0e00 MOVLW 0x0 00326e 5a2b SUBWFB 0x2b,0x1,0x0 003270 0ef7 MOVLW 0xf7 003272 c02a MOVFF 0x2a,0xfdb 003274 ffdb 003276 0ef8 MOVLW 0xf8 003278 c02b MOVFF 0x2b,0xfdb 00327a ffdb 00327c c02a MOVFF 0x2a,0xfe9 00327e ffe9 003280 c02b MOVFF 0x2b,0xfea 003282 ffea 003284 0012 RETURN 0x0 0032dc 0ef7 MOVLW 0xf7 0032de cfdb MOVFF 0xfdb,0x2a 0032e0 f02a 0032e2 0ef8 MOVLW 0xf8 0032e4 cfdb MOVFF 0xfdb,0x2b 0032e6 f02b 0032e8 0012 RETURN 0x0 002890 e103 BNZ 0x2898 if (n >= 0) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002892 0e13 MOVLW 0x13 precision = n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002894 eccd CALL 0x319a,0x0 002896 f018 00319a 50db MOVF 0xdb,0x0,0x0 00319c d8ce RCALL 0x333a 00333a 6ee7 MOVWF 0xe7,0x0 00333c 0e05 MOVLW 0x5 00333e cfe7 MOVFF 0xfe7,0xfdb 003340 ffdb 003342 0012 RETURN 0x0 00319e 0e01 MOVLW 0x1 have_precision = 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0031a0 6ef3 MOVWF 0xf3,0x0 0031a2 0e06 MOVLW 0x6 0031a4 cff3 MOVFF 0xff3,0xfdb 0031a6 ffdb 0031a8 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002898 ec48 CALL 0x3090,0x0 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00289a f018 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00289c d00b BRA 0x28b4 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00289e 0e09 MOVLW 0x9 cval = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028a0 6adb CLRF 0xdb,0x0 0028a2 ece9 CALL 0x31d2,0x0 while ((unsigned char) isdigit (c)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028a4 f018 0028a6 e003 BZ 0x28ae 0028ac d7fa BRA 0x28a2 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028a8 ec5d CALL 0x32ba,0x0 cval = cval * 10 + c - '0'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028aa f019 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028ae 0e09 MOVLW 0x9 precision = cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028b0 eccd CALL 0x319a,0x0 0028b2 f018 have_precision = 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* the optional 'h' specifier. since int and short int are C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the same size for MPLAB C18, this is a NOP for us. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028b4 0e68 MOVLW 0x68 if (c == 'h') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028b6 5cdf SUBWF 0xdf,0x0,0x0 0028b8 e107 BNZ 0x28c8 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028ba ec48 CALL 0x3090,0x0 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028bc f018 /* if 'c' is another 'h' character, this is an 'hh' C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specifier and the size is 8 bits */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028be 0e68 MOVLW 0x68 if (c == 'h') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028c0 5cdf SUBWF 0xdf,0x0,0x0 0028c2 e11d BNZ 0x28fe { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028c4 0e03 MOVLW 0x3 size = _FMT_BYTE; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* 'z' and 't' are both 16-bit and so are NOPs */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028c6 d018 BRA 0x28f8 else if (c == 't' || c == 'z') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028c8 0e74 MOVLW 0x74 0028ca 5cdf SUBWF 0xdf,0x0,0x0 0028cc e017 BZ 0x28fc 0028ce 0e7a MOVLW 0x7a 0028d0 5cdf SUBWF 0xdf,0x0,0x0 0028d2 e014 BZ 0x28fc c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* the 'H' specifier tells us to deal with 24-bit integers. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the 'T' and 'Z' specifiers are also 24 bit */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028d4 0e48 MOVLW 0x48 else if (c == 'H' || c == 'T' || c == 'Z') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028d6 5cdf SUBWF 0xdf,0x0,0x0 0028d8 e006 BZ 0x28e6 0028da 0e54 MOVLW 0x54 0028dc 5cdf SUBWF 0xdf,0x0,0x0 0028de e003 BZ 0x28e6 0028e0 0e5a MOVLW 0x5a 0028e2 5cdf SUBWF 0xdf,0x0,0x0 0028e4 e102 BNZ 0x28ea { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028e6 0e02 MOVLW 0x2 size = _FMT_SHLONG; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* the 'l' specifier tells us to deal with 32-bit integers C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 'j' specifies intmax_t (long in our case). */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028e8 d007 BRA 0x28f8 else if (c == 'l' || c == 'j') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028ea 0e6c MOVLW 0x6c 0028ec 5cdf SUBWF 0xdf,0x0,0x0 0028ee e003 BZ 0x28f6 0028f0 0e6a MOVLW 0x6a 0028f2 5cdf SUBWF 0xdf,0x0,0x0 0028f4 e104 BNZ 0x28fe { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028f6 0e01 MOVLW 0x1 size = _FMT_LONG; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028f8 ec20 CALL 0x3240,0x0 0028fa f019 0028fc dbc9 RCALL 0x3090 c = *++f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003090 d961 RCALL 0x3354 003092 0008 TBLRD 003094 50f5 MOVF 0xf5,0x0,0x0 003096 6edf MOVWF 0xdf,0x0 003098 0012 RETURN 0x0 003286 20da ADDWFC 0xda,0x0,0x0 003288 6eea MOVWF 0xea,0x0 00328a 2aef INCF 0xef,0x1,0x0 00328c cfee MOVFF 0xfee,0xff6 00328e fff6 003290 0e00 MOVLW 0x0 003292 22ef ADDWFC 0xef,0x1,0x0 003294 cfee MOVFF 0xfee,0xff7 003296 fff7 003298 22ef ADDWFC 0xef,0x1,0x0 00329a cfee MOVFF 0xfee,0xff8 00329c fff8 00329e 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0028fe 50df MOVF 0xdf,0x0,0x0 switch (c) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002900 0a6e XORLW 0x6e 002902 e101 BNZ 0x2906 002904 d37f BRA 0x3004 002906 0a1e XORLW 0x1e 002908 e101 BNZ 0x290c 00290a d192 BRA 0x2c30 00290c 0a20 XORLW 0x20 00290e e101 BNZ 0x2912 002910 d18f BRA 0x2c30 002912 0a3f XORLW 0x3f 002914 e101 BNZ 0x2918 002916 d149 BRA 0x2baa 002918 0a1a XORLW 0x1a 00291a e101 BNZ 0x291e 00291c d146 BRA 0x2baa 00291e 0a0d XORLW 0xd 002920 e101 BNZ 0x2924 002922 d143 BRA 0x2baa 002924 0a20 XORLW 0x20 002926 e101 BNZ 0x292a 002928 d140 BRA 0x2baa 00292a 0a3a XORLW 0x3a 00292c e101 BNZ 0x2930 00292e d13d BRA 0x2baa 002930 0a20 XORLW 0x20 002932 e101 BNZ 0x2936 002934 d13a BRA 0x2baa 002936 0a26 XORLW 0x26 002938 e101 BNZ 0x293c 00293a d135 BRA 0x2ba6 00293c 0a0d XORLW 0xd 00293e e101 BNZ 0x2942 002940 d132 BRA 0x2ba6 002942 0a1a XORLW 0x1a 002944 e101 BNZ 0x2948 002946 d0d9 BRA 0x2afa 002948 0a20 XORLW 0x20 00294a e04a BZ 0x29e0 00294c 0a30 XORLW 0x30 00294e e01f BZ 0x298e 002950 0a46 XORLW 0x46 002952 e00e BZ 0x2970 002954 0a25 XORLW 0x25 002956 e001 BZ 0x295a 002958 d383 BRA 0x3060 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '\0': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* this is undefined behaviour. we have a trailing '%' character C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c in the string, perhaps with some flags, width, precision C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c stuff as well, but no format specifier. We'll, arbitrarily, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c back up a character so that the loop will terminate C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c properly when it loops back and we'll output a '%' C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c character. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00295a 50d9 MOVF 0xd9,0x0,0x0 --f; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00295c 0ff9 ADDLW 0xf9 00295e 6ee9 MOVWF 0xe9,0x0 002960 0eff MOVLW 0xff 002962 20da ADDWFC 0xda,0x0,0x0 002964 6eea MOVWF 0xea,0x0 002966 0e01 MOVLW 0x1 002968 5eee SUBWF 0xee,0x1,0x0 00296a 0e00 MOVLW 0x0 00296c 5aee SUBWFB 0xee,0x1,0x0 00296e 5aee SUBWFB 0xee,0x1,0x0 /* fallthrough */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case '%': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002970 ec2e CALL 0x325c,0x0 if (putc ('%', handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002972 f019 002974 0e25 MOVLW 0x25 002976 6ee6 MOVWF 0xe6,0x0 002978 db95 RCALL 0x30a4 00297a e103 BNZ 0x2982 00297c 1c2b COMF 0x2b,0x0,0x0 00297e e101 BNZ 0x2982 002980 d369 BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002982 ec2a CALL 0x3254,0x0 ++count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002984 f019 002986 e201 BC 0x298a 002988 d36b BRA 0x3060 00298a 2adb INCF 0xdb,0x1,0x0 00298c d369 BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'c': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00298e 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002990 6adb CLRF 0xdb,0x0 002992 0e04 MOVLW 0x4 if (width > 1) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002994 50db MOVF 0xdb,0x0,0x0 002996 0801 SUBLW 0x1 002998 e206 BC 0x29a6 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00299a 0e04 MOVLW 0x4 space_cnt = width - 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00299c 04db DECF 0xdb,0x0,0x0 00299e ecf2 CALL 0x31e4,0x0 0029a0 f018 0029a2 50db MOVF 0xdb,0x0,0x0 count += space_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029a4 db8b RCALL 0x30bc } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029a6 0e08 MOVLW 0x8 if (space_cnt && !(flags & _FLAG_MINUS)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029a8 50db MOVF 0xdb,0x0,0x0 0029aa e009 BZ 0x29be 0029ac 0e03 MOVLW 0x3 0029ae 50db MOVF 0xdb,0x0,0x0 0029b0 0b01 ANDLW 0x1 0029b2 e105 BNZ 0x29be { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029b4 db72 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029b6 e001 BZ 0x29ba 0029b8 d34d BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029ba 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029bc 6adb CLRF 0xdb,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029be db64 RCALL 0x3088 c = va_arg (ap, int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029c0 cfef MOVFF 0xfef,0xfdf 0029c2 ffdf 0029c4 eca2 CALL 0x3344,0x0 if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029c6 f019 0029c8 e103 BNZ 0x29d0 0029ca 1c2b COMF 0x2b,0x0,0x0 0029cc e101 BNZ 0x29d0 0029ce d342 BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029d0 ec2a CALL 0x3254,0x0 ++count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029d2 f019 0029d4 e301 BNC 0x29d8 0029d6 2adb INCF 0xdb,0x1,0x0 0029d8 db60 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029da e101 BNZ 0x29de 0029dc d341 BRA 0x3060 0029de d33a BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'S': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029e0 0e07 MOVLW 0x7 if (size == _FMT_SHLONG) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029e2 50db MOVF 0xdb,0x0,0x0 0029e4 0802 SUBLW 0x2 0029e6 e10f BNZ 0x2a06 0029e8 ec6e CALL 0x32dc,0x0 romstring = va_arg (ap, rom far char *); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0029ea f019 0029ec 0e03 MOVLW 0x3 0029ee ec35 CALL 0x326a,0x0 0029f0 f019 0029f2 0e0e MOVLW 0xe 0029f4 cfee MOVFF 0xfee,0xfdb 0029f6 ffdb 0029f8 0e0f MOVLW 0xf 0029fa cfee MOVFF 0xfee,0xfdb 0029fc ffdb 0029fe 0e10 MOVLW 0x10 002a00 cfee MOVFF 0xfee,0xfdb 002a02 ffdb 002a04 d020 BRA 0x2a46 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a06 0ef7 MOVLW 0xf7 romstring = (far rom char*)va_arg (ap, rom near char *); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a08 cfdb MOVFF 0xfdb,0x2d 002a0a f02d 002a0c 0ef8 MOVLW 0xf8 002a0e cfdb MOVFF 0xfdb,0x2e 002a10 f02e 002a12 0e02 MOVLW 0x2 002a14 5e2d SUBWF 0x2d,0x1,0x0 002a16 0e00 MOVLW 0x0 002a18 5a2e SUBWFB 0x2e,0x1,0x0 002a1a 0ef7 MOVLW 0xf7 002a1c c02d MOVFF 0x2d,0xfdb 002a1e ffdb 002a20 0ef8 MOVLW 0xf8 002a22 c02e MOVFF 0x2e,0xfdb 002a24 ffdb 002a26 c02d MOVFF 0x2d,0xfe9 002a28 ffe9 002a2a c02e MOVFF 0x2e,0xfea 002a2c ffea 002a2e ec25 CALL 0x324a,0x0 002a30 f019 002a32 6a2c CLRF 0x2c,0x0 002a34 0e0e MOVLW 0xe 002a36 c02a MOVFF 0x2a,0xfdb 002a38 ffdb 002a3a 0e0f MOVLW 0xf 002a3c c02b MOVFF 0x2b,0xfdb 002a3e ffdb 002a40 0e10 MOVLW 0x10 002a42 c02c MOVFF 0x2c,0xfdb 002a44 ffdb 002a46 0e0e MOVLW 0xe n = strlenpgm (romstring); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a48 cfdb MOVFF 0xfdb,0xfe6 002a4a ffe6 002a4c 0e0f MOVLW 0xf 002a4e cfdb MOVFF 0xfdb,0xfe6 002a50 ffe6 002a52 0e10 MOVLW 0x10 002a54 cfdb MOVFF 0xfdb,0xfe6 002a56 ffe6 002a58 ec33 CALL 0x4466,0x0 002a5a f022 002a5c 52e5 MOVF 0xe5,0x1,0x0 002a5e 52e5 MOVF 0xe5,0x1,0x0 002a60 52e5 MOVF 0xe5,0x1,0x0 002a62 0e13 MOVLW 0x13 002a64 c01d MOVFF 0x1d,0xfdb 002a66 ffdb 002a68 0e14 MOVLW 0x14 002a6a c01e MOVFF 0x1e,0xfdb 002a6c ffdb /* Normalize the width based on the length of the actual C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c string and the precision. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a6e 0e06 MOVLW 0x6 if (have_precision && precision < (unsigned char) n) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a70 50db MOVF 0xdb,0x0,0x0 002a72 e005 BZ 0x2a7e 002a74 0e13 MOVLW 0x13 002a76 ec69 CALL 0x32d2,0x0 002a78 f019 002a7a e201 BC 0x2a7e 002a7c db6a RCALL 0x3152 n = precision; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003152 0e05 MOVLW 0x5 003154 50db MOVF 0xdb,0x0,0x0 003156 6ee6 MOVWF 0xe6,0x0 003158 50d9 MOVF 0xd9,0x0,0x0 00315a 0f13 ADDLW 0x13 00315c d901 RCALL 0x3360 00315e 52e5 MOVF 0xe5,0x1,0x0 003160 50e7 MOVF 0xe7,0x0,0x0 003162 6eee MOVWF 0xee,0x0 003164 6aed CLRF 0xed,0x0 003166 0012 RETURN 0x0 002a7e ec8d CALL 0x331a,0x0 if (width < (unsigned char) n) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a80 f019 002a82 e202 BC 0x2a88 00331a 0e13 MOVLW 0x13 00331c 50db MOVF 0xdb,0x0,0x0 00331e 6ef3 MOVWF 0xf3,0x0 003320 0e04 MOVLW 0x4 003322 ef76 GOTO 0x30ec 003324 f018 002a84 0e13 MOVLW 0x13 width = n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a86 db37 RCALL 0x30f6 002a88 ec50 CALL 0x32a0,0x0 space_cnt = width - (unsigned char) n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a8a f019 0032a0 0e04 MOVLW 0x4 0032a2 cfdb MOVFF 0xfdb,0xfe6 0032a4 ffe6 0032a6 0e13 MOVLW 0x13 0032a8 50db MOVF 0xdb,0x0,0x0 0032aa 52e5 MOVF 0xe5,0x1,0x0 0032ac 5ce7 SUBWF 0xe7,0x0,0x0 0032ae df9a RCALL 0x31e4 0032b0 50db MOVF 0xdb,0x0,0x0 count += space_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0032b2 df04 RCALL 0x30bc /* we've already calculated the space count that the width C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c will require. now we want the width field to have the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c number of character to display from the string itself, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c limited by the length of the actual string and the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specified precision. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a8c e006 BZ 0x2a9a if (have_precision && precision < width) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a8e 0e04 MOVLW 0x4 002a90 ec69 CALL 0x32d2,0x0 002a92 f019 002a94 e202 BC 0x2a9a 0032b4 0e06 MOVLW 0x6 0032b6 50db MOVF 0xdb,0x0,0x0 0032b8 0012 RETURN 0x0 002a96 0e05 MOVLW 0x5 width = precision; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a98 db2e RCALL 0x30f6 /* if right justified, we print the spaces before the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c string */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a9a 0e03 MOVLW 0x3 if (!(flags & _FLAG_MINUS)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002a9c b0db BTFSC 0xdb,0x0,0x0 002a9e d005 BRA 0x2aaa { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aa0 dafc RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aa2 e001 BZ 0x2aa6 002aa4 d2d7 BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aa6 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aa8 6adb CLRF 0xdb,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aaa 0e09 MOVLW 0x9 cval = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002aac 6adb CLRF 0xdb,0x0 002aae 0e0e MOVLW 0xe for (c = *romstring; c && cval < width; c = *++romstring) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ab0 cfdb MOVFF 0xfdb,0xff6 002ab2 fff6 002ab4 0e0f MOVLW 0xf 002ab6 cfdb MOVFF 0xfdb,0xff7 002ab8 fff7 002aba 0e10 MOVLW 0x10 002abc cfdb MOVFF 0xfdb,0xff8 002abe fff8 002ac0 0008 TBLRD 002ac2 50f5 MOVF 0xf5,0x0,0x0 002ac4 6edf MOVWF 0xdf,0x0 002ac6 50df MOVF 0xdf,0x0,0x0 002ac8 e014 BZ 0x2af2 002aca ec93 CALL 0x3326,0x0 002acc f019 002ace e211 BC 0x2af2 002ae6 50d9 MOVF 0xd9,0x0,0x0 002ae8 0f0e ADDLW 0xe 002aea 6ee9 MOVWF 0xe9,0x0 002aec 0e00 MOVLW 0x0 002aee dbcb RCALL 0x3286 002af0 d7e7 BRA 0x2ac0 003326 0e04 MOVLW 0x4 003328 50db MOVF 0xdb,0x0,0x0 00332a 6ef3 MOVWF 0xf3,0x0 00332c 0e09 MOVLW 0x9 00332e ef76 GOTO 0x30ec 003330 f018 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ad0 eca2 CALL 0x3344,0x0 if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ad2 f019 002ad4 e103 BNZ 0x2adc 002ad6 1c2b COMF 0x2b,0x0,0x0 002ad8 e101 BNZ 0x2adc 002ada d2bc BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002adc dbbb RCALL 0x3254 ++count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ade e301 BNC 0x2ae2 002ae0 2adb INCF 0xdb,0x1,0x0 002ae2 0e09 MOVLW 0x9 ++cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ae4 2adb INCF 0xdb,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* If there are spaces left, it's left justified. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c Either way, calling the function unconditionally C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c is smaller code. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002af2 dad3 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002af4 e101 BNZ 0x2af8 002af6 d2b4 BRA 0x3060 002af8 d2ad BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 's': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002afa dac6 RCALL 0x3088 ramstring = va_arg (ap, char *); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002afc 0e11 MOVLW 0x11 002afe cfee MOVFF 0xfee,0xfdb 002b00 ffdb 002b02 0e12 MOVLW 0x12 002b04 cfed MOVFF 0xfed,0xfdb 002b06 ffdb 002b08 0e11 MOVLW 0x11 n = strlen (ramstring); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b0a cfdb MOVFF 0xfdb,0xfe6 002b0c ffe6 002b0e 0e12 MOVLW 0x12 002b10 cfdb MOVFF 0xfdb,0xfe6 002b12 ffe6 002b14 ec25 CALL 0x444a,0x0 002b16 f022 002b18 52e5 MOVF 0xe5,0x1,0x0 002b1a 52e5 MOVF 0xe5,0x1,0x0 002b1c 0e13 MOVLW 0x13 002b1e cff3 MOVFF 0xff3,0xfdb 002b20 ffdb 002b22 0e14 MOVLW 0x14 002b24 cff4 MOVFF 0xff4,0xfdb 002b26 ffdb /* Normalize the width based on the length of the actual C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c string and the precision. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b28 0e06 MOVLW 0x6 if (have_precision && precision < (unsigned char) n) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b2a 50db MOVF 0xdb,0x0,0x0 002b2c e004 BZ 0x2b36 002b2e 0e13 MOVLW 0x13 002b30 dbd0 RCALL 0x32d2 002b32 e201 BC 0x2b36 002b34 db0e RCALL 0x3152 n = precision; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b36 ec8d CALL 0x331a,0x0 if (width < (unsigned char) n) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b38 f019 002b3a e202 BC 0x2b40 002b3c 0e13 MOVLW 0x13 width = n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b3e dadb RCALL 0x30f6 002b40 dbaf RCALL 0x32a0 space_cnt = width - (unsigned char) n; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 0031e4 6ee7 MOVWF 0xe7,0x0 0031e6 0e08 MOVLW 0x8 0031e8 cfe7 MOVFF 0xfe7,0xfdb 0031ea ffdb 0031ec 0012 RETURN 0x0 count += space_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* we've already calculated the space count that the width C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c will require. now we want the width field to have the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c number of character to display from the string itself, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c limited by the length of the actual string and the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specified precision. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b42 e005 BZ 0x2b4e if (have_precision && precision < width) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b44 0e04 MOVLW 0x4 002b46 dbc5 RCALL 0x32d2 002b48 e202 BC 0x2b4e 0032d2 50db MOVF 0xdb,0x0,0x0 0032d4 6ef3 MOVWF 0xf3,0x0 0032d6 0e05 MOVLW 0x5 0032d8 ef76 GOTO 0x30ec 0032da f018 002b4a 0e05 MOVLW 0x5 width = precision; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b4c dad4 RCALL 0x30f6 0030f6 50db MOVF 0xdb,0x0,0x0 0030f8 6ee7 MOVWF 0xe7,0x0 0030fa 0e04 MOVLW 0x4 0030fc cfe7 MOVFF 0xfe7,0xfdb 0030fe ffdb 003100 0012 RETURN 0x0 /* if right justified, we print the spaces before the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c string */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b4e 0e03 MOVLW 0x3 if (!(flags & _FLAG_MINUS)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b50 b0db BTFSC 0xdb,0x0,0x0 002b52 d005 BRA 0x2b5e { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b54 daa2 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b56 e001 BZ 0x2b5a 002b58 d27d BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b5a 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b5c 6adb CLRF 0xdb,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b5e 0e09 MOVLW 0x9 cval = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b60 6adb CLRF 0xdb,0x0 002b62 0e11 MOVLW 0x11 for (c = *ramstring; c && cval < width; c = *++ramstring) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b64 cfdb MOVFF 0xfdb,0xfe9 002b66 ffe9 002b68 0e12 MOVLW 0x12 002b6a cfdb MOVFF 0xfdb,0xfea 002b6c ffea 002b6e cfef MOVFF 0xfef,0xfdf 002b70 ffdf 002b72 50df MOVF 0xdf,0x0,0x0 002b74 e014 BZ 0x2b9e 002b76 dbd7 RCALL 0x3326 002b78 e212 BC 0x2b9e 002b8e 0e11 MOVLW 0x11 002b90 2adb INCF 0xdb,0x1,0x0 002b92 cfdb MOVFF 0xfdb,0xfe9 002b94 ffe9 002b96 0e12 MOVLW 0x12 002b98 e3e8 BNC 0x2b6a 002b9a 2adb INCF 0xdb,0x1,0x0 002b9c d7e6 BRA 0x2b6a { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b7a dbe4 RCALL 0x3344 if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b7c e103 BNZ 0x2b84 002b7e 1c2b COMF 0x2b,0x0,0x0 002b80 e101 BNZ 0x2b84 002b82 d268 BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b84 db67 RCALL 0x3254 ++count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b86 e301 BNC 0x2b8a 002b88 2adb INCF 0xdb,0x1,0x0 002b8a 0e09 MOVLW 0x9 ++cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b8c 2adb INCF 0xdb,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* If there are spaces left, it's left justified. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c Either way, calling the function unconditionally C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c is smaller code. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002b9e da7d RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ba0 e101 BNZ 0x2ba4 002ba2 d25e BRA 0x3060 002ba4 d257 BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'd': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'i': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ba6 0e03 MOVLW 0x3 flags |= _FLAG_SIGNED; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ba8 8edb BSF 0xdb,0x7,0x0 /* fall through */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'o': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'u': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'x': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'X': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'b': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'B': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* This is a bit of a sneaky trick. The 'l' and 'hh' size C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c specifiers are valid only for the integer conversions, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c not the 'p' or 'P' conversions, and are ignored for the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c latter. By jumping over the additional size specifier C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c checks here we get the best code size since we can C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c limit the size checks in the remaining code. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002baa 0e07 MOVLW 0x7 if (size == _FMT_LONG) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bac 04db DECF 0xdb,0x0,0x0 002bae e110 BNZ 0x2bd0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bb0 db95 RCALL 0x32dc larg = va_arg (ap, long int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bb2 0e04 MOVLW 0x4 002bb4 db5a RCALL 0x326a 002bb6 0e0a MOVLW 0xa 002bb8 cfee MOVFF 0xfee,0xfdb 002bba ffdb 002bbc 0e0b MOVLW 0xb 002bbe cfee MOVFF 0xfee,0xfdb 002bc0 ffdb 002bc2 0e0c MOVLW 0xc 002bc4 cfee MOVFF 0xfee,0xfdb 002bc6 ffdb 002bc8 0e0d MOVLW 0xd 002bca cfee MOVFF 0xfee,0xfdb 002bcc ffdb 002bce d06c BRA 0x2ca8 goto _do_integer_conversion; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bd0 0e07 MOVLW 0x7 else if (size == _FMT_BYTE) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bd2 50db MOVF 0xdb,0x0,0x0 002bd4 0803 SUBLW 0x3 002bd6 e12c BNZ 0x2c30 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bd8 0e03 MOVLW 0x3 if (flags & _FLAG_SIGNED) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bda aedb BTFSS 0xdb,0x7,0x0 002bdc d00d BRA 0x2bf8 002bde dab2 RCALL 0x3144 larg = (signed char) va_arg (ap, int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002be0 0e02 MOVLW 0x2 002be2 da76 RCALL 0x30d0 002be4 cfef MOVFF 0xfef,0x2a 002be6 f02a 002be8 6a2b CLRF 0x2b,0x0 002bea 6a2c CLRF 0x2c,0x0 002bec 6a2d CLRF 0x2d,0x0 002bee ae2a BTFSS 0x2a,0x7,0x0 002bf0 d039 BRA 0x2c64 002bf2 682b SETF 0x2b,0x0 002bf4 682c SETF 0x2c,0x0 002bf6 d035 BRA 0x2c62 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bf8 0ef7 MOVLW 0xf7 larg = (unsigned char) va_arg (ap, unsigned int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002bfa cfdb MOVFF 0xfdb,0x2b 002bfc f02b 002bfe 0ef8 MOVLW 0xf8 002c00 cfdb MOVFF 0xfdb,0x2c 002c02 f02c 002c04 0e02 MOVLW 0x2 002c06 5e2b SUBWF 0x2b,0x1,0x0 002c08 0e00 MOVLW 0x0 002c0a 5a2c SUBWFB 0x2c,0x1,0x0 002c0c 0ef7 MOVLW 0xf7 002c0e c02b MOVFF 0x2b,0xfdb 002c10 ffdb 002c12 0ef8 MOVLW 0xf8 002c14 c02c MOVFF 0x2c,0xfdb 002c16 ffdb 002c18 c02b MOVFF 0x2b,0xfe9 002c1a ffe9 002c1c c02c MOVFF 0x2c,0xfea 002c1e ffea 002c20 cfef MOVFF 0xfef,0x2a 002c22 f02a 002c24 0e0a MOVLW 0xa 002c26 c02a MOVFF 0x2a,0xfdb 002c28 ffdb 002c2a 0e0b MOVLW 0xb 002c2c 6adb CLRF 0xdb,0x0 002c2e d038 BRA 0x2ca0 goto _do_integer_conversion; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* fall through */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'p': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'P': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c30 0e07 MOVLW 0x7 if (size == _FMT_SHLONG) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c32 50db MOVF 0xdb,0x0,0x0 002c34 0802 SUBLW 0x2 002c36 e109 BNZ 0x2c4a { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c38 0e03 MOVLW 0x3 if (flags & _FLAG_SIGNED) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c3a aedb BTFSS 0xdb,0x7,0x0 002c3c d004 BRA 0x2c46 002c3e db59 RCALL 0x32f2 larg = va_arg (ap, short long int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c40 ae2c BTFSS 0x2c,0x7,0x0 002c42 d010 BRA 0x2c64 0031ee cfee MOVFF 0xfee,0x2a 0031f0 f02a 0031f2 cfee MOVFF 0xfee,0x2b 0031f4 f02b 0031f6 cfef MOVFF 0xfef,0x2c 0031f8 f02c 0031fa 6a2d CLRF 0x2d,0x0 0031fc 0012 RETURN 0x0 0032f2 df28 RCALL 0x3144 0032f4 0e03 MOVLW 0x3 0032f6 deec RCALL 0x30d0 0032f8 eff7 GOTO 0x31ee 0032fa f018 002c44 d00e BRA 0x2c62 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c46 db55 RCALL 0x32f2 larg = va_arg (ap, unsigned short long int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c48 d00d BRA 0x2c64 else if (flags & _FLAG_SIGNED) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c4a 0e03 MOVLW 0x3 002c4c aedb BTFSS 0xdb,0x7,0x0 002c4e d012 BRA 0x2c74 002c50 da79 RCALL 0x3144 larg = va_arg (ap, int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c52 0e02 MOVLW 0x2 002c54 da3d RCALL 0x30d0 002c56 daf9 RCALL 0x324a 002c58 6a2c CLRF 0x2c,0x0 002c5a 6a2d CLRF 0x2d,0x0 002c5c ae2b BTFSS 0x2b,0x7,0x0 002c5e d002 BRA 0x2c64 002c60 682c SETF 0x2c,0x0 002c62 682d SETF 0x2d,0x0 002c64 dae2 RCALL 0x322a 002c66 0e0c MOVLW 0xc 002c68 c02c MOVFF 0x2c,0xfdb 002c6a ffdb 002c6c 0e0d MOVLW 0xd 002c6e c02d MOVFF 0x2d,0xfdb 002c70 ffdb 0030d0 5e2e SUBWF 0x2e,0x1,0x0 0030d2 0e00 MOVLW 0x0 0030d4 5a2f SUBWFB 0x2f,0x1,0x0 0030d6 0ef7 MOVLW 0xf7 0030d8 c02e MOVFF 0x2e,0xfdb 0030da ffdb 0030dc 0ef8 MOVLW 0xf8 0030de c02f MOVFF 0x2f,0xfdb 0030e0 ffdb 0030e2 c02e MOVFF 0x2e,0xfe9 0030e4 ffe9 0030e6 c02f MOVFF 0x2f,0xfea 0030e8 ffea 0030ea 0012 RETURN 0x0 003144 0ef7 MOVLW 0xf7 003146 cfdb MOVFF 0xfdb,0x2e 003148 f02e 00314a 0ef8 MOVLW 0xf8 00314c cfdb MOVFF 0xfdb,0x2f 00314e f02f 003150 0012 RETURN 0x0 00322a 0e0a MOVLW 0xa 00322c c02a MOVFF 0x2a,0xfdb 00322e ffdb 003230 0e0b MOVLW 0xb 003232 c02b MOVFF 0x2b,0xfdb 003234 ffdb 003236 0012 RETURN 0x0 00324a cfee MOVFF 0xfee,0x2a 00324c f02a 00324e cfef MOVFF 0xfef,0x2b 003250 f02b 003252 0012 RETURN 0x0 002c72 d01a BRA 0x2ca8 else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c74 0ef7 MOVLW 0xf7 larg = va_arg (ap, unsigned int); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002c76 cfdb MOVFF 0xfdb,0x2c 002c78 f02c 002c7a 0ef8 MOVLW 0xf8 002c7c cfdb MOVFF 0xfdb,0x2d 002c7e f02d 002c80 0e02 MOVLW 0x2 002c82 5e2c SUBWF 0x2c,0x1,0x0 002c84 0e00 MOVLW 0x0 002c86 5a2d SUBWFB 0x2d,0x1,0x0 002c88 0ef7 MOVLW 0xf7 002c8a c02c MOVFF 0x2c,0xfdb 002c8c ffdb 002c8e 0ef8 MOVLW 0xf8 002c90 c02d MOVFF 0x2d,0xfdb 002c92 ffdb 002c94 c02c MOVFF 0x2c,0xfe9 002c96 ffe9 002c98 c02d MOVFF 0x2d,0xfea 002c9a ffea 002c9c dad6 RCALL 0x324a 002c9e dac5 RCALL 0x322a 002ca0 0e0c MOVLW 0xc 002ca2 6adb CLRF 0xdb,0x0 002ca4 0e0d MOVLW 0xd 002ca6 6adb CLRF 0xdb,0x0 _do_integer_conversion: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* default precision is 1 */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ca8 0e06 MOVLW 0x6 if (!have_precision) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002caa 50db MOVF 0xdb,0x0,0x0 002cac e105 BNZ 0x2cb8 002cae 0e01 MOVLW 0x1 precision = 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cb0 6ef3 MOVWF 0xf3,0x0 002cb2 0e05 MOVLW 0x5 002cb4 cff3 MOVFF 0xff3,0xfdb 002cb6 ffdb C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cb8 0e15 MOVLW 0x15 unsigned char digit_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cba 6adb CLRF 0xdb,0x0 002cbc 0e16 MOVLW 0x16 unsigned char prefix_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cbe 6adb CLRF 0xdb,0x0 unsigned char sign_char; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* A 32 bit number will require at most 32 digits in the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c string representation (binary format). */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c char buf[33]; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* Start storing digits least-significant first */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cc0 50d9 MOVF 0xd9,0x0,0x0 char *q = &buf[31]; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cc2 0f37 ADDLW 0x37 002cc4 6e2a MOVWF 0x2a,0x0 002cc6 0e00 MOVLW 0x0 002cc8 20da ADDWFC 0xda,0x0,0x0 002cca 6e2b MOVWF 0x2b,0x0 002ccc 0e39 MOVLW 0x39 002cce c02a MOVFF 0x2a,0xfdb 002cd0 ffdb 002cd2 0e3a MOVLW 0x3a 002cd4 c02b MOVFF 0x2b,0xfdb 002cd6 ffdb /* null terminate the string */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cd8 0e38 MOVLW 0x38 buf[32] = '\0'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cda 6adb CLRF 0xdb,0x0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cdc 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002cde 6adb CLRF 0xdb,0x0 002ce0 0e0a MOVLW 0xa size = 10; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ce2 daae RCALL 0x3240 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ce4 50df MOVF 0xdf,0x0,0x0 switch (c) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ce6 0a78 XORLW 0x78 002ce8 e012 BZ 0x2d0e 002cea 0a20 XORLW 0x20 002cec e010 BZ 0x2d0e 002cee 0a28 XORLW 0x28 002cf0 e00c BZ 0x2d0a 002cf2 0a20 XORLW 0x20 002cf4 e00a BZ 0x2d0a 002cf6 0a3f XORLW 0x3f 002cf8 e006 BZ 0x2d06 002cfa 0a0d XORLW 0xd 002cfc e002 BZ 0x2d02 002cfe 0a20 XORLW 0x20 002d00 e108 BNZ 0x2d12 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'b': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'B': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d02 0e02 MOVLW 0x2 size = 2; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d04 d005 BRA 0x2d10 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'o': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d06 0e08 MOVLW 0x8 size = 8; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d08 d003 BRA 0x2d10 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'p': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'P': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* from here on out, treat 'p' conversions just C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c like 'x' conversions. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d0a 0e08 MOVLW 0x8 c += 'x' - 'p'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d0c 26df ADDWF 0xdf,0x1,0x0 /* fall through */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'x': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'X': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d0e 0e10 MOVLW 0x10 size = 16; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d10 da97 RCALL 0x3240 003240 6ef3 MOVWF 0xf3,0x0 003242 0e07 MOVLW 0x7 003244 cff3 MOVFF 0xff3,0xfdb 003246 ffdb 003248 0012 RETURN 0x0 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if it's an unsigned conversion, we should ignore the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c ' ' and '+' flags */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d12 0e03 MOVLW 0x3 if (!(flags & _FLAG_SIGNED)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d14 bedb BTFSC 0xdb,0x7,0x0 002d16 d002 BRA 0x2d1c 002d18 92db BCF 0xdb,0x1,0x0 flags &= ~(_FLAG_PLUS | _FLAG_SPACE); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d1a 94db BCF 0xdb,0x2,0x0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if it's a negative value, we need to negate the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c unsigned version before we convert to text. Using C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c unsigned for this allows us to (ab)use the 2's C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c complement system to avoid overflow and be able to C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c adequately handle LONG_MIN. C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c We'll figure out what sign character to print, if C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c any, here as well. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d1c 50db MOVF 0xdb,0x0,0x0 if (flags & _FLAG_SIGNED && ((long) larg < 0)) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d1e 0b80 ANDLW 0x80 002d20 e024 BZ 0x2d6a 002d22 da8a RCALL 0x3238 002d24 90d8 BCF 0xd8,0x0,0x0 002d26 0e03 MOVLW 0x3 002d28 50eb MOVF 0xeb,0x0,0x0 002d2a 0a00 XORLW 0x0 002d2c e608 BN 0x2d3e 002d2e 0e00 MOVLW 0x0 002d30 5cee SUBWF 0xee,0x0,0x0 002d32 0e00 MOVLW 0x0 002d34 58ee SUBWFB 0xee,0x0,0x0 002d36 0e00 MOVLW 0x0 002d38 58ee SUBWFB 0xee,0x0,0x0 002d3a 0e00 MOVLW 0x0 002d3c 58ee SUBWFB 0xee,0x0,0x0 002d3e e215 BC 0x2d6a 003238 50d9 MOVF 0xd9,0x0,0x0 00323a 0f0a ADDLW 0xa 00323c efb0 GOTO 0x3360 00323e f019 003360 6ee9 MOVWF 0xe9,0x0 003362 0e00 MOVLW 0x0 003364 20da ADDWFC 0xda,0x0,0x0 003366 6eea MOVWF 0xea,0x0 003368 0012 RETURN 0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d40 da13 RCALL 0x3168 larg = -(long) larg; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d42 6821 SETF 0x21,0x0 002d44 6822 SETF 0x22,0x0 002d46 6823 SETF 0x23,0x0 002d48 6824 SETF 0x24,0x0 002d4a eced CALL 0x43da,0x0 002d4c f021 002d4e 0e0a MOVLW 0xa 002d50 c018 MOVFF 0x18,0xfdb 002d52 ffdb 002d54 0e0b MOVLW 0xb 002d56 c019 MOVFF 0x19,0xfdb 002d58 ffdb 002d5a 0e0c MOVLW 0xc 002d5c c01a MOVFF 0x1a,0xfdb 002d5e ffdb 002d60 0e0d MOVLW 0xd 002d62 c01b MOVFF 0x1b,0xfdb 002d64 ffdb 003168 0e0a MOVLW 0xa 00316a cfdb MOVFF 0xfdb,0x1c 00316c f01c 00316e 0e0b MOVLW 0xb 003170 cfdb MOVFF 0xfdb,0x1d 003172 f01d 003174 0e0c MOVLW 0xc 003176 cfdb MOVFF 0xfdb,0x1e 003178 f01e 00317a 0e0d MOVLW 0xd 00317c cfdb MOVFF 0xfdb,0x1f 00317e f01f 003180 0012 RETURN 0x0 002d66 0e2d MOVLW 0x2d sign_char = '-'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c ++digit_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d68 d008 BRA 0x2d7a else if (flags & _FLAG_PLUS) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d6a 0e03 MOVLW 0x3 002d6c a2db BTFSS 0xdb,0x1,0x0 002d6e d002 BRA 0x2d74 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d70 0e2b MOVLW 0x2b sign_char = '+'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c ++digit_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d72 d003 BRA 0x2d7a else if (flags & _FLAG_SPACE) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d74 a4db BTFSS 0xdb,0x2,0x0 002d76 d008 BRA 0x2d88 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d78 0e20 MOVLW 0x20 sign_char = ' '; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d7a 6ef3 MOVWF 0xf3,0x0 002d7c 0e17 MOVLW 0x17 002d7e cff3 MOVFF 0xff3,0xfdb 002d80 ffdb 002d82 0e15 MOVLW 0x15 ++digit_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d84 2adb INCF 0xdb,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d86 d002 BRA 0x2d8c else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d88 0e17 MOVLW 0x17 sign_char = '\0'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d8a 6adb CLRF 0xdb,0x0 /* get the digits for the actual number. If the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c precision is zero and the value is zero, the result C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c is no characters. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d8c 0e05 MOVLW 0x5 if (precision || larg) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d8e 50db MOVF 0xdb,0x0,0x0 002d90 e103 BNZ 0x2d98 002d92 d9b7 RCALL 0x3102 002d94 e101 BNZ 0x2d98 002d96 d089 BRA 0x2eaa 003102 0e0a MOVLW 0xa 003104 cfdb MOVFF 0xfdb,0x2a 003106 f02a 003108 0e0b MOVLW 0xb 00310a cfdb MOVFF 0xfdb,0x2b 00310c f02b 00310e 0e0c MOVLW 0xc 003110 cfdb MOVFF 0xfdb,0x2c 003112 f02c 003114 0e0d MOVLW 0xd 003116 cfdb MOVFF 0xfdb,0x2d 003118 f02d 00311a 502a MOVF 0x2a,0x0,0x0 00311c 102b IORWF 0x2b,0x0,0x0 00311e 102c IORWF 0x2c,0x0,0x0 003120 102d IORWF 0x2d,0x0,0x0 003122 0012 RETURN 0x0 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c do C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d98 0ee8 MOVLW 0xe8 cval = s_digits[larg % size]; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002d9a 6e2a MOVWF 0x2a,0x0 002d9c 0e45 MOVLW 0x45 002d9e 6e2b MOVWF 0x2b,0x0 002da0 0e00 MOVLW 0x0 002da2 6e2c MOVWF 0x2c,0x0 002da4 0e07 MOVLW 0x7 002da6 cfdb MOVFF 0xfdb,0x2d 002da8 f02d 002daa 6a2e CLRF 0x2e,0x0 002dac 6a2f CLRF 0x2f,0x0 002dae 6a30 CLRF 0x30,0x0 002db0 c02d MOVFF 0x2d,0x21 002db2 f021 002db4 c02e MOVFF 0x2e,0x22 002db6 f022 002db8 c02f MOVFF 0x2f,0x23 002dba f023 002dbc c030 MOVFF 0x30,0x24 002dbe f024 002dc0 d9d3 RCALL 0x3168 002dc2 ec7e CALL 0x44fc,0x0 002dc4 f022 002dc6 502a MOVF 0x2a,0x0,0x0 002dc8 2418 ADDWF 0x18,0x0,0x0 002dca 6ef3 MOVWF 0xf3,0x0 002dcc 502b MOVF 0x2b,0x0,0x0 002dce 2019 ADDWFC 0x19,0x0,0x0 002dd0 6ef4 MOVWF 0xf4,0x0 002dd2 502c MOVF 0x2c,0x0,0x0 002dd4 201a ADDWFC 0x1a,0x0,0x0 002dd6 6ef8 MOVWF 0xf8,0x0 002dd8 cff4 MOVFF 0xff4,0xff7 002dda fff7 002ddc cff3 MOVFF 0xff3,0xff6 002dde fff6 002de0 0008 TBLRD 002de2 0e09 MOVLW 0x9 002de4 cff5 MOVFF 0xff5,0xfdb 002de6 ffdb 002de8 0e58 MOVLW 0x58 if (c == 'X' && cval >= 'a') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002dea 5cdf SUBWF 0xdf,0x0,0x0 002dec e10f BNZ 0x2e0c 002dee 0e61 MOVLW 0x61 002df0 6ef3 MOVWF 0xf3,0x0 002df2 0e09 MOVLW 0x9 002df4 d97b RCALL 0x30ec 002df6 e30a BNC 0x2e0c 0030ec cfdb MOVFF 0xfdb,0xff4 0030ee fff4 0030f0 50f3 MOVF 0xf3,0x0,0x0 0030f2 5cf4 SUBWF 0xf4,0x0,0x0 0030f4 0012 RETURN 0x0 002df8 0e20 MOVLW 0x20 cval -= 'a' - 'A'; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002dfa 6e2a MOVWF 0x2a,0x0 002dfc 0e09 MOVLW 0x9 002dfe cfdb MOVFF 0xfdb,0xfe7 002e00 ffe7 002e02 502a MOVF 0x2a,0x0,0x0 002e04 5ee7 SUBWF 0xe7,0x1,0x0 002e06 0e09 MOVLW 0x9 002e08 cfe7 MOVFF 0xfe7,0xfdb 002e0a ffdb 002e0c 0e07 MOVLW 0x7 larg /= size; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e0e cfdb MOVFF 0xfdb,0x2a 002e10 f02a 002e12 6a2b CLRF 0x2b,0x0 002e14 6a2c CLRF 0x2c,0x0 002e16 6a2d CLRF 0x2d,0x0 002e18 da0f RCALL 0x3238 002e1a c02a MOVFF 0x2a,0x21 002e1c f021 002e1e c02b MOVFF 0x2b,0x22 002e20 f022 002e22 c02c MOVFF 0x2c,0x23 002e24 f023 002e26 c02d MOVFF 0x2d,0x24 002e28 f024 002e2a cfee MOVFF 0xfee,0x1c 002e2c f01c 002e2e cfee MOVFF 0xfee,0x1d 002e30 f01d 002e32 cfee MOVFF 0xfee,0x1e 002e34 f01e 002e36 cfef MOVFF 0xfef,0x1f 002e38 f01f 002e3a ec7e CALL 0x44fc,0x0 002e3c f022 002e3e c01f MOVFF 0x1f,0xfed 002e40 ffed 002e42 c01e MOVFF 0x1e,0xfed 002e44 ffed 002e46 c01d MOVFF 0x1d,0xfed 002e48 ffed 002e4a c01c MOVFF 0x1c,0xfef 002e4c ffef 002e4e 0e39 MOVLW 0x39 *q-- = cval; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e50 cfdb MOVFF 0xfdb,0xfe9 002e52 ffe9 002e54 06db DECF 0xdb,0x1,0x0 002e56 0e3a MOVLW 0x3a 002e58 cfdb MOVFF 0xfdb,0xfea 002e5a ffea 002e5c e201 BC 0x2e60 002e5e 06db DECF 0xdb,0x1,0x0 002e60 0e09 MOVLW 0x9 002e62 cfdb MOVFF 0xfdb,0xfef 002e64 ffef 002e66 0e15 MOVLW 0x15 ++digit_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e68 2adb INCF 0xdb,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e6a d94b RCALL 0x3102 while (larg); C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e6c e195 BNZ 0x2d98 /* if the '#' flag was specified and we're dealing C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c with an 'o', 'b', 'B', 'x', or 'X' conversion, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c we need a bit more. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e6e 0e03 MOVLW 0x3 if (flags & _FLAG_OCTO) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e70 a6db BTFSS 0xdb,0x3,0x0 002e72 d01d BRA 0x2eae { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e74 0e6f MOVLW 0x6f if (c == 'o') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e76 5cdf SUBWF 0xdf,0x0,0x0 002e78 e106 BNZ 0x2e86 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* per the standard, for octal, the '#' flag C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c makes the precision be at least one more C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c than the number of digits in the number */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e7a d9c1 RCALL 0x31fe if (precision <= digit_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e7c e318 BNC 0x2eae 0031fe 0e05 MOVLW 0x5 003200 cfdb MOVFF 0xfdb,0x2a 003202 f02a 003204 0e15 MOVLW 0x15 003206 50db MOVF 0xdb,0x0,0x0 003208 80d8 BSF 0xd8,0x0,0x0 00320a 542a SUBFWB 0x2a,0x0,0x0 00320c 0012 RETURN 0x0 002e7e 0e15 MOVLW 0x15 precision = digit_cnt + 1; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e80 28db INCF 0xdb,0x0,0x0 002e82 da5b RCALL 0x333a } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e84 d014 BRA 0x2eae else if (c == 'x' C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e86 0e78 MOVLW 0x78 002e88 5cdf SUBWF 0xdf,0x0,0x0 || c == 'X' || c == 'b' || c == 'B') C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002e8a e009 BZ 0x2e9e 002e8c 0e58 MOVLW 0x58 002e8e 5cdf SUBWF 0xdf,0x0,0x0 002e90 e006 BZ 0x2e9e 002e92 0e62 MOVLW 0x62 002e94 5cdf SUBWF 0xdf,0x0,0x0 002e96 e003 BZ 0x2e9e 002e98 0e42 MOVLW 0x42 002e9a 5cdf SUBWF 0xdf,0x0,0x0 002e9c e108 BNZ 0x2eae 002e9e 0e02 MOVLW 0x2 prefix_cnt = 2; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ea0 6ef3 MOVWF 0xf3,0x0 002ea2 0e16 MOVLW 0x16 002ea4 cff3 MOVFF 0xff3,0xfdb 002ea6 ffdb } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ea8 d002 BRA 0x2eae else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eaa 0e15 MOVLW 0x15 digit_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eac 6adb CLRF 0xdb,0x0 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* The leading zero count depends on whether the '0' C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c flag was specified or not. If it was not, then the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c count is the difference between the specified C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c precision and the number of digits (including the C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c sign character, if any) to be printed; otherwise, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c it's as if the precision were equal to the max of C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the specified precision and the field width. If a C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c precision was specified, the '0' flag is ignored, C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c however. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eae 0e03 MOVLW 0x3 if ((flags & _FLAG_ZERO) && (width > precision) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eb0 50db MOVF 0xdb,0x0,0x0 002eb2 0b10 ANDLW 0x10 002eb6 0e04 MOVLW 0x4 002eb8 cfdb MOVFF 0xfdb,0x2a 002eba f02a 002ebc 0e05 MOVLW 0x5 002ebe 50db MOVF 0xdb,0x0,0x0 002ec0 80d8 BSF 0xd8,0x0,0x0 002ec2 542a SUBFWB 0x2a,0x0,0x0 002eb4 e00e BZ 0x2ed2 && !have_precision) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ec4 e206 BC 0x2ed2 002ec6 0e06 MOVLW 0x6 002ec8 50db MOVF 0xdb,0x0,0x0 002eca e103 BNZ 0x2ed2 002ecc 0e04 MOVLW 0x4 precision = width; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ece 50db MOVF 0xdb,0x0,0x0 002ed0 da34 RCALL 0x333a /* for the rest of the processing, precision contains C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the leading zero count for the conversion. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ed2 d995 RCALL 0x31fe if (precision > digit_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ed4 e20a BC 0x2eea 002ed6 0e05 MOVLW 0x5 precision -= digit_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ed8 cfdb MOVFF 0xfdb,0xfe7 002eda ffe7 002edc 0e15 MOVLW 0x15 002ede 50db MOVF 0xdb,0x0,0x0 002ee0 5ee7 SUBWF 0xe7,0x1,0x0 002ee2 0e05 MOVLW 0x5 002ee4 cfe7 MOVFF 0xfe7,0xfdb 002ee6 ffdb 002ee8 d002 BRA 0x2eee else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eea 0e05 MOVLW 0x5 precision = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eec 6adb CLRF 0xdb,0x0 /* the space count is the difference between the field C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c width and the digit count plus the leading zero C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c count. If the width is less than the digit count C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c plus the leading zero count, the space count is C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c zero. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002eee 0e04 MOVLW 0x4 if (width > precision + digit_cnt + prefix_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ef0 cfdb MOVFF 0xfdb,0x2a 002ef2 f02a 002ef4 0e16 MOVLW 0x16 002ef6 d945 RCALL 0x3182 002ef8 80d8 BSF 0xd8,0x0,0x0 002efa 542a SUBFWB 0x2a,0x0,0x0 002efc e214 BC 0x2f26 003182 cfdb MOVFF 0xfdb,0xfe6 003184 ffe6 003186 0e15 MOVLW 0x15 003188 cfdb MOVFF 0xfdb,0xfe6 00318a ffe6 00318c 0e05 MOVLW 0x5 00318e 50db MOVF 0xdb,0x0,0x0 003190 52e5 MOVF 0xe5,0x1,0x0 003192 24e7 ADDWF 0xe7,0x0,0x0 003194 52e5 MOVF 0xe5,0x1,0x0 003196 24e7 ADDWF 0xe7,0x0,0x0 003198 0012 RETURN 0x0 space_cnt = C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002efe 0e16 MOVLW 0x16 width - precision - digit_cnt - prefix_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f00 cfdb MOVFF 0xfdb,0xfe6 002f02 ffe6 002f04 0e15 MOVLW 0x15 002f06 cfdb MOVFF 0xfdb,0xfe6 002f08 ffe6 002f0a 0e04 MOVLW 0x4 002f0c cfdb MOVFF 0xfdb,0xfe6 002f0e ffe6 002f10 0e05 MOVLW 0x5 002f12 50db MOVF 0xdb,0x0,0x0 002f14 52e5 MOVF 0xe5,0x1,0x0 002f16 5ce7 SUBWF 0xe7,0x0,0x0 002f18 52e5 MOVF 0xe5,0x1,0x0 002f1a 80d8 BSF 0xd8,0x0,0x0 002f1c 54e7 SUBFWB 0xe7,0x0,0x0 002f1e 52e5 MOVF 0xe5,0x1,0x0 002f20 80d8 BSF 0xd8,0x0,0x0 002f22 54e7 SUBFWB 0xe7,0x0,0x0 002f24 d95f RCALL 0x31e4 C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* for output, we check the justification, if it's C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c right justified and the space count is positive, we C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c emit the space characters first. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f26 0e03 MOVLW 0x3 if (!(flags & _FLAG_MINUS) && space_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f28 50db MOVF 0xdb,0x0,0x0 002f2a 0b01 ANDLW 0x1 002f2c e10b BNZ 0x2f44 002f2e 0e08 MOVLW 0x8 002f30 50db MOVF 0xdb,0x0,0x0 002f32 e008 BZ 0x2f44 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f34 d8b2 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f36 e001 BZ 0x2f3a 002f38 d08d BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f3a 0e08 MOVLW 0x8 count += space_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f3c 50db MOVF 0xdb,0x0,0x0 002f3e d8be RCALL 0x30bc 002f40 0e08 MOVLW 0x8 space_cnt = 0; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f42 6adb CLRF 0xdb,0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if we have a sign character to print, that comes C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c next */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f44 0e17 MOVLW 0x17 if (sign_char) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f46 50db MOVF 0xdb,0x0,0x0 002f48 e007 BZ 0x2f58 002f4a d988 RCALL 0x325c if (putc (sign_char, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f4c 0e17 MOVLW 0x17 002f4e d9f1 RCALL 0x3332 002f50 e103 BNZ 0x2f58 002f52 1c2b COMF 0x2b,0x0,0x0 002f54 e101 BNZ 0x2f58 002f56 d07e BRA 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if we have a prefix (0b, 0B, 0x or 0X), that's next */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f58 0e16 MOVLW 0x16 if (prefix_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f5a 50db MOVF 0xdb,0x0,0x0 002f5c e016 BZ 0x2f8a { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f5e d97e RCALL 0x325c if (putc ('0', handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f60 0e30 MOVLW 0x30 002f62 6ee6 MOVWF 0xe6,0x0 002f64 d89f RCALL 0x30a4 002f66 e102 BNZ 0x2f6c 002f68 1c2b COMF 0x2b,0x0,0x0 002f6a e074 BZ 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f6c d977 RCALL 0x325c if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f6e cfdf MOVFF 0xfdf,0xfe6 002f70 ffe6 002f72 ecab CALL 0x4356,0x0 002f74 f021 002f76 52e5 MOVF 0xe5,0x1,0x0 002f78 52e5 MOVF 0xe5,0x1,0x0 002f7a 52e5 MOVF 0xe5,0x1,0x0 002f7c cff4 MOVFF 0xff4,0x2b 002f7e f02b 002f80 0100 MOVLB 0x0 002f82 1cf3 COMF 0xf3,0x0,0x0 002f84 e102 BNZ 0x2f8a 002f86 1c2b COMF 0x2b,0x0,0x0 002f88 e065 BZ 0x3054 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if we have leading zeros, they follow. the prefix, if any C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c is included in the number of digits when determining how C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c many leading zeroes are needed. */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f8a 0e05 MOVLW 0x5 if (precision > prefix_cnt) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f8c cfdb MOVFF 0xfdb,0x2a 002f8e f02a 002f90 0e16 MOVLW 0x16 002f92 50db MOVF 0xdb,0x0,0x0 002f94 80d8 BSF 0xd8,0x0,0x0 002f96 542a SUBFWB 0x2a,0x0,0x0 002f98 e209 BC 0x2fac 002f9a 0e05 MOVLW 0x5 precision -= prefix_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002f9c cfdb MOVFF 0xfdb,0xfe7 002f9e ffe7 002fa0 0e16 MOVLW 0x16 002fa2 50db MOVF 0xdb,0x0,0x0 002fa4 5ee7 SUBWF 0xe7,0x1,0x0 002fa6 0e05 MOVLW 0x5 002fa8 cfe7 MOVFF 0xfe7,0xfdb 002faa ffdb 002fac 0e30 MOVLW 0x30 if (s_put_n_chars (handle, precision, '0')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002fae 6ee6 MOVWF 0xe6,0x0 002fb0 0e05 MOVLW 0x5 002fb2 d9cb RCALL 0x334a 002fb4 e14f BNZ 0x3054 0032fc eca4 CALL 0x2748,0x0 0032fe f013 003300 52e5 MOVF 0xe5,0x1,0x0 003302 52e5 MOVF 0xe5,0x1,0x0 003304 52e5 MOVF 0xe5,0x1,0x0 003306 52e5 MOVF 0xe5,0x1,0x0 003308 0900 IORLW 0x0 00330a 0012 RETURN 0x0 00334a cfdb MOVFF 0xfdb,0xfe6 00334c ffe6 00334e df86 RCALL 0x325c 003350 ef7e GOTO 0x32fc 003352 f019 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* print the actual number */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002fb6 0e39 MOVLW 0x39 for (cval = *++q; cval; cval = *++q) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002fb8 2adb INCF 0xdb,0x1,0x0 002fba cfdb MOVFF 0xfdb,0xfe9 002fbc ffe9 002fbe 0e3a MOVLW 0x3a 002fc0 e301 BNC 0x2fc4 002fc2 2adb INCF 0xdb,0x1,0x0 002fc4 cfdb MOVFF 0xfdb,0xfea 002fc6 ffea 002fc8 0e09 MOVLW 0x9 002fca cfef MOVFF 0xfef,0xfdb 002fcc ffdb 002fce 50db MOVF 0xdb,0x0,0x0 002fd0 e00e BZ 0x2fee 002fde 0e39 MOVLW 0x39 002fe0 2adb INCF 0xdb,0x1,0x0 002fe2 cfdb MOVFF 0xfdb,0xfe9 002fe4 ffe9 002fe6 0e3a MOVLW 0x3a 002fe8 e3ed BNC 0x2fc4 002fea 2adb INCF 0xdb,0x1,0x0 002fec d7eb BRA 0x2fc4 002fd2 d944 RCALL 0x325c if (putc (cval, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002fd4 0e09 MOVLW 0x9 002fd6 d9ad RCALL 0x3332 002fd8 e102 BNZ 0x2fde 002fda 1c2b COMF 0x2b,0x0,0x0 002fdc e03b BZ 0x3054 003332 cfdb MOVFF 0xfdb,0xfe6 003334 ffe6 003336 ef52 GOTO 0x30a4 003338 f018 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* if there are any spaces left, they go to right-pad C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c the field */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002fee d855 RCALL 0x309a if (s_put_n_chars (handle, space_cnt, ' ')) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ff0 e131 BNZ 0x3054 00309a 0e20 MOVLW 0x20 00309c 6ee6 MOVWF 0xe6,0x0 00309e 0e08 MOVLW 0x8 0030a0 efa5 GOTO 0x334a 0030a2 f019 00325c 0efc MOVLW 0xfc 00325e cfdb MOVFF 0xfdb,0xfe6 003260 ffe6 003262 0efd MOVLW 0xfd 003264 cfdb MOVFF 0xfdb,0xfe6 003266 ffe6 003268 0012 RETURN 0x0 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ff2 0e16 MOVLW 0x16 count += precision + digit_cnt + space_cnt + prefix_cnt; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 002ff4 cfdb MOVFF 0xfdb,0xfe6 002ff6 ffe6 002ff8 0e08 MOVLW 0x8 002ffa d8c3 RCALL 0x3182 002ffc 52e5 MOVF 0xe5,0x1,0x0 002ffe 24e7 ADDWF 0xe7,0x0,0x0 003000 d85d RCALL 0x30bc 0030bc 6e2a MOVWF 0x2a,0x0 0030be 6a2b CLRF 0x2b,0x0 0030c0 50d9 MOVF 0xd9,0x0,0x0 0030c2 0f01 ADDLW 0x1 0030c4 d94d RCALL 0x3360 0030c6 502a MOVF 0x2a,0x0,0x0 0030c8 26ee ADDWF 0xee,0x1,0x0 0030ca 502b MOVF 0x2b,0x0,0x0 0030cc 22ed ADDWFC 0xed,0x1,0x0 0030ce 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003002 d02e BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case 'n': C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003004 0e07 MOVLW 0x7 switch (size) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003006 50db MOVF 0xdb,0x0,0x0 003008 0a03 XORLW 0x3 00300a e01c BZ 0x3044 00300c 0a01 XORLW 0x1 00300e e014 BZ 0x3038 003010 0a03 XORLW 0x3 003012 e007 BZ 0x3022 { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case _FMT_LONG: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003022 d8f5 RCALL 0x320e *(long *) va_arg (ap, long *) = count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003024 6a2f CLRF 0x2f,0x0 003026 ae2d BTFSS 0x2d,0x7,0x0 003028 d002 BRA 0x302e 00302a 682e SETF 0x2e,0x0 00302c 682f SETF 0x2f,0x0 00302e d82c RCALL 0x3088 003030 d8bc RCALL 0x31aa 003032 c02f MOVFF 0x2f,0xfee 003034 ffee 0031aa 50ee MOVF 0xee,0x0,0x0 0031ac cfef MOVFF 0xfef,0xfea 0031ae ffea 0031b0 6ee9 MOVWF 0xe9,0x0 0031b2 c02c MOVFF 0x2c,0xfee 0031b4 ffee 0031b6 c02d MOVFF 0x2d,0xfee 0031b8 ffee 0031ba c02e MOVFF 0x2e,0xfee 0031bc ffee 0031be 0012 RETURN 0x0 00320e 0e01 MOVLW 0x1 003210 cfdb MOVFF 0xfdb,0x2c 003212 f02c 003214 0e02 MOVLW 0x2 003216 cfdb MOVFF 0xfdb,0x2d 003218 f02d 00321a 6a2e CLRF 0x2e,0x0 00321c 0012 RETURN 0x0 003036 d014 BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case _FMT_SHLONG: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003038 d8ea RCALL 0x320e *(short long *) va_arg (ap, short long *) = count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00303a be2d BTFSC 0x2d,0x7,0x0 00303c 682e SETF 0x2e,0x0 00303e d824 RCALL 0x3088 003040 d8b4 RCALL 0x31aa 003042 d00e BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c case _FMT_BYTE: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003044 d963 RCALL 0x330c *(signed char *) va_arg (ap, signed char *) = count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003046 cfdb MOVFF 0xfdb,0xfef 003048 ffef 00304a d00a BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c default: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003014 d97b RCALL 0x330c *(int *) va_arg (ap, int *) = count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003016 cfdb MOVFF 0xfdb,0xfee 003018 ffee 00301a 0e02 MOVLW 0x2 00301c cfdb MOVFF 0xfdb,0xfed 00301e ffed 00330c debd RCALL 0x3088 00330e 50ee MOVF 0xee,0x0,0x0 003310 cfef MOVFF 0xfef,0xfea 003312 ffea 003314 6ee9 MOVWF 0xe9,0x0 003316 0e01 MOVLW 0x1 003318 0012 RETURN 0x0 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003020 d01f BRA 0x3060 break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c default: C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c /* undefined behaviour. we do nothing */ C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c break; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c else C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c { C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00304c d97b RCALL 0x3344 if (putc (c, handle) == EOF) C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00304e e105 BNZ 0x305a 003050 1c2b COMF 0x2b,0x0,0x0 003052 e103 BNZ 0x305a 0030a4 ecab CALL 0x4356,0x0 0030a6 f021 0030a8 52e5 MOVF 0xe5,0x1,0x0 0030aa 52e5 MOVF 0xe5,0x1,0x0 0030ac 52e5 MOVF 0xe5,0x1,0x0 0030ae cff3 MOVFF 0xff3,0x2a 0030b0 f02a 0030b2 cff4 MOVFF 0xff4,0x2b 0030b4 f02b 0030b6 0100 MOVLB 0x0 0030b8 1cf3 COMF 0xf3,0x0,0x0 0030ba 0012 RETURN 0x0 0032ea cfdf MOVFF 0xfdf,0xfe6 0032ec ffe6 0032ee ef52 GOTO 0x30a4 0032f0 f018 003344 df8b RCALL 0x325c 003346 ef75 GOTO 0x32ea 003348 f019 003054 68f3 SETF 0xf3,0x0 return EOF; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003056 68f4 SETF 0xf4,0x0 003058 d010 BRA 0x307a 00305a d8fc RCALL 0x3254 ++count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00305c e301 BNC 0x3060 00305e 2adb INCF 0xdb,0x1,0x0 003254 0e01 MOVLW 0x1 003256 2adb INCF 0xdb,0x1,0x0 003258 0e02 MOVLW 0x2 00325a 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003066 0e01 MOVLW 0x1 return count; C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 003068 cfdb MOVFF 0xfdb,0x2a 00306a f02a 00306c 0e02 MOVLW 0x2 00306e cfdb MOVFF 0xfdb,0x2b 003070 f02b 003072 c02a MOVFF 0x2a,0xff3 003074 fff3 003076 c02b MOVFF 0x2b,0xff4 003078 fff4 00307a 0e3b MOVLW 0x3b } C:\MCC18\src\TRADIT~1\stdclib\vfprintf.c 00307c 5ce1 SUBWF 0xe1,0x0,0x0 00307e e202 BC 0x3084 003080 6ae1 CLRF 0xe1,0x0 003082 52e5 MOVF 0xe5,0x1,0x0 003084 6ee1 MOVWF 0xe1,0x0 003086 d0cb BRA 0x321e /*** Unsigned Integer Division: 32-bit by 32-bit C:\MCC18\src\TRADIT~1\math\fxd3232u.c *** C:\MCC18\src\TRADIT~1\math\fxd3232u.c *** Optimized: Dec. 21, 2000 C:\MCC18\src\TRADIT~1\math\fxd3232u.c *** by: Daniel R. Madill, Quanser Consulting Inc. C:\MCC18\src\TRADIT~1\math\fxd3232u.c *** for: Saved (for the worst case) at least 8*32 = 256 instruction cycles C:\MCC18\src\TRADIT~1\math\fxd3232u.c *** over the code supplied with MCC18 v1.00.12 C:\MCC18\src\TRADIT~1\math\fxd3232u.c ***/ C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c void FXD3232U(void/* ulong aarg, ulong barg */) C:\MCC18\src\TRADIT~1\math\fxd3232u.c { C:\MCC18\src\TRADIT~1\math\fxd3232u.c // use INDF1 for the counter... C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c _asm C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c // REM = 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 0044fc 6a1b CLRF 0x1b,0x0 clrf __REMB0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 0044fe 6a1a CLRF 0x1a,0x0 clrf __REMB1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004500 6a19 CLRF 0x19,0x0 clrf __REMB2, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004502 6a18 CLRF 0x18,0x0 clrf __REMB3, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c // INDF1 = 32 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004504 0e20 MOVLW 0x20 movlw 32 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004506 6ee7 MOVWF 0xe7,0x0 movwf INDF1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c // Clear the carry C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004508 90d8 BCF 0xd8,0x0,0x0 bcf STATUS, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c loop: C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c //AARG32 <<= 1; The carry is always clear at the top of the loop. C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00450a 361c RLCF 0x1c,0x1,0x0 rlcf __AARGB3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00450c 361d RLCF 0x1d,0x1,0x0 rlcf __AARGB2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00450e 361e RLCF 0x1e,0x1,0x0 rlcf __AARGB1, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004510 361f RLCF 0x1f,0x1,0x0 rlcf __AARGB0, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c //REM32 = (REM32 << 1) | (AARG32 >> 32) C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004512 3618 RLCF 0x18,0x1,0x0 rlcf __REMB3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004514 3619 RLCF 0x19,0x1,0x0 rlcf __REMB2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004516 361a RLCF 0x1a,0x1,0x0 rlcf __REMB1, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004518 361b RLCF 0x1b,0x1,0x0 rlcf __REMB0, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c //if (PROD >= BARG32) C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00451a 5021 MOVF 0x21,0x0,0x0 movf __BARGB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00451c 5c18 SUBWF 0x18,0x0,0x0 subwf __REMB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00451e 5022 MOVF 0x22,0x0,0x0 movf __BARGB2, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004520 5819 SUBWFB 0x19,0x0,0x0 subwfb __REMB2, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004522 5023 MOVF 0x23,0x0,0x0 movf __BARGB1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004524 581a SUBWFB 0x1a,0x0,0x0 subwfb __REMB1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004526 5024 MOVF 0x24,0x0,0x0 movf __BARGB0, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004528 581b SUBWFB 0x1b,0x0,0x0 subwfb __REMB0, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00452a e309 BNC 0x453e bnc _false C:\MCC18\src\TRADIT~1\math\fxd3232u.c //{ C:\MCC18\src\TRADIT~1\math\fxd3232u.c //REM32-= BARG32; C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00452c 5021 MOVF 0x21,0x0,0x0 movf __BARGB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00452e 5e18 SUBWF 0x18,0x1,0x0 subwf __REMB3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004530 5022 MOVF 0x22,0x0,0x0 movf __BARGB2, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004532 5a19 SUBWFB 0x19,0x1,0x0 subwfb __REMB2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004534 5023 MOVF 0x23,0x0,0x0 movf __BARGB1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004536 5a1a SUBWFB 0x1a,0x1,0x0 subwfb __REMB1, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004538 5024 MOVF 0x24,0x0,0x0 movf __BARGB0, 0, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00453a 5a1b SUBWFB 0x1b,0x1,0x0 subwfb __REMB0, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c //++AARG32; Since AARG32 was shift to the left above, we only need to set C:\MCC18\src\TRADIT~1\math\fxd3232u.c // the lowest bit. Use incf so that the carry flag will also be cleared. C:\MCC18\src\TRADIT~1\math\fxd3232u.c // Thus, the carry will always be clear at the top of the loop. C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00453c 2a1c INCF 0x1c,0x1,0x0 incf __AARGB3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxd3232u.c //} C:\MCC18\src\TRADIT~1\math\fxd3232u.c _false: C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c 00453e 2ee7 DECFSZ 0xe7,0x1,0x0 decfsz INDF1, 1, 0 // does not affect the carry bit C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004540 d7e4 BRA 0x450a bra loop C:\MCC18\src\TRADIT~1\math\fxd3232u.c C:\MCC18\src\TRADIT~1\math\fxd3232u.c /* result in AARG already... */ C:\MCC18\src\TRADIT~1\math\fxd3232u.c _endasm C:\MCC18\src\TRADIT~1\math\fxd3232u.c 004542 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\math\fxd3232u.c ; RCS Header $Id: fxm1616s.asm,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; $Revision: 1.3 $ C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm include ; general Golden Gate definitions C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm include ; Math library definitions C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; RCS Header $Id: cmath18.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC ; $Revision: 1.3 $ C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC LIST C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC ; CMATH18.INC v1.0 Microchip Technology, Inc. / F.J. Testa C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC LIST C:\MCC18\SRC\TRADIT~1\MATH\CMATH18.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm include ; AARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; RCS Header $Id: aarg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AARGB0, __AARGB1, __AARGB2, __AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AARGB4, __AARGB5, __AARGB6, __AARGB7 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __AEXP C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC EXTERN __REMB3, __REMB2, __REMB1, __REMB0 C:\MCC18\SRC\TRADIT~1\MATH\AARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm include ; BARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; RCS Header $Id: barg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC EXTERN __BARGB3, __BARGB2, __BARGB1, __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC EXTERN __BEXP C:\MCC18\SRC\TRADIT~1\MATH\BARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm include ; TEMPARG declarations C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; RCS Header $Id: temparg.inc,v 1.3 2006/01/12 23:16:38 rhinec Exp $ C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC ; CMATH18 DATA DECLARATION FILE C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC EXTERN __TEMPB3, __TEMPB2, __TEMPB1, __TEMPB0, __TEMP C:\MCC18\SRC\TRADIT~1\MATH\TEMPARG.INC C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ;********************************************************************************************** C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ;********************************************************************************************** C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; 16x16 Bit Signed Fixed Point Multiply 16 x 16 -> 32 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Input: 16 bit signed fixed point multiplicand in AARGB0, AARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; 16 bit signed fixed point multiplier in BARGB0, BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Use: CALL FXM1616S C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Output: 32 bit signed fixed point product in AARGB0, AARGB1, C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; AARGB2, AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Result: AARG <-- AARG * BARG C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Max Timing: 39 clks C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; Min Timing: 31 clks C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm ; PM: 38 DM: 8 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm PROG CODE C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm FXM1616S C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm GLOBAL FXM1616S C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 0040f8 c01f MOVFF 0x1f,0x29 MOVFF __AARGB0,__TEMPB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 0040fa f029 0040fc c01e MOVFF 0x1e,0x28 MOVFF __AARGB1,__TEMPB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 0040fe f028 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004100 501e MOVF 0x1e,0x0,0x0 MOVF __AARGB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004102 0223 MULWF 0x23,0x0 MULWF __BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004104 cff4 MOVFF 0xff4,0x1d MOVFF PRODH,__AARGB2 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004106 f01d 004108 cff3 MOVFF 0xff3,0x1c MOVFF PRODL,__AARGB3 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00410a f01c C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00410c 501f MOVF 0x1f,0x0,0x0 MOVF __AARGB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00410e 0224 MULWF 0x24,0x0 MULWF __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004110 cff4 MOVFF 0xff4,0x1f MOVFF PRODH,__AARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004112 f01f 004114 cff3 MOVFF 0xff3,0x1e MOVFF PRODL,__AARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004116 f01e C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004118 0223 MULWF 0x23,0x0 MULWF __BARGB1 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00411a 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00411c 261d ADDWF 0x1d,0x1,0x0 ADDWF __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00411e 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004120 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004122 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004124 221f ADDWFC 0x1f,0x1,0x0 ADDWFC __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004126 5028 MOVF 0x28,0x0,0x0 MOVF __TEMPB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004128 0224 MULWF 0x24,0x0 MULWF __BARGB0 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00412a 50f3 MOVF 0xf3,0x0,0x0 MOVF PRODL,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00412c 261d ADDWF 0x1d,0x1,0x0 ADDWF __AARGB2,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00412e 50f4 MOVF 0xf4,0x0,0x0 MOVF PRODH,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004130 221e ADDWFC 0x1e,0x1,0x0 ADDWFC __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004132 6ae8 CLRF 0xe8,0x0 CLRF WREG C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004134 221f ADDWFC 0x1f,0x1,0x0 ADDWFC __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004136 ae24 BTFSS 0x24,0x7,0x0 BTFSS __BARGB0,MSB C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004138 efa2 GOTO 0x4144 GOTO TSIGN1616A C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00413a f020 00413c 5028 MOVF 0x28,0x0,0x0 MOVF __TEMPB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00413e 5e1e SUBWF 0x1e,0x1,0x0 SUBWF __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004140 5029 MOVF 0x29,0x0,0x0 MOVF __TEMPB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004142 5a1f SUBWFB 0x1f,0x1,0x0 SUBWFB __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm TSIGN1616A C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004144 ae29 BTFSS 0x29,0x7,0x0 BTFSS __TEMPB0,MSB C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004146 0c00 RETLW 0x0 RETLW 0x00 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004148 5023 MOVF 0x23,0x0,0x0 MOVF __BARGB1,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00414a 5e1e SUBWF 0x1e,0x1,0x0 SUBWF __AARGB1,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00414c 5024 MOVF 0x24,0x0,0x0 MOVF __BARGB0,W C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 00414e 5a1f SUBWFB 0x1f,0x1,0x0 SUBWFB __AARGB0,F C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm 004150 0c00 RETLW 0x0 RETLW 0x00 C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm END C:\MCC18\SRC\TRADIT~1\MATH\fxm1616s.asm /* a signed multiply is only different from an unsigned multiply C:\MCC18\src\TRADIT~1\math\fxm3232.c * if the upper bytes of the result matter, which for us they C:\MCC18\src\TRADIT~1\math\fxm3232.c * don't. C:\MCC18\src\TRADIT~1\math\fxm3232.c */ C:\MCC18\src\TRADIT~1\math\fxm3232.c C:\MCC18\src\TRADIT~1\math\fxm3232.c #define PRODH (PRODL + 1) C:\MCC18\src\TRADIT~1\math\fxm3232.c C:\MCC18\src\TRADIT~1\math\fxm3232.c extern near unsigned char __AARGB3, __BARGB3; C:\MCC18\src\TRADIT~1\math\fxm3232.c extern near unsigned char __AARGB7; C:\MCC18\src\TRADIT~1\math\fxm3232.c void FXM3232 (void) C:\MCC18\src\TRADIT~1\math\fxm3232.c { C:\MCC18\src\TRADIT~1\math\fxm3232.c _asm C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043da 501c MOVF 0x1c,0x0,0x0 movf __AARGB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043dc 0221 MULWF 0x21,0x0 mulwf __BARGB3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // low byte of both operands, so result adds into the low order C:\MCC18\src\TRADIT~1\math\fxm3232.c // result bytes C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043de cff3 MOVFF 0xff3,0x18 movff PRODL, __AARGB7 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043e0 f018 0043e2 cff4 MOVFF 0xff4,0x19 movff PRODH, __AARGB7 + 1 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043e4 f019 // W still contains AARGB3 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043e6 0222 MULWF 0x22,0x0 mulwf __BARGB3 + 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // BARGB3[1], so result adds into AARGB7[1,2] C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043e8 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043ea 2619 ADDWF 0x19,0x1,0x0 addwf __AARGB7 + 1, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043ec 0e00 MOVLW 0x0 movlw 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043ee 20f4 ADDWFC 0xf4,0x0,0x0 addwfc PRODH, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043f0 6e1a MOVWF 0x1a,0x0 movwf __AARGB7 + 2, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // reload AARGB3 to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043f2 501c MOVF 0x1c,0x0,0x0 movf __AARGB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043f4 0223 MULWF 0x23,0x0 mulwf __BARGB3 + 2, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // BARGB3[2], so result adds into AARGB7[2,3] C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043f6 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043f8 261a ADDWF 0x1a,0x1,0x0 addwf __AARGB7 + 2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043fa 0e00 MOVLW 0x0 movlw 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043fc 20f4 ADDWFC 0xf4,0x0,0x0 addwfc PRODH, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 0043fe 6e1b MOVWF 0x1b,0x0 movwf __AARGB7 + 3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // reload AARGB3 to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004400 501c MOVF 0x1c,0x0,0x0 movf __AARGB3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004402 0224 MULWF 0x24,0x0 mulwf __BARGB3 + 3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // BARGB3[3], so result adds into AARGB7[3]. C:\MCC18\src\TRADIT~1\math\fxm3232.c // we don't care about result bytes above AARGB7[3], ignore prodh here. C:\MCC18\src\TRADIT~1\math\fxm3232.c 004404 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004406 261b ADDWF 0x1b,0x1,0x0 addwf __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // that's the end of all terms involving AARGB3[0]. C:\MCC18\src\TRADIT~1\math\fxm3232.c // load AARGB3[1] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004408 501d MOVF 0x1d,0x0,0x0 movf __AARGB3 + 1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00440a 0221 MULWF 0x21,0x0 mulwf __BARGB3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[1], so result adds into AARGB7[1,2] C:\MCC18\src\TRADIT~1\math\fxm3232.c 00440c 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00440e 2619 ADDWF 0x19,0x1,0x0 addwf __AARGB7 + 1, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004410 50f4 MOVF 0xf4,0x0,0x0 movf PRODH, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004412 221a ADDWFC 0x1a,0x1,0x0 addwfc __AARGB7 + 2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004414 0e00 MOVLW 0x0 movlw 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004416 221b ADDWFC 0x1b,0x1,0x0 addwfc __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // reload AARGB3[1] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004418 501d MOVF 0x1d,0x0,0x0 movf __AARGB3 + 1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00441a 0222 MULWF 0x22,0x0 mulwf __BARGB3 + 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[1] and BARGB3[1], so result adds into AARGB7[2,3] C:\MCC18\src\TRADIT~1\math\fxm3232.c 00441c 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00441e 261a ADDWF 0x1a,0x1,0x0 addwf __AARGB7 + 2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004420 50f4 MOVF 0xf4,0x0,0x0 movf PRODH, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004422 221b ADDWFC 0x1b,0x1,0x0 addwfc __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // reload AARGB3[1] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004424 501d MOVF 0x1d,0x0,0x0 movf __AARGB3 + 1, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004426 0223 MULWF 0x23,0x0 mulwf __BARGB3 + 2, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[1] and BARGB3[2], so result adds into AARGB7[3] C:\MCC18\src\TRADIT~1\math\fxm3232.c // we don't care about result bytes above AARGB7[3], ignore prodh here. C:\MCC18\src\TRADIT~1\math\fxm3232.c 004428 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00442a 261b ADDWF 0x1b,0x1,0x0 addwf __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // all bytes of the term from the product of AARGB3[1] and BARGB3[3] are C:\MCC18\src\TRADIT~1\math\fxm3232.c // above our 32-bit result, don't even need to bother calculating C:\MCC18\src\TRADIT~1\math\fxm3232.c // that term. C:\MCC18\src\TRADIT~1\math\fxm3232.c // load AARGB3[2] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 00442c 501e MOVF 0x1e,0x0,0x0 movf __AARGB3 + 2, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00442e 0221 MULWF 0x21,0x0 mulwf __BARGB3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[2] and BARGB3[0], so result adds into AARGB7[2,3] C:\MCC18\src\TRADIT~1\math\fxm3232.c 004430 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004432 261a ADDWF 0x1a,0x1,0x0 addwf __AARGB7 + 2, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004434 50f4 MOVF 0xf4,0x0,0x0 movf PRODH, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004436 221b ADDWFC 0x1b,0x1,0x0 addwfc __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // reload AARGB3[2] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004438 501e MOVF 0x1e,0x0,0x0 movf __AARGB3 + 2, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00443a 0222 MULWF 0x22,0x0 mulwf __BARGB3 + 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[2] and BARGB3[1], so result adds into AARGB7[3] C:\MCC18\src\TRADIT~1\math\fxm3232.c // we don't care about result bytes above AARGB7[3], ignore prodh here. C:\MCC18\src\TRADIT~1\math\fxm3232.c 00443c 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 00443e 261b ADDWF 0x1b,0x1,0x0 addwf __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // all bytes of the termsfrom the products of AARGB3[2] and BARGB3[2,3] are C:\MCC18\src\TRADIT~1\math\fxm3232.c // above our 32-bit result, don't even need to bother calculating C:\MCC18\src\TRADIT~1\math\fxm3232.c // those terms. C:\MCC18\src\TRADIT~1\math\fxm3232.c // load AARGB3[3] to continue C:\MCC18\src\TRADIT~1\math\fxm3232.c 004440 501f MOVF 0x1f,0x0,0x0 movf __AARGB3 + 3, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004442 0221 MULWF 0x21,0x0 mulwf __BARGB3, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c // AARGB3[3] and BARGB3[0], so result adds into AARGB7[3] C:\MCC18\src\TRADIT~1\math\fxm3232.c 004444 50f3 MOVF 0xf3,0x0,0x0 movf PRODL, 0, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c 004446 261b ADDWF 0x1b,0x1,0x0 addwf __AARGB7 + 3, 1, 0 C:\MCC18\src\TRADIT~1\math\fxm3232.c C:\MCC18\src\TRADIT~1\math\fxm3232.c _endasm; C:\MCC18\src\TRADIT~1\math\fxm3232.c 004448 0012 RETURN 0x0 } C:\MCC18\src\TRADIT~1\math\fxm3232.c #include "P18CXXX.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC #include "P18MACRO.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; $Id: p18macro.inc,v 1.2 2005/05/20 15:34:54 GrosbaJ Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; MACROS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC LIST C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkSetPtrToOffset macro Ptr,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Set pointer Ptr to argument in stack frame at Offset. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkPushPtrToOffset macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Push pointer onto stack to point to Offset location in stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Offset defined before push. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf INDF1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf PREINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTINC1,F,ACCESS ; increment FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkAddStackPtr macro N C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add N to FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(N) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(N&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS ; restore FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS ; restore FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+3) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 1 byte at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 2 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 3 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytesin stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytes at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;====== These branches are short ============== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWeqZ macro Label ; jmp if W == 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf WREG,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWneZ macro Label ; jmp if W != 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC tstfsz WREG,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFleL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfsgt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFgeL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfslt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpClr macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfss Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpSet macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; @name isdigit C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ;The {\bf isdigit} function tests the value of {\bf c} to determine if it C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ;is a digit character. A digit character is defined as any decimal digit C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ;character (0, 1, 2, 3, 4, 5, 6, 7, 8, 9). C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; int isdigit (int c); C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm CTYPE CODE C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm isdigit C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm global isdigit C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; Proceedure: Use FSR0 as pointer to 'c' C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; Return with result in PROD C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; Clear out result C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044d8 6af3 CLRF 0xf3,0x0 clrf PRODL, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044da 6af4 CLRF 0xf4,0x0 clrf PRODH, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; Set FSR0 = FSR1 - 2 ( location of 'c') C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044dc 0eff MOVLW 0xff StkSetPtrToOffset FSR0L,-1 C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044de 24e1 ADDWF 0xe1,0x0,0x0 0044e0 6ee9 MOVWF 0xe9,0x0 0044e2 0eff MOVLW 0xff 0044e4 20e2 ADDWFC 0xe2,0x0,0x0 0044e6 6eea MOVWF 0xea,0x0 C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044e8 66ed TSTFSZ 0xed,0x0 tstfsz POSTDEC0,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044ea d007 BRA 0x44fa bra jNoMatch ; upper byte must be 0 to match C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm ; Test for condition C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044ec 0e2f MOVLW 0x2f jmpFleL INDF0,ACCESS,'0'-1,jNoMatch C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044ee 64ef CPFSGT 0xef,0x0 0044f0 d004 BRA 0x44fa 0044f2 0e3a MOVLW 0x3a jmpFgeL INDF0,ACCESS,'9'+1,jNoMatch C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044f4 60ef CPFSLT 0xef,0x0 0044f6 d001 BRA 0x44fa C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm jMatch: C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044f8 2af3 INCF 0xf3,0x1,0x0 incf PRODL,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm jNoMatch: C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm 0044fa 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm end C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\isdigit.asm #include C:\MCC18\src\TRADIT~1\stdclib\putc.c C:\MCC18\src\TRADIT~1\stdclib\putc.c int _user_putc (char c); C:\MCC18\src\TRADIT~1\stdclib\putc.c int _usart_putc (char c); C:\MCC18\src\TRADIT~1\stdclib\putc.c C:\MCC18\src\TRADIT~1\stdclib\putc.c int C:\MCC18\src\TRADIT~1\stdclib\putc.c 004356 cfd9 MOVFF 0xfd9,0xfe6 putc (char c, FILE * f) C:\MCC18\src\TRADIT~1\stdclib\putc.c 004358 ffe6 00435a cfda MOVFF 0xfda,0xfe6 00435c ffe6 00435e cfe1 MOVFF 0xfe1,0xfd9 004360 ffd9 004362 cfe2 MOVFF 0xfe2,0xfda 004364 ffda { C:\MCC18\src\TRADIT~1\stdclib\putc.c /* if the handle > 0 then it's a pointer to a string buffer address. C:\MCC18\src\TRADIT~1\stdclib\putc.c specifically, a pointer to a pointer referencing the next available C:\MCC18\src\TRADIT~1\stdclib\putc.c byte in the buffer, to which the character will be stored. */ C:\MCC18\src\TRADIT~1\stdclib\putc.c 004366 0efb MOVLW 0xfb if ((int) f >= 0) C:\MCC18\src\TRADIT~1\stdclib\putc.c 004368 cfdb MOVFF 0xfdb,0x2a 00436a f02a 00436c 0efc MOVLW 0xfc 00436e cfdb MOVFF 0xfdb,0x2b 004370 f02b 004372 0100 MOVLB 0x0 004374 0e80 MOVLW 0x80 004376 142b ANDWF 0x2b,0x0,0x0 004378 e11a BNZ 0x43ae 00437a 0efb MOVLW 0xfb return (unsigned char) (*(*(char **) f)++ = c); C:\MCC18\src\TRADIT~1\stdclib\putc.c 00437c cfdb MOVFF 0xfdb,0xfe9 00437e ffe9 004380 0efc MOVLW 0xfc 004382 cfdb MOVFF 0xfdb,0xfea 004384 ffea 004386 cfee MOVFF 0xfee,0xff3 004388 fff3 00438a cfed MOVFF 0xfed,0xff4 00438c fff4 00438e 2aee INCF 0xee,0x1,0x0 004390 0e00 MOVLW 0x0 004392 22ef ADDWFC 0xef,0x1,0x0 004394 cff3 MOVFF 0xff3,0xfe9 004396 ffe9 004398 cff4 MOVFF 0xff4,0xfea 00439a ffea 00439c 0efd MOVLW 0xfd 00439e cfdb MOVFF 0xfdb,0xfef 0043a0 ffef 0043a2 50ef MOVF 0xef,0x0,0x0 0043a4 6a2b CLRF 0x2b,0x0 0043a6 6ef3 MOVWF 0xf3,0x0 0043a8 c02b MOVFF 0x2b,0xff4 0043aa fff4 0043ac d010 BRA 0x43ce C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043ae 0efb MOVLW 0xfb if ((signed char) f == (signed char) _H_USART) C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043b0 50db MOVF 0xdb,0x0,0x0 0043b2 08fe SUBLW 0xfe 0043b4 e106 BNZ 0x43c2 { C:\MCC18\src\TRADIT~1\stdclib\putc.c /* the invocation of the USART function is direct, as it's our C:\MCC18\src\TRADIT~1\stdclib\putc.c default value and we want it to work without needing any C:\MCC18\src\TRADIT~1\stdclib\putc.c direct initialization from the user */ C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043b6 0efd MOVLW 0xfd return _usart_putc (c); C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043b8 cfdb MOVFF 0xfdb,0xfe6 0043ba ffe6 0043bc eccf CALL 0x459e,0x0 0043be f022 0043c0 d005 BRA 0x43cc } C:\MCC18\src\TRADIT~1\stdclib\putc.c else C:\MCC18\src\TRADIT~1\stdclib\putc.c { C:\MCC18\src\TRADIT~1\stdclib\putc.c /* the invocation of the user function is direct, not via a C:\MCC18\src\TRADIT~1\stdclib\putc.c function pointer. We just put an empty definition of the C:\MCC18\src\TRADIT~1\stdclib\putc.c function in the library and if the user specifies their own C:\MCC18\src\TRADIT~1\stdclib\putc.c version it will be found first and the library definition will C:\MCC18\src\TRADIT~1\stdclib\putc.c be ignored. We do it this way because it's generally better to C:\MCC18\src\TRADIT~1\stdclib\putc.c spend 2 bytes of program memory for the RETURN instruction of C:\MCC18\src\TRADIT~1\stdclib\putc.c the empty function than three bytes of data memory for the C:\MCC18\src\TRADIT~1\stdclib\putc.c function pointer. */ C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043c2 0efd MOVLW 0xfd return _user_putc (c); C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043c4 cfdb MOVFF 0xfdb,0xfe6 0043c6 ffe6 0043c8 ecb3 CALL 0xf66,0x0 0043ca f007 0043cc 52e5 MOVF 0xe5,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043ce 52e5 MOVF 0xe5,0x1,0x0 } C:\MCC18\src\TRADIT~1\stdclib\putc.c 0043d0 cfe5 MOVFF 0xfe5,0xfda 0043d2 ffda 0043d4 cfe7 MOVFF 0xfe7,0xfd9 0043d6 ffd9 0043d8 0012 RETURN 0x0 include C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\p18F2455.INC C:\MCC18\MPASM\p18F2455.INC ;========================================================================== C:\MCC18\MPASM\p18F2455.INC ; MPASM PIC18F2455 processor include C:\MCC18\MPASM\p18F2455.INC ; C:\MCC18\MPASM\p18F2455.INC ; (c) Copyright 1999-2007 Microchip Technology, All rights reserved C:\MCC18\MPASM\p18F2455.INC ;========================================================================== C:\MCC18\MPASM\p18F2455.INC C:\MCC18\MPASM\p18F2455.INC LIST C:\MCC18\MPASM\p18F2455.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1220 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1230 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1231 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1320 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1330 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __18F1331 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #define __USE_PORTB 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm GLOBAL _usart_putc C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm STDIO CODE C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm _usart_putc C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 00459e 0eff MOVLW 0xff MOVLW 0xff C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045a0 50e3 MOVF 0xe3,0x0,0x0 MOVF PLUSW1, w C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045a2 baac BTFSC 0xac,0x5,0x0 BTFSC TXSTA, 0x5 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045a4 d004 BRA 0x45ae BRA loop C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045a6 6aaf CLRF 0xaf,0x0 CLRF SPBRG C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045a8 8eab BSF 0xab,0x7,0x0 BSF RCSTA, 0x7 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045aa 8aac BSF 0xac,0x5,0x0 BSF TXSTA, 0x5 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #ifdef __USE_PORTB C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm BCF TRISB, 0x1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #else C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045ac 9c94 BCF 0x94,0x6,0x0 BCF TRISC, 0x6 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm #endif C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045ae a2ac BTFSS 0xac,0x1,0x0 loop: BTFSS TXSTA, 0x1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045b0 d7fe BRA 0x45ae BRA loop C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045b2 6ead MOVWF 0xad,0x0 MOVWF TXREG C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045b4 6ef3 MOVWF 0xf3,0x0 MOVWF PRODL C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045b6 6af4 CLRF 0xf4,0x0 CLRF PRODL + 1 C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm 0045b8 0012 RETURN 0x0 RETURN C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm END C:\MCC18\SRC\TRADIT~1\PMC\USART\_usartpc.asm ; $Id: strlen.asm,v 1.1 2003/12/09 22:53:20 GrosbaJ Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm #include "P18CXXX.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC #include "P18MACRO.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; $Id: p18macro.inc,v 1.2 2005/05/20 15:34:54 GrosbaJ Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; MACROS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC LIST C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkSetPtrToOffset macro Ptr,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Set pointer Ptr to argument in stack frame at Offset. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkPushPtrToOffset macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Push pointer onto stack to point to Offset location in stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Offset defined before push. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf INDF1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf PREINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTINC1,F,ACCESS ; increment FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkAddStackPtr macro N C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add N to FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(N) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(N&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS ; restore FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS ; restore FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+3) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 1 byte at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 2 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 3 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytesin stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytes at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;====== These branches are short ============== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWeqZ macro Label ; jmp if W == 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf WREG,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWneZ macro Label ; jmp if W != 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC tstfsz WREG,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFleL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfsgt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFgeL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfslt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpClr macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfss Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpSet macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; @name strlen C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;``The {\bf strlen} function computes the length of the string pointed C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;to by {\bf s}.'' C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;Stack usage: 2 bytes. Re-entrant. C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;@param s pointer to the string C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;@return ``The {\bf strlen} function returns the number of characters C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ;that precede the terminating null character.'' C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; size_t strlen (const char *s); C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm STRING CODE C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm strlen C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm global strlen C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Proceedure: Use FSR0 for 's' and use PROD for 'n'. C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Load FSR0 by copying 's' off stack into FSR0. C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 00444a 0efe MOVLW 0xfe Stk2CpyToReg -2,FSR0L C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 00444c cfe3 MOVFF 0xfe3,0xfe9 00444e ffe9 004450 0eff MOVLW 0xff 004452 cfe3 MOVFF 0xfe3,0xfea 004454 ffea C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Clear PROD C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 004456 6af3 CLRF 0xf3,0x0 clrf PRODL,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 004458 6af4 CLRF 0xf4,0x0 clrf PRODH,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Scan for '\0' while counting. C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm jLoop: C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Test for '\0' C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 00445a 52ee MOVF 0xee,0x1,0x0 movf POSTINC0,F,ACCESS ; set Z flag C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 00445c e003 BZ 0x4464 bz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; Count it C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 00445e 4af3 INFSNZ 0xf3,0x1,0x0 infsnz PRODL, F, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 004460 2af4 INCF 0xf4,0x1,0x0 incf PRODH, F, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 004462 d7fb BRA 0x445a bra jLoop C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm 004464 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm end C:\MCC18\SRC\TRADIT~1\STDCLIB\strlen.asm ; $Id: slenpgm.asm,v 1.4 2006/02/04 00:06:53 nairnj Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #include "P18CXXX.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm LIST C:\MCC18\MPASM\P18CXXX.INC ; P18CXXX.INC Standard Header File, Microchip Technology, Inc. C:\MCC18\MPASM\P18CXXX.INC LIST C:\MCC18\MPASM\P18C452.INC ; P18C452.INC Standard Header File, Version 0.12 Microchip Technology, Inc. C:\MCC18\MPASM\P18C452.INC LIST C:\MCC18\MPASM\P18C452.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C601 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C658 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C801 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18C858 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1230 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F1330 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F242 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F248 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F24K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F252 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F258 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F25K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F2685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F26K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4220 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4221 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4320 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4321 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4331 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F442 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4420 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4423 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4431 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4439 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4450 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4455 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F448 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4480 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F44K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4510 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4515 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F452 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4523 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4539 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4550 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4553 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F458 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4580 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F45K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4610 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4682 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F4685 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F46K20 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F63J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F64J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F65J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F66J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F6723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F67J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8310 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8390 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F83J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8410 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8490 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F84J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8520 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8525 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8527 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8585 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F85J90 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8620 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8621 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8622 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8627 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8628 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8680 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J15 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J16 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J55 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F86J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8720 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8722 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F8723 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J10 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J11 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J50 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F87J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F96J65 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC IFDEF __18F97J60 C:\MCC18\MPASM\P18CXXX.INC INCLUDE C:\MCC18\MPASM\P18CXXX.INC ENDIF C:\MCC18\MPASM\P18CXXX.INC C:\MCC18\MPASM\P18CXXX.INC #include "P18MACRO.INC" C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; $Id: p18macro.inc,v 1.2 2005/05/20 15:34:54 GrosbaJ Exp $ C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; MACROS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;========================================================================== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC LIST C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkSetPtrToOffset macro Ptr,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Set pointer Ptr to argument in stack frame at Offset. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf Ptr+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkPushPtrToOffset macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Push pointer onto stack to point to Offset location in stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Offset defined before push. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf INDF1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(Offset&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movwf PREINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTINC1,F,ACCESS ; increment FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC StkAddStackPtr macro N C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add N to FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(N) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf FSR1L,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw HIGH(N&0xFFFF) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc FSR1H,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR0 and push on stack. FSR0, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from FSR2 and push on stack. FSR2, WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get one byte from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get two bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PushFromReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Get three bytes from Reg and push on stack. WREG unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,POSTINC1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR0 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR0 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS ; restore FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at FSR2 without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFD C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFE C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS ; restore FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop one byte from stack and put it at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop two bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3PopToReg macro Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Pop three bytes from stack and put them at Reg without exposing stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw 0xFF C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC1,F,ACCESS ; decrement FSR1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,INDF2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from stack frame at Offset to FSR2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; WREG changed, FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTINC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+3) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,POSTDEC2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyToReg macro Offset,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from stack frame at Offset to Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+1) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset+2) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff PLUSW1,Reg+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR0 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC0,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff INDF2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4CpyFromFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy four bytes from FSR2 to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTINC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff POSTDEC2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy one byte from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw LOW(Offset) C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy two bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3CpyFromReg macro Reg,Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Copy three bytes from Reg to stack frame at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+1,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movff Reg+2,PLUSW1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Inc macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Increment 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3Dec macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Decrement 3 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bc jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 1 byte at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 2 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3TestForZero macro Offset,jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Test 3 bytes at Offset. Branch if zero. Returns 0 in WREG if zero. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz jZero C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jContinue C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR0 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR0. Pointer FSR0 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC0,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 1 byte in stack at Offset to byte at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 2 bytes in stack at Offset to 2 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk3AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 3 bytes in stack at Offset to 3 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4AddToFSR2 macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Add 4 bytes in stack at Offset to 4 bytes at FSR2. Pointer FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf PLUSW1,W,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC addwfc POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 2 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4ShiftLeft macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Shift left 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bcf STATUS,C C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC rlcf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytesin stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk4Negate macro Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 4 bytes in stack at Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC local jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw Offset+3 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf PLUSW1,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jEnd: C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk1NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 1 byte at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC Stk2NegateFSR2 macro C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ; Negate 2 bytes at FSR2. FSR2 unchanged. C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC incf POSTINC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc STATUS,Z C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC decf INDF2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC comf POSTDEC2,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC ;====== These branches are short ============== C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWeqZ macro Label ; jmp if W == 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf WREG,F,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpWneZ macro Label ; jmp if W != 0 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC tstfsz WREG,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneZ macro Reg,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg,F,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg,W,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFleL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfsgt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFgeL macro Reg,Acc,bVal,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movlw bVal C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC cpfslt Reg,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFeqF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpFneF macro Reg1,Acc1,Reg2,Acc2,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC movf Reg1,W,Acc1 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC subwf Reg2,W,Acc2 C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bnz Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpClr macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfss Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC jmpSet macro Reg,Bit,Acc,Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC btfsc Reg,Bit,Acc C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC bra Label C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC endm C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\P18MACRO.INC C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; @name strlenpgm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ;``The {\bf strlenpgm} function computes the length of the string pointed C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ;to by {\bf s}.'' C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ;@param s pointer to the string C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ;@return ``The {\bf strlenpgm} function returns the number of characters C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ;that precede the terminating null character.'' C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; sizerom_t strlenpgm (const rom char *s); C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm extern __AARGB2 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm STRING CODE C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm strlenpgm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm global strlenpgm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #ifdef __SMALL__ C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm messg "strlenpgm - SMALL" C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Procedure: Use TBLPTR for 's' and create 'n' on stack. Return 'n' in C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; __AARGB0:__AARGB1:__AARGB2. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Load TBLPTR by POPing 's' off stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm Stk2PopToReg TBLPTRL C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm clrf POSTDEC1,ACCESS ; provide extra byte below stack C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Push 3 bytes of 0 onto stack. This is initial value of 'n'. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Scan for '\0' while counting. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm jLoop: C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Test for '\0' C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm tblrd *+ ; read & increment C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm movf TABLAT, F, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm bz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Count it C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm Stk3Inc -3 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm bra jLoop C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm Stk3CpyToReg -3, __AARGB2 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm return C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #else C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #ifdef __LARGE__ C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm messg "strlenpgm - LARGE" C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Procedure: Use TBLPTR for 's' and create 'n' on stack. Return 'n' in C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; __AARGB0:__AARGB1:__AARGB2. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Load TBLPTR by POPing 's' off stack. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004466 0eff MOVLW 0xff Stk3PopToReg TBLPTRL C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004468 cfe3 MOVFF 0xfe3,0xff8 00446a fff8 00446c 52e5 MOVF 0xe5,0x1,0x0 00446e 0eff MOVLW 0xff 004470 cfe3 MOVFF 0xfe3,0xff7 004472 fff7 004474 52e5 MOVF 0xe5,0x1,0x0 004476 0eff MOVLW 0xff 004478 cfe3 MOVFF 0xfe3,0xff6 00447a fff6 00447c 52e5 MOVF 0xe5,0x1,0x0 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Push 3 bytes of 0 onto stack. This is initial value of 'n'. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 00447e 6ae6 CLRF 0xe6,0x0 clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004480 6ae6 CLRF 0xe6,0x0 clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004482 6ae6 CLRF 0xe6,0x0 clrf POSTINC1,ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Scan for '\0' while counting. C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm jLoop: C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Test for '\0' C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004484 0009 TBLRDPOSTINC tblrd *+ ; read & increment C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004486 52f5 MOVF 0xf5,0x1,0x0 movf TABLAT, F, ACCESS C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 004488 e009 BZ 0x449c bz jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm ; Count it C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 00448a 0efd MOVLW 0xfd Stk3Inc -3 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 00448c 2ae3 INCF 0xe3,0x1,0x0 00448e e105 BNZ 0x449a 004490 0efe MOVLW 0xfe 004492 2ae3 INCF 0xe3,0x1,0x0 004494 e102 BNZ 0x449a 004496 0eff MOVLW 0xff 004498 2ae3 INCF 0xe3,0x1,0x0 00449a d7f4 BRA 0x4484 bra jLoop C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm jEnd C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 00449c 0efd MOVLW 0xfd Stk3CpyToReg -3, __AARGB2 C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm 00449e cfe3 MOVFF 0xfe3,0x1d 0044a0 f01d 0044a2 0efe MOVLW 0xfe 0044a4 cfe3 MOVFF 0xfe3,0x1e 0044a6 f01e 0044a8 0eff MOVLW 0xff 0044aa cfe3 MOVFF 0xfe3,0x1f 0044ac f01f 0044ae 0012 RETURN 0x0 return C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #else C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm error "No Model Specified" C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #endif C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm #endif C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm end C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm C:\MCC18\SRC\TRADIT~1\STDCLIB\slenpgm.asm