specific controller
| MPASM | XC8 Assembler |
|---|---|
| LIST P = DeviceName | PROCESSOR DeviceName |
LIST (indicates specific controller, e.g., LIST P=18F452) unique to PIC assembler.
Include Files
| MPASM | XC8 Assembler |
|---|---|
| INCLUDE <DeviceName.INC> | #include <xc.inc> |
Set device’s configuration bits
| MPASM | XC8 Assembler |
|---|---|
| __CONFIG | The CONFIG directive with appropriate settings and values |
- MPASM:
__CONFIG _WDT_OFF & _PWRTE_ON & _CP_OFF
- PIC Assembler:
CONFIG WDT = OFF, PWRTE = ON, CP = OFF
Label name
Labels in PIC Assembler must be followed by a colon “:”
In MPASM the colon is optional.
Constants and Radices
By default, MPASM interprets the numeric constants as hexadecimal values.
PIC Assembler interprets them by default as decimal values!
This is where explicit definition can help with code portability.
| MPASM | XC8 Assembler |
|---|---|
| - | RADIX DEC |
numeric constants
Table 3-1. Equivalent Constants Radix Specifiers
| MPASM Constant Forms | Radix | PIC Assembler Equivalent |
|---|---|---|
| B’binary_digits' | Binary | binary_digitsB |
| O’octal_digits' | Octal | octal_digits[O |
| D’decimal_digits’ or .decimal_digits |
Decimal | decimal_digits[D |
| H’hexadecimal_digits’ or 0xhexadecimal_digits |
Hexadecimal | 0hexadecimal_digits[H |
| A’character’ or ‘character’ | ASCII | ‘character’ |
MPASM
movlw b'10110011' ; binary value
movlw o'72' ;octal value
movlw d'34' ;decimal value
movlw 4F ;hexadecimal value
movlw ‘b’ ;ASCII value
- decimal
movlw .34 ;decimal value
PIC Assembler
movlw 10110011B ;binary value
movlw 72q ;octal value
movlw 34 ;decimal value
movlw 04Fh ;hexadecimal value
movlw ‘b’ ;ASCII value
Ref
- MPASM to MPLAB XC8 PIC Assembler Migration Guide 50002973A
- MPLAB XC8 PIC Assembler User’s Guide 50002974A
- MPLAB-XC8-PIC-Assembler-User-Guide-50002974
- MPLAB XC8 PIC Assembler User’s Guide for Embedded Engineers
- MPASM to MPLAB XC8 PIC Assembler
- When to use banksel
- There is no make executable in the path. - MPLABX v5.35
- 4.43 list - Listing Options
- 4.8.5 Simple Example - MPASM Assembler User’s Guide
- What is the meaning of Microchip’s acronym TRIS for data direction registers?
- 2.4 Ports
- MPASM Removed? !!!