FILL PIC16CXXX Example

MPASM Assembler

FILL PIC16CXXX Example

Directives highlighted in this example for PIC16CXXX devices are:

  • fill

Program Functional Description

The fill directive is used to program successive program memory locations with a constant or an assembly instruction.

Commented Code Listing

list p=16f877 ;Select the device.

#include <p16f877.inc> ;Include standard header file

;for the selected device.

org 0000 ;The following code will be

;programmed in reset address 0.

goto start ;Jump to an address labelled

;'start'.

FILL 0, INTRPT-$ ;Fill with 0 up to address 3.

INTRPT org 0004

goto ISR

FILL (goto start), start-$ ;Fill upto address 0Fh with

;instruction <goto start>.

ORG 0010

start ;Write your main program here.

FILL (nop), 5 ;Fill 5 locations with NOPs.

goto $

ISR ;

RETFIE

END


Microchip Technology Inc.
Microchip's Web Site
Voice: (480) 792-7200
Fax: (480) 899-9210
Microchip's E-mail Address
PreviousNext