.equ __P24FJ64GA002,1 ;required "boiler-plate" (BP) .include "p24Fxxxx.inc" ;BP #include "xc.inc" ;BP ;the next two lines set up the actual chip for operation - required config __CONFIG2, POSCMOD_NONE & I2C1SEL_PRI & IOL1WAY_OFF & OSCIOFNC_ON & FCKSM_CSECME & FNOSC_FRCPLL & SOSCSEL_LPSOSC & WUTSEL_FST & IESO_OFF config __CONFIG1, FWDTEN_OFF & COE_OFF & BKBUG_OFF & GWRP_OFF & GCP_OFF & JTAGEN_OFF .align 2 ;need this so that we have the next word at even address stack: .space 32 ;this will be our stack area, from var_16_bit to here .text ;BP (put the following data in ROM(program memory)) .global _main ;BP ;because we are using the C compiler to assemble our code, we need a "_main" label ;somewhere. (There's a link step that looks for it.) _main: bclr CLKDIV,#8 ;BP ;; mov #stack,w15 ;initialize the stack pointer mov #0xffff,w10 loop: inc WREG10 bra loop .end