DB PIC18CXXX Example

MPASM Assembler

DB PIC18CXXX Example

Directives highlighted in this example for PIC18CXXX devices are:

Program Functional Description

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

Commented Code Listing

list p=18c452 ;Select device.

#include <p18c452.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 to

;display the string given in

;'Ch_stng'.

goto $

ORG 1000 ;Store the string starting from

;1000H. In PIC18Cxxx devices, the

;first character is in least

;significant byte.

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

tb1_dta db 0,0xff ;Places ff00 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