Release Notes for MPASM™ Assembler v5.13
3 August 2007

Table of Contents
  1. Important MPLINK Linker and MPLAB IDE Compatibility Note
  2. Command Line Device Options Supported
  3. Operating System Support List
  4. Repairs and Enhancements Made Since v5.00
  5. Known Problems
  6. Using MPASM Assembler
  7. Customer Support
  1. Important MPLINK Linker and MPLAB IDE Compatibility Note

  2. Due to a change in COFF file format, MPASM Assembler v5.00 and later will not be compatible with versions of MPLINK Linker prior to v4.00 or versions of the MPLAB IDE prior to v7.21.

    MPASM Assembler v5.00 and later will have backward compatibility to earlier versions at the source level only. Any existing object files or libraries compiled with earlier versions of the tools will not link using new versions of the tools. They will need to be recompiled from source.

    If the user attempts to use this release with object files or libraries compiled with earlier versions of MPLAB C18, MPLINK Linker, and MPASM Assembler, the error message that will be received will be similar to:

    Error - Coff file format for 'C:\mcc18\lib/c018i.o' is out of date.
    

    If the user attempts to use an old version of MPLINK Linker to link object files or libraries compiled with this release, the error message that will be received will be similar to:

    Error - Coff file format for 'C:\mcc18\lib/c018i.o' does not appear to be a valid COFF file.

  3. Command Line Device Options Supported

  4. 10F200       10F202       10F204       10F206
    10F220       10F222
    
    12C508       12C508A      12C509       12C509A
    12C671       12C672
    12CE518      12CE519      12CE673      12CE674
    12CR509A
    12F508       12F509       12F510       12F519
    12F609       12F615       12F629       12F635
    12F675       12F683
    12HV609      12HV615
    
    14000
    
    16C432       16C433       16C505       16C52
    16C54        16C54A       16C54B       16C54C
    16C55        16C554       16C557       16C558
    16C55A       16C56        16C56A       16C57
    16C57C       16C58A       16C58B
    16C5X
    16C61        16C62        16C620       16C620A
    16C621       16C621A      16C622       16C622A
    16C62A       16C62B       16C63        16C63A
    16C64        16C642       16C64A       16C65
    16C65A       16C65B       16C66        16C662
    16C67        16C71        16C710       16C711
    16C712       16C715       16C716       16C717
    16C72        16C72A       16C73        16C73A
    16C73B       16C74        16C745       16C747
    16C74A       16C74B       16C76        16C765
    16C77        16C770       16C771       16C773
    16C774       16C781       16C782       16C84
    16C923       16C924       16C925       16C926
    16CE623      16CE624      16CE625
    16CR54       16CR54A      16CR54B      16CR54C
    16CR56A      16CR57A      16CR57B      16CR57C
    16CR58A      16CR58B      16CR62       16CR620A
    16CR63       16CR64       16CR65       16CR72
    16CR83       16CR84
    16CXX
    16F505       16F506       16F526       16F54
    16F57
    16F59        16F610       16F616       16F627
    16F627A      16F628       16F628A      16F630
    16F631       16F636       16F639       16F648A
    16F676       16F677       16F684       16F685
    16F687       16F688       16F689       16F690
    16F716       16F72        16F722       16F723
    16F724       16F726       16F727       16F73
    16F737       16F74        16F76        16F767
    16F77        16F777       16F785       16F818
    16F819       16F83        16F84        16F84A
    16F87        16F870       16F871       16F872
    16F873       16F873A      16F874       16F874A
    16F876       16F876A      16F877       16F877A
    16F88        16F882       16F883       16F884
    16F886       16F887       16F913       16F914
    16F916       16F917       16F946
    
    16HV540      16HV610       16HV616      16HV785
    
    17C42        17C42A       17C43        17C44
    17C752       17C756       17C756A      17C762
    17C766
    17CR42       17CR43
    17CXX
    
    18C242+      18C252+      18C442+      18C452+
    18C601+      18C658+      18C801+      18C858+
    
    18F1220+     18F1230      18F1320+     18F1330
    18F13K50*    18F14K50*    18F2220+     18F2221
    18F2320+     18F2321      18F2331+     18F2410+
    18F242+      18F2420+     18F2423      18F2431+
    18F2439+     18F2450      18F2455+     18F2458
    18F248+      18F2480+     18F24J10+    18F24K20+
    18F2510+     18F2515+     18F252+      18F2520+
    18F2523      18F2525+     18F2539+     18F2550+
    18F2553      18F258+      18F2580+     18F2585+
    18F25J10+    18F25K20+    18F2610+     18F2620+
    18F2680+     18F2682      18F2685      18F26K20+
    18F4220+     18F4221      18F4320+     18F4321
    18F4331+     18F4410+     18F442+      18F4420+
    18F4423      18F4431+     18F4439+     18F4450
    18F4455+     18F4458      18F448+      18F4480+
    18F44J10+    18F44K20+    18F4510+     18F4515+
    18F452+      18F4520+     18F4523      18F4525+
    18F4539+     18F4550+     18F4553      18F458+
    18F4580+     18F4585+     18F45J10+    18F45K20+
    18F4610+     18F4620+     18F4680+     18F4682
    18F4685      18F46K20+    18F6310+     18F6313*
    18F6390+     18F6393*     18F63J11     18F63J90
    18F6410+     18F6413*     18F6490+     18F6493*
    18F64J11     18F64J90     18F6520+
    18F6525+     18F6527+     18F6585+     18F65J10+
    18F65J11     18F65J15+    18F65J50     18F65J90
    18F6620+     18F6621+     18F6622+     18F6627+
    18F6628      18F6680+     18F66J10+    18F66J11
    18F66J15+    18F66J16     18F66J50     18F66J55
    18F66J60     18F66J65     18F6720+     18F6722+
    18F6723      18F67J10+
    18F67J11     18F67J50     18F67J60     18F8310+
    18F8313*     18F8390+     18F8393*     18F83J11
    18F83J90     18F8410+     18F8413*     18F8490+
    18F8493*     18F84J11     18F84J90
    18F8520+     18F8525+     18F8527+     18F8585+
    18F85J10+    18F85J11     18F85J15+    18F85J50
    18F85J90     18F8620+     18F8621+     18F8622+
    18F8627+     18F8628      18F8680+     18F86J10+
    18F86J11
    18F86J15+    18F86J16     18F86J50     18F86J55
    18F86J60     18F86J65     18F8720+     18F8722+
    18F8723      18F87J10+    18F87J11     18F87J50
    18F87J60     18F96J60     18F96J65     18F97J60
    
    EEPROM16     EEPROM8
    
    RF509AF      RF509AG      RF675F       RF675H
    RF675K
    

    *Note: Early adopter support has been added for these devices since last release

    +Note: These are the only PIC18 devices with peripheral library support.

    THE PARTS CORRESPONDING TO THESE OPTIONS MAY NOT ALL BE COMMERCIALLY AVAILABLE.

    These can be chosen through the introductory screen, on the command line, or in source file.

    NOTES:
    • The selections 16C5X, 16CXX, 17CXX, and 18CXX are supported as generic family indicators.
    • The selections EEPROM8 and EEPROM16 are provided for generic memory product support. Read below for a description of how to use MPASM Assembler to generate files for programming Microchip Serial EEPROM devices.
    • Use files 'MCP250XX.INC' and 'MCP250XX.ASM' as references for programming I/O expander (MCP250XX) devices. The file 'MCP250XX.ASM' is in the 'TEMPLATE\CODE' directory under 'MPLAB'.
      The standard header files have been updated to reflect these devices. One header file, MEMORY.INC, is provided for generic memory product support. Another header file, MCP250XX.INC, is provided for generic MCP250XX device support.
    • The devices PIC18F2423, PIC18F2523, PIC18F4423, and PIC18F4523 were formerly known as PIC18LF2423, PIC18LF2523, PIC18LF4423, PIC18LF4523.
    • Use the P12C509A.INC header file for the PIC12CR509A; Use the P16C620A.INC header file for the PIC16CR620A.
    • Use the P16C74.INC header file for the PIC16CR74; Use the P16C77.INC header file for the PIC16CR77.
    • Use the 16C5X.INC header file for the following device command line options:
                      16C52
                      16C54
                      16CR54
                      16C54A
                      16CR54A
                      16C54B
                      16CR54B
                      16C54C
                      16CR54C
                      16C55
                      16C55A
                      16C56
                      16C56A
                      16CR56A
                      16C57
                      16CR57A
                      16CR57B
                      16C57C
                      16CR57C
                      16C58A
                      16CR58A
                      16C58B
                      16CR58B
      
    • Use the P16F5X.INC header file for the following device command line options:
                      16F54
                      16F57
                      16F59
      
  5. Operating System Support List

  6. MPASMWIN.EXE is the 32-bit Windows version of MPASM Assembler which is distributed with MPLAB IDE and MPLAB C18. It is supported by the following platforms:

    Windows 2000 and Windows XP

    MPASM.EXE is the command-line version of MPASM Assembler which is distributed with MPLAB C18 only. It is supported by the following platforms:

    Windows 2000 and Windows XP

    NOTE: MPASM.EXE does not support device file names greater than an 8.3 format (e.g. p18f87J15.INC). Use MPASMWIN.EXE instead.

  7. Repairs and Enhancements Made Since v5.10


    1. Problems resolved between v5.12 and v5.13:

      (MPASM-135)
      [18F8527] MAXROM value is incorrect

      (MPASM-140)
      PORTA bits RA6 and RA7 are missing in header file for 18F87J11 family.

      (MPASM-142)
      Bit names C1INV and C1OUT should be named as CINV and COUT in device 12F635.

      (MPASM-144)
      [12F683] GPIO does not have bit definition in the header file.

      (MPASM-145)
      In 18F4520 family bit 5 (RXDTP) and bit 4 (TXCKP) are missing from BAUDCON register

      (MPASM-146)
      In 18F4620 family bit 5 (RXDTP) and bit 4 (TXCKP) are missing from BAUDCON register

      (MPASM-147)
      In 18F4610 family bit 5 (RXDTP) and bit 4 (TXCKP) are missing from BAUDCON register


    2. Problems resolved between v5.11 and v5.12:

      (MPASM-51 / 21677)
      When using MPASM.EXE without the '/q' option, and an output file is specified to be in a nonexistent directory, then the output file is not generated, but no error message is emitted.
      When the '/q' option is used, the message "Couldn't open file..." is emitted. This can be confusing.

      (MPASM-125)
      MPASMWIN.exe reports an error if more than 5 Macros are provided on the command line using /d option.

      (MPASM-128)
      For PIC18F87J11 family, header file defines bit 5 PCFG5 of ANCON0, which is unimplemented.

      (MPASM-132)
      ADCON1 bit definitions are missing in header file for PIC16F616 and 16HV616 .

      (MPASM-134/MPASM-137)
      Projects do not build on PIC16F688. An error is displayed which points to line number 182 in PIC16F688.inc.

      (MPASM-136)
      For PIC18F1230 and PIC18F1330 the hex value of configuration bit settings for "_XINST_OFF_4L" and "_T1OSCMX_LOW_3H" are incorrect.

      (MPASM-138)
      Extra symbols "filler0" defined in P18F2458.INC

      (MPASM-139)
      [PIC18F2455/PIC18F2458] BAUDCON bit 4 named SCKP instead of TXCKP

      (MPASM-141)
      PIC18F87J50 family does not match data sheet for bit 0 and 1 for CM1CON and CM2CON

    3. Problems resolved between v5.10 and v5.11:

      (MPASM-53 / 21988 / MPASM-124)
      MPASM Assembler cannot handle a source file with UNIX-style line endings.

      (MPASM-109)
      RE2 (PORTE) pin is not available on PIC18F85J90 devices but the bit is present in INC files.

      (MPASM-121)
      PSPCON sfr is not available on PIC18F458 devices but is present in the INC files.

      (MPASM-122)
      Pin RA5 is not available on PIC18F2431 or PIC18F2331 but it is present in the INC files.

      (MPASM-123)
      For PIC18F4620 and PIC18F4525, the P1MX bits (CCP1CON) are missing in the header files.

      (MPASM-126)
      Add EEADR and EEDATA aliases to PIC16F917 family.

      (C18-282)
      [PIC18F2450] The BB2K and BB1K config definitions are swapped

  8. Known Problems

  9. The following is a list of known problems. For a list of limitations, please see MPASM Assembler Help, Troubleshooting, Assembler Limitations.

    (MPASM-4 / 1008)
    There are no warnings when overflow or underflow occurs during expression evaluation.

    (MPASM-30 / 16921)
    MPASM Assembler generates a COD file which cannot handle line number information for program memory addresses greater than 64K. This adversely affects debugging.
    The workaround is to generate a .O file, link with MPLINK Linker, and debug in MPLAB IDE v6.0 or greater.
    Here is an example of what might happen. Suppose the source is
            ORG 0xF00000
            DB 0xAB ; eedata
            ORG 0x0
            MOVLW 3
            MOVLW 4
    
    The disassembly window in MPLAB IDE may appear this way:
            Disassembly               Source
                                      ORG 0xF00000
            000000 0E03 MOVLW 3       DB 0xAB
                                      ORG 0x0
                                      MOVLW 3
            000000 0E04 MOVLW 4       MOVLW 4
    
    The source line for address 0xF00000 has been associated with the code at address 0x0.

    (MPASM-34 / 18510)
    A file register operand which is greater than the absolute max ram address does not generate a message of any kind.
    For example,
            LIST P=18F452
            MOVWF 0x1000
            END
    
    will assemble without warning.

    (MPASM-36 / 18811)
    MPASMWIN.exe generates incorrect code for 'goto' targeting a local label.
    A 'goto' targeting a local label is generating an instruction where the file register field is set to 0 instead of the local label's value.
    The workaround is to use the "$ + n" expression as the target of the 'goto'.

    (MPASM-40 / 19703)
    The Japanese directory delimiter character on Windows XP-J and Windows ME-J is not accepted by MPASM Assembler.
    The workaround is to invoke MPASM Assembler on the command line with a source file path which does not contain any directory delimiters.

    (MPASM-44 / 20776)
    The return value of the MPASMWIN.EXE process (returned by 'spawnvp') does not get stored in the DOS environment variable ERRORLEVEL.

    (MPASM-47 / 20986)
    When assembling with the '/o' option, a duplicate address label declaration causes no error, warning, or message. For example, the program fragment
            U1 IDATA
            X  DB 1
            U2 IDATA
            X  DB 2
                CODE
               MOVWF X
    
    assembles quietly, but the definition of X which is used in the MOVWF instruction is not well defined.

    (MPASM-52 / 21798)
    The length of the command line argument string to mpasm.exe is limited to about 120 characters. Anything beyond that is truncated.

    (MPASM-54 / 22227)
    Error messages are not emitted to standard out.

    (MPASM-56 / 22387)
    MPASM Assembler cannot assemble files in Unicode format.

    (MPASM-57 / 22541)
    A warning is not emitted if the operand for the PUSHL instruction is less than -128, only if it is less than -255. A warning should be emitted if the operand is less than -128, since the operand is 8 bits wide.

    (MPASM-58 / 22660)
    When assembling with '/o' and the operand of a DT directive is relocatable but more than 8 bits wide, the linker will fill both bytes of the directive with 16 bits of the operand (instead of truncating the operand to 8 bits for a RETLW instruction):
            UDATA 0x124
            X RES 1
            CODE 0x100
            DT X
    
    will generate 0x0124 at address 0x100 instead of 0x3424 (RETLW 0x24).

    (MPASM-63 / 23071)
    The LIST n=nnn directive does not properly format the listing file.

    (MPASM-67 / 23490)
    As MPASM Assembler rescans macro expressions, it searches the substituted arguments for parameters. E.g.,
            #define F(X,Y) X + Y
            Y EQU 2
            movlw F(Y,1)
    
    will yield movlw 2 instead of movlw 3. After Y is substituted in place of X, it is replaced itself by the second argument upon rescanning.

    (MPASM-76 / 24275)
    After a file is compiled, the debug information does not seem to be loaded.

    (MPASM-77 / 24560)
    No error or warning is produced for the following code:
            bsf   ,1
            END
    
    This assembles as if "bsf 0,1" was given.

    (MPASM-81 / 24794)
    MPASM Assembler generates invalid PIC18 relocation for $+<odd offset>. The following code, containing an invalid goto destination address, assembles without error when generating an object file (18f452):
                          code 0
                          bra start
    
            startscn      code 0x100
            start         nop
                          goto $-1
                          bra $
    
                          end
    
    causing a link-time error:

    Error - file 'C:\test\mpasm\gotoneg1.o', section 'startscn', Symbol '_startscn_0102' is not word-aligned.
    It can not be used as the target of a call or goto instruction.

    However, the assembler generates a warning when assembling equivalent code in absolute mode:
                          org 0
                          bra start
    
                          org 0x100
            start         nop
                          goto $-1
                          bra $
    
                          end
    

    Warning[226] C:\TEST\MPASM\GOTONEG1.ASM 8 : Destination address must be word aligned

    (MPASM-92 / 26223)
    MPASM Assembler does not correctly handle Windows CLI and DOS command line string limitations and error diagnostics can be ambiguous or absent.

    (MPASM-99 / 27088)
    MPASM Assembler may generate an invalid COFF file when passing an undefined constant as a macro parameter.
    For example:
            RM          MACRO Name,Size
                        LOCAL i    =0
            Name        RES   0
                        GLOBAL Name
                        WHILE i <Size
            Name#v(i)     RES 1
                          i +=1
                        ENDW
                        ENDM
            myuscn      UDATA
                        RM hello,myconstsz ; Should cause an assembly error
            myconstsz  equ  2
                        CODE
                        lfsr  0,hello0
                        END
    
    Assembly of this code causes only a warning, but MPLINK Linker gives an error message "reloc[0] has an invalid r_symndx." while trying to link the COFF file.
    MPASM Assembler should give an error.
    To avoid this problem, the code should define 'myconstsz' before calling the macro, as shown:
            myconstsz  equ 2
            RM hello, myconstsz
    
    (MPASM-101 / 27165)
    MPASM Assembler does not give an error when ENDIF is missing; it gives only a warning.
    With a macro like:
            IF (CONST)
            ; no ENDIF
    
    MPASM Assembler assembles it and gives no error, only a warning.

    (MPASM-105 / 27914)
    The assembler gives an error when the FILL macro is used with Address - $. For example, the following code:
            #include <p16f877a.inc>
    
            cfill code 0x7f
            fill (clrf PCLATH), H'4FF'-$
            end
    
    causes the assembler to give this error:
            Operand contains unresolvable labels or is too complex
    
    (MPASM-106 / 28228)
    Running the assembler on a file with a '.' in the name, other than the '.' separating the file extension from the base name, for example foo.bar.asm, results in a DOS error:
            File not found.
    
    Any resulting intermediate or output files will not include the portion of the file name after the first '.' For example, the file name above may cause files named foo.ERR, foo.COD, or foo.LST to be created.

    (MPASM-149)
    [16F526] Assembler internal value for this device is incorrect causing incorrect addressing in banks 1-3. Do not use this device.

  10. Using MPASM Assembler

  11. Create your source code with any text editor. The file should contain ASCII text only. Assemble your code with the command line:

            mpasm <file>[.asm]
    
    A version of MPASM Assembler is also available for Windows. To invoke this assembler, execute:
            mpasmwin
    
    from within Windows. You will then be given a Windows interface window. Help on using the interface is provided on-line. MPASMWIN.EXE can also be invoked with parameters or through drag-and-drop. In these cases, the interface screen is not displayed and assembly begins immediately.

    Correct any syntax problems, referring to the MPASM Assembler, MPLINK Object Linker, MPLIB Object Librarian User's Guide(DS33014) for syntax help. MPASM Assembler assembles with INHX32 as the default hex output, and generates a listing file, error file, and .COD file.

    Serial EEPROM Support:

    Two "processor" selections are provided to generate byte data - EEPROM8 and EEPROM16. Both generate data in terms of bytes, but EEPROM8 considers a "word" to be 8 bits wide, while EEPROM16 considers a "word" to be 16 bits wide. The "program counter" is always incremented in terms of bytes.

    The default size for memory products is 128 bytes. This can be overridden by using the LIST M=<max address> directive. Note that <max address> is always evaluated as a decimal number. The header file MEMORY.INC is provided to define the maximum address for available memory devices. The format of the defined symbols is _<device>; for example, to set the maximum memory size for a 24LCS21, use the directive LIST M=_24LCS21.

    The following data generation directives are supported for memory products:

            DW           FILL        ORG
    
    The behavior of other data generation directives is not guaranteed. All other directives are unchanged.

    An example of generating a file for programming a memory device is as follows:

    ;*************************************************
    ; Generate data for a 8-bit wide memory device.
    
            LIST    P=EEPROM8, R=DECIMAL
            INCLUDE "MEMORY.INC"
            LIST    M=_24LCS21
    
    #DEFINE MAX_VALUE       255
    
            ORG     0
    
    ;-------------------------------------------------
    ; Create a packed-byte, null terminated string.
    
            DW      "Hello World", 0
    
    ;-------------------------------------------------
    ; Create data representing a line.  The X position
    ; is implied from the position of the data in the
    ; device.  The Y values are stored in the device.
    
    ; First, define an equation for the line.
    
    #DEFINE Line( X )       Slope * X + Y_Intercept
    
    ; Now define the values needed for the equation.
    
    Slope                   EQU     10
    Y_Intercept             EQU     5
    
    ; Declare and initialize the X and Y values.
    
            VARIABLE        X = 0, Y = Line( X )
    
    ; Generate values until the maximum Y value is
    ; reached or the device is filled up.
    
            WHILE (Y <= MAX_VALUE) && ($ <= _24LCS21)
               DW   Y
    X = X + 1
    Y = Line( X )
            ENDW
    
    ;-------------------------------------------------
    ; Perform some checking based on the line data
    ; generated above.
    
    ; If the device filled up before the end of the
    ; line was reached, generate an error. Otherwise,
    ; if the device is almost out of room, generate a
    ; message.
    
            IF (Y < MAX_VALUE)
               ERROR        "Device is full."
            ELSE
               IF (($+10) > _24LCS21)
                  MESSG     "Device is nearly full."
               ENDIF
            ENDIF
    
    ;-------------------------------------------------
    ; Fill the rest of the device with zeroes.
    
            FILL    0, _24LCS21 - $ + 1
    
            END
    
    CLRW COMMAND:

    The CLRW encoding was changed on all 14-bit core devices from 0x0100 to 0x0103 (v1.40 and later). This will not affect the expected operation of the instruction, but it will change the value for the instruction in the hex file and therefore the checksum.

    WARNING MESSAGE:

    The text for Message #302 was modified to explain more clearly that bank indication bits are stripped when assembling instructions that access file registers. The appropriate bank must be selected by the appropriate bank selection bits. For example, 14-bit core devices contain the lower seven bits of the file register address in the opcode, with two bank selection bits in the STATUS register. The message was changed from:

            Argument out of range. Least significant bits used.
    
    to:
            Register in operand not in bank 0. Ensure that bank bits are correct.
    
    END DIRECTIVE:

    Take care to not use the END directive in a macro. If the END directive is encountered in a macro, it can cause the assembler to loop indefinitely. Macros should be terminated with the ENDM directive.

  12. Customer Support


  13. Microchip provides online support via our home page at:
    http://www.microchip.com

    Technical support is available through the web site at:
    http://support.microchip.com

    A forum for discussion of Microchip products and tools is available at:
    http://forum.microchip.com