Mplab Xc8 Pic Assembler User 39-s Guide

Mplab Xc8 Pic Assembler User 39-s Guide

main: BANKSEL TRISB clrf TRISB ; Set PORTB to output BANKSEL PORTB loop: movlw 0xFF movwf PORTB call delay clrf PORTB call delay goto loop

Once you have read the basic chapters of the user guide, you will discover features that make XC8 assembly superior to old MPASM. mplab xc8 pic assembler user 39-s guide

Forget CODE and DATA directives from old assemblers. XC8 uses (Program Sections). The guide dedicates an entire chapter to this. You must define a PSECT for your code, like: main: BANKSEL TRISB clrf TRISB ; Set PORTB

: Supports a wide range of devices, from simple 12-bit instruction baseline cores to advanced PIC18 devices. main: BANKSEL TRISB clrf TRISB