DB PIC16CXXX Example

MPASM Assembler

DB PIC16CXXX Example

Directives highlighted in this example for PIC16CXXX devices are:

Program Functional Description

This example shows the usefulness of directive db in storing one or more byte or character in program memory.

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'.

start ;Write your main program here.

goto $

ORG 1000 ;Store the string starting from

;1000H.

Ch_stng db 0,'M',0,'C',0,'U'

tb1_dta db 0,0xff ;Places 00ff in program memory

;location.

end


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